[bind10-dev] Order of merging

Stephen Morris stephen at isc.org
Thu Jan 24 15:12:21 UTC 2013


On 23/01/13 12:16, Michal 'vorner' Vaner wrote:
>> Having said that, perhaps a solution that satisfies both 
>> preferences is:
>> 
>> $ git checkout tracXXXX

>> $ git merge master

>> $ git checkout master

>> $ git merge --no-ff tracXXXX
>> 
>> The last command will force a new commit into master, even if
>> one were not necessary, so simulating the effect of directly
>> merging the branch into it.
> 
> But the last commit will not have two parents, only one. That means
> it is not a merge and the order of branches would still be 
> reversed.

Not so: that last commit does have two parents, one of them being the
previous commit to master.

As --no-ff has no effect if the result of the merge would be to
produce a new commit anyway (e.g. when merging a branch into master
directly without a previous merge of master into the branch), we can
simplify all this into a single instruction:

When merging anything into master, always use "git merge --no-ff"

Stephen


More information about the bind10-dev mailing list