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

Re: how do you review auto-resolved files

From
Jeff King <peff@peff.net>
Date
Feb 22, 2012, 07:28 UTC
Message-ID
<20120222072848.GC17015@sigill.intra.peff.net>
In-Reply-To
<4F442721.4080107@gmail.com>
On Tue, Feb 21, 2012 at 05:22:09PM -0600, Neal Kreitzinger wrote:
Show 6 quoted lines
> My definition for "auto-resolve": "During a merge, the working tree
> files are updated to reflect the result of the merge... When both
> sides made changes to different areas of the same file, git picks
> both sides automatically, and leaves its up to you to make sure you
> review those merge results for correctness after git has made the
> merge commit."
Once the merge commit is made, you can review these with:
  $ git show --raw

which will give you the list of paths that were touched on both sides, and then you can examine them manually.

You can also use:
  $ git show -c

to get the combined diff, showing hunks that were changed on both sides (but only in files that would have been listed above). Annoyingly, I don't think there is a way to get the same multi-way diff information before the commit is created (i.e., when you still have some conflicts in the index and working tree left to resolve).

But even both of those are not sufficient to find merge errors. Even though there is no textual conflict, there may be semantic conflicts that cross file boundaries (e.g., function foo() changes in foo.c, but a caller in bar.c is introduced on a side branch). There is no replacement for actually looking at the full result (though for the lazy, compiling and running the test suite can often catch the low-hanging fruit).

-Peff
Previous: Neal KreitzingerNext: Zbigniew Jędrzejewski-Szmek
Message 4 of 6 in “how do you review auto-resolved files”
  1. Neal KreitzingerFeb 21, 2012
  2. Junio C HamanoFeb 21, 2012
  3. Neal KreitzingerFeb 21, 2012
  4. Jeff KingFeb 22, 2012
  5. Zbigniew Jędrzejewski-SzmekFeb 22, 2012
  6. Junio C HamanoFeb 21, 2012

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.