threads / discuss / 21760

Merge priority

Subject: Merge priority

## tl;dr

4 messages between Nov 26, 2009 and Nov 26, 2009.

replies: 3people: 4as markdown or json

Howard Miller· Nov 26, 2009, 12:44 UTC · lore
I'm not sure this is even a sensible question....

I have a whole bunch of customer branches with all manner of local tweaks and modifications. I also have a stable branch with all my security patches and bug fixes. They do share common ancestry.

I now want to update all my customer branches with the latest fixes and patches. Naively, I would just check out each branch and merge the stable branch - job done. However, is it sensible to ask if there is a way to say that the stable branch is more important if there are conflicts. Or should I be using rebase instead (which I still don't really understand). I'm trying to reduce my workload as there are loads of branches to do.

Cheers :-)
Alex Riesen· Nov 26, 2009, 15:42 UTC · re: Howard Miller · lore

Re: Merge priority

On Thu, Nov 26, 2009 at 13:44, Howard Miller <howard@e-learndesign.co.uk> wrote:
Show 5 quoted lines
> I now want to update all my customer branches with the latest fixes
> and patches. Naively, I would just check out each branch and merge the
> stable branch - job done. However, is it sensible to ask if there is a
> way to say that the stable branch is more important if there are
> conflicts.

No, all branches are equal. Besides, are you sure it is safe to just take your stable version of the code in a conflict? Maybe the stable code uses something a customer branch renamed or removed?

You can take a look at rerere, though. It should help resolving repeating conflicts by recording a resolution of your choice.

Junio C Hamano· Nov 26, 2009, 19:47 UTC · re: Alex Riesen · lore

Re: Merge priority

Alex Riesen <raa.lkml@gmail.com> writes:
> You can take a look at rerere, though. It should help resolving repeating
> conflicts  by recording a resolution of your choice.
Use of rerere often helps but there is a caveat.

Even if two branches (e.g. 'master' and 'maint') currently has the same tree, the desired outcome of merging the same commit into them could be different depending on the purpose of these branches. You may want to resolve a conflicted merge into 'maint' more conservatively than the way you would resolve the exact same merge into 'master'.

Imagine a case where 'master' branch added a better helper functions in other files, but they are not in 'maint' yet, and the conflicted part could be resolved better if you made it call these newer helper functions available only in 'master'.

Unfortunately the conflicts would look exactly the same to rerere, so if you record the result of the merge to 'master', replaying that resolution while merging the same commit to 'maint' would produce undesirable result.

As to "does the aggregated result make sense if you blindly add changes in 'stable' for only conflicted parts to an automerge result?", which was your other point, you may refer your readers to Avery's recent updates to resurrect -Xours option to "git merge".

Martin Langhoff· Nov 26, 2009, 16:22 UTC · re: Howard Miller · lore

Re: Merge priority

On Thu, Nov 26, 2009 at 1:44 PM, Howard Miller <howard@e-learndesign.co.uk> wrote:

> I now want to update all my customer branches with the latest fixes
> and patches. Naively, I would just check out each branch and merge the
> stable branch - job done.
Yep, that's what I'd do.
> However, is it sensible to ask if there is a
> way to say that the stable branch is more important if there are
> conflicts.

Not really. The git approach is to assume that... when there is a conflict, you must look into it. A human needs to take a decision...

> Or should I be using rebase instead (which I still don't
> really understand). I'm trying to reduce my workload as there are
> loads of branches to do.
No, rebase will increase the load and complexity.
cheers,
m
-- 
 martin.langhoff@gmail.com
 martin@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

← back to recent threads