{"thread":{"id":"17278","subject":"unmerged flag at git diff-index","startedAt":"2009-01-21T02:13:30Z","lastAt":"2009-01-21T02:48:01Z","messageCount":3,"participants":["Frank Li","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"101335","messageId":"1976ea660901201813r7b03525ax39fd0e1ecfb1700e@mail.gmail.com","threadId":"17278","inReplyTo":null,"subject":"unmerged flag at git diff-index","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-01-21T02:13:30Z","receivedAt":"2009-01-21T02:13:30Z","isPatch":false,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"There are conflict when I call git merge\ngit ls-files -u\n100644 54d05e1c40c686027b611b702e014284e9ab9a31 1       a.c\n100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 2       a.c\n100644 642ba972b2234f63048abcca544b3926f94e04ee 3       a.c\n\nbut when use git diff-index HEAD\n:100644 100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 0000000000000000000000\n0000000000000000 M      a.c\n\na.c flag is M: Modification of the contents or mode of a file.\n\nI think it should be U: file is unmerged(you must complete the merge\nbefore it can be commited)\n"},{"id":"101336","messageId":"7vbpu1js9o.fsf@gitster.siamese.dyndns.org","threadId":"17278","inReplyTo":"1976ea660901201813r7b03525ax39fd0e1ecfb1700e@mail.gmail.com","subject":"Re: unmerged flag at git diff-index","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-21T02:40:35Z","receivedAt":"2009-01-21T02:40:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Li <lznuaa@gmail.com> writes:\n\n> There are conflict when I call git merge\n> git ls-files -u\n> 100644 54d05e1c40c686027b611b702e014284e9ab9a31 1       a.c\n> 100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 2       a.c\n> 100644 642ba972b2234f63048abcca544b3926f94e04ee 3       a.c\n>\n> but when use git diff-index HEAD\n> :100644 100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 0000000000000000000000\n> 0000000000000000 M      a.c\n>\n> a.c flag is M: Modification of the contents or mode of a file.\n\nThat is correct.\n\nBy asking \"git diff-index HEAD\", you are asking to compare the work tree\ncontents through the index against HEAD commit.  The work tree path by\ndefinition cannot be \"unmerged\" as there is no stages in the work tree.\n\n\"git diff-index --cached HEAD\" would compare the index against the HEAD\ncommit, and would say it is unmerged.\n"},{"id":"101337","messageId":"alpine.DEB.1.00.0901210343510.19014@racer","threadId":"17278","inReplyTo":"1976ea660901201813r7b03525ax39fd0e1ecfb1700e@mail.gmail.com","subject":"Re: unmerged flag at git diff-index","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-21T02:48:01Z","receivedAt":"2009-01-21T02:48:01Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 21 Jan 2009, Frank Li wrote:\n\n> There are conflict when I call git merge\n> git ls-files -u\n> 100644 54d05e1c40c686027b611b702e014284e9ab9a31 1       a.c\n> 100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 2       a.c\n> 100644 642ba972b2234f63048abcca544b3926f94e04ee 3       a.c\n> \n> but when use git diff-index HEAD\n> :100644 100644 a8a1b77c0d92f33491a0a69a8645f02ececb1eb6 0000000000000000000000\n> 0000000000000000 M      a.c\n> \n> a.c flag is M: Modification of the contents or mode of a file.\n> \n> I think it should be U: file is unmerged(you must complete the merge\n> before it can be commited)\n\nYou're talking plumbing here.  And diff-index is about the differences \nbetween the working directory and the index _stage 0_.\n\nI don't think that's a bug (what would you display? stage 1? stage 2? \nstage 3?), but even if it weren't, it is plumbing, and plumbing's UI is \nguaranteed to be stable.\n\nSo I guess that you really have to use \"git ls-files --stage\" at some \nstage :-)\n\nCiao,\nDscho\n"}]}