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

Re: unmerged flag at git diff-index

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2009, 02:40 UTC
Message-ID
<7vbpu1js9o.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1976ea660901201813r7b03525ax39fd0e1ecfb1700e@mail.gmail.com>
Frank Li <lznuaa@gmail.com> writes:
Show 11 quoted lines
> There are conflict when I call git merge
> git ls-files -u
> 100644 54d05e1c40c686027b611b702e014284e9ab9a31 1       a.c
> 100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 2       a.c
> 100644 642ba972b2234f63048abcca544b3926f94e04ee 3       a.c
>
> but when use git diff-index HEAD
> :100644 100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 0000000000000000000000
> 0000000000000000 M      a.c
>
> a.c flag is M: Modification of the contents or mode of a file.
That is correct.

By asking "git diff-index HEAD", you are asking to compare the work tree contents through the index against HEAD commit. The work tree path by definition cannot be "unmerged" as there is no stages in the work tree.

"git diff-index --cached HEAD" would compare the index against the HEAD commit, and would say it is unmerged.

Previous: Frank LiNext: Johannes Schindelin
Message 2 of 3 in “unmerged flag at git diff-index”
  1. Frank LiJan 21, 2009
  2. Junio C HamanoJan 21, 2009
  3. Johannes SchindelinJan 21, 2009

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.