git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* unmerged flag at git diff-index
@ 2009-01-21  2:13 Frank Li
  2009-01-21  2:40 ` Junio C Hamano
  2009-01-21  2:48 ` Johannes Schindelin
  0 siblings, 2 replies; 3+ messages in thread
From: Frank Li @ 2009-01-21  2:13 UTC (permalink / raw)
  To: git

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.

I think it should be U: file is unmerged(you must complete the merge
before it can be commited)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: unmerged flag at git diff-index
  2009-01-21  2:13 unmerged flag at git diff-index Frank Li
@ 2009-01-21  2:40 ` Junio C Hamano
  2009-01-21  2:48 ` Johannes Schindelin
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2009-01-21  2:40 UTC (permalink / raw)
  To: Frank Li; +Cc: git

Frank Li <lznuaa@gmail.com> writes:

> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: unmerged flag at git diff-index
  2009-01-21  2:13 unmerged flag at git diff-index Frank Li
  2009-01-21  2:40 ` Junio C Hamano
@ 2009-01-21  2:48 ` Johannes Schindelin
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2009-01-21  2:48 UTC (permalink / raw)
  To: Frank Li; +Cc: git

Hi,

On Wed, 21 Jan 2009, Frank Li wrote:

> 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.
> 
> I think it should be U: file is unmerged(you must complete the merge
> before it can be commited)

You're talking plumbing here.  And diff-index is about the differences 
between the working directory and the index _stage 0_.

I don't think that's a bug (what would you display? stage 1? stage 2? 
stage 3?), but even if it weren't, it is plumbing, and plumbing's UI is 
guaranteed to be stable.

So I guess that you really have to use "git ls-files --stage" at some 
stage :-)

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-21  2:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21  2:13 unmerged flag at git diff-index Frank Li
2009-01-21  2:40 ` Junio C Hamano
2009-01-21  2:48 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).