git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git and appending merge commits

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 26, 2008, 04:51 UTC
Message-ID
<20080526045136.GC30245@spearce.org>
In-Reply-To
<483A300E.6090104@zombino.com>

Adam Majer <adamm@zombino.com> wrote: ...

Show 12 quoted lines
>   5. append master merge changeset
> 
> #5 results in "messsed up" diffs
> 
> For an example of such a mess up please see,
> 
> http://git.debian.org/?p=collab-maint/mrtg.git;a=commitdiff;h=a8bc78ffd6d51ab09a791fa97e25f57b60eecd06
> 
> It appears that the tool generates a patch to a patch and displays that
> instead of the appended merge diff which is what I would have expected..
> 
> Is current output by design?

Yes, it is by design. This is a feature of Git that very few (if any) other systems have.

What you are seeing here is a combined diff. It is a diff of the final output of the merge against its two parents (the two branches that were merged together). Places where both a "++" or "--" prefix a line indicate a place where the merge commit adds something that is not in either parent. This is stuff that the merge author edited himself/herself during the merge.

If you had not amended the merge, you would have seen a less interesting diff here, as the combined diff output tries to avoid showing trivial changes.

-- 
Shawn.
Previous: Adam MajerNext: Junio C Hamano
Message 2 of 4 in “git and appending merge commits”
  1. Adam MajerMay 26, 2008
  2. Shawn O. PearceMay 26, 2008
  3. Junio C HamanoMay 26, 2008
  4. Adam MajerMay 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.