[jbosstools-dev] JBoss Tools is branched for 4.0.0.Beta2

Max Rydahl Andersen max.andersen at redhat.com
Thu Nov 8 09:54:44 EST 2012


Rob is right, so is Martin.

PR for any simple changes (that is what we mostly do currently) is best done in 1 squashed commit.
PR with multiple commits increases the risk of something going foobar.

And yes, when you do a PR make sure your branched and rebased as close to the actual branch (wether that is beta2 or master) you are submitting the PR to.

But still, to keep things simple, better to keep PR's simple and only do more complex one if
its about some long term branch work or experiment ....and even then once its agreed on being correct
its better to squash it down for the final apply if most of the commits are just basic adjustments and 
fits better in one commit.

/max


On 08 Nov 2012, at 15:38, Martin Malina <mmalina at redhat.com> wrote:

> 
> On 8. 11. 2012, at 14:55, Rob Cernich <rcernich at redhat.com> wrote:
> 
>> 
>> 
>> 
>> On 8. 11. 2012, at 14:40, Rob Cernich <rcernich at redhat.com> wrote:
>> 
>> 
>> 
>> ----- Original Message -----
>> Yesterday we discussed on IRC that this can be tricky - if you have
>> one topic branch that was originally based on master for instance
>> and want to apply the changes to both master and Beta2x then you
>> need to be careful because if you rebase the Beta2x-based topic
>> branch to master, it will contain many more new commits and you
>> only want to cherry pick the ones you really need. That is clear
>> to me (I hope).
>> 
>> yes, as with any other PR that is "outofsync" cherrypicking is the
>> way to go.
>> 
>> But I'd like to ask another related question: What is the
>> recommended approach wrt pull requests here? The above assumes you
>> have one topic branch and hence one pull request. So are users
>> supposed to comment in the pull request saying they want it to be
>> applied to both branches? Or should they rather create to separate
>> pull requests for each branch (from 2 different topic branches)?
>> 
>> I would say it depends on the case - no reason to make things harder
>> to do than necessary :)
>> 
>> I would say a PR clearly marked as should going to both is enough in
>> many cases but while we are getting our feet wet here doing one for
>> each might be worth doing.
>> 
>> I think this really depends on how consistent the history is between the two branches.  If the branches have diverged, you may end up pulling in extra commits on one of the branches.  It's probably best to issue separate requests for each branch.
>> 
>> One thing that might help as your figuring things out would be to limit pull requests to a single commit (i.e. all changes for a particular JIRA should be squashed into a single commit).  This will allow you to see if you're pulling in multiple commits (which you won't know if there are multiple commits in the pull).  Just an idea.  (Actually, this is how we run things on SwitchYard.)
>> 
>> Yes, I agree this would reduce the risk of adding more commits to the destination branch than intended. But on the other hand a maintainer will usually be pretty clear on what to apply - at least the original pull request should show the correct commits that you want to be added.
>> 
>> My experience has been that Github will show you all commits that were added from the reference point on your branch.  When you issue a pull request, it is against a branch, not specific commits (i.e. pull from this branch not pull these commits).
> 
> Yes, but you will usually submit your pull request for the correct branch, not the "opposite". Let me explain:
> If you originally base your topic branch on Beta2x and then submit this topic branch as a pull request to be applied onto master, then github may show you more commits.
> But if you do any of these two, you will see the correct commits:
> a) Base your topic branch on Beta2x and submit pull request against Beta2x
> b) Base your topic branch on master and submit pull request against master
> 
> So my premise was that people would normally do a) or b) (and then ask to have the changes pushed to both master and Beta2x). If you do a) or b) you should always see the correct commits in the PR on github.
> 
> -Martin
> 




More information about the jbosstools-dev mailing list