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

Re: Not possible to see combined diff before committing a merge?

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 18, 2010, 09:55 UTC
Message-ID
<4BA1F880.2090100@drmicha.warpmail.net>
In-Reply-To
<76718491003172321j2a184643o47ec3a712a3b0c12@mail.gmail.com>
Jay Soffian venit, vidit, dixit 18.03.2010 07:21:
Show 16 quoted lines
> Am I missing something, or is there no way to see combined diff output
> after completing merge resolution on a conflicted merge but before
> committing the merge?
> 
> $ git diff --cc [-- path]
> 
> works fine _until_ you've added the file to the index, at which point
> you're hosed.
> 
> I think I want the combined diff between:
> 
> - What's in the index
> - The first parent (ORIG_HEAD)
> - The second parent (MERGE_HEAD)
> 
> And I don't think that's possible, sadly.

The obvious attempt "git diff --cc --cached" does not work, unfortunately, because the add cleared out the other stages from the index.

The funny thing is that after committing, git show will give you the combined diff (again).

I guess that proves, again, that there can't be a symbolic ref like INDEX because it just doesn't behave like one.

If there are no conflicted files left you could do a throw-away commit with a temp index, but that looks ugly. Do we have a way of specifying a 3-way diff for some git diff --cc incarnation, i.e. pretending two commits to be the parents and a third (or index) to be the merge result?

Junio would probably say that by adding the merge resolution you declare that you're not interested in that part of the merge any more ;)

Michael
Previous: Jay SoffianNext: Jay Soffian
Message 2 of 3 in “Not possible to see combined diff before committing a merge?”
  1. Jay SoffianMar 18, 2010
  2. Michael J GruberMar 18, 2010
  3. Jay SoffianMar 18, 2010

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.