Re: git and appending merge commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Majer <adamm@xxxxxxxxxxx> writes:

> Is current output by design?

Yes, it is _very much_ by design and it not "messed up" at all.  Look at
the output of URL you quoted and notice that you are asking for condensed
combined diff ("diff --cc").

For a merge commit with N parents, you can define "a diff for the
resulting merge commit" in various ways:

 * You could have a set of diffs between each parent to the merge result.
   You can get this with "git diff-tree -p -m $commit".

 * You could say the first parent is special, and define it as the diff
   between its first parent and the merge result.  You can get this by
   asking "git diff $commit^1 $commit".

 * You can say what non-trivial changes the merge itself did.  This is the
   combined merge and what "git show $commit" (and "git log -p") gives.

Depending on what you want, you can ask these various forms of diffs.

When you are reviewing the changes series of commits introduced to the
history (iow, "git log -p"), a single diff between parent and the merge
result is not so interesting, primarily because each individual change
from commits on each side branch is (or should be) much easier to read and
understand, but if a merge needed to do something non-trivial to resolve
conficts, you would want to know about it, and that is the reason why --cc
format is the default.

In a combined diff, unlike the single column to show "+/-/ " at the
beginning for one-parent diff, each parent gets one column.  And in a
condensed combined diff, a hunk whose result is inherited solely from one
parent (iow, a trivial conflict resolution) is removed from the output, so
that only a non-trivial conflict resolution that leaves result that is
different from all parents are shown.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux