From: Junio C Hamano Date: Mon, 02 Apr 2012 18:25:33 GMT Subject: Re: [PATCH] add -p: skip conflicted paths Message-ID: <7v398mgfdu.fsf@alter.siamese.dyndns.org> In-Reply-To: Erik Faye-Lund writes: > On Thu, Mar 29, 2012 at 7:45 AM, Jeff King wrote: >> >> I like that we are down to a single ls-files invocation here. But can't >> we determine from the diff-files output whether an entry is unmerged. In >> my simple tests, I see that --numstat will show two lines for such an >> entry. Is that reliable? > > Nice. I've observed the same thing (although I've seen three entries, > not two). I don't know about the reliability, but I think it kind of > makes sense; one entry for both parents, and one for the unmerged > working-copy version. Should I be dissappointed, or should I be happy for seeing "division of labor" working? By default "diff-files" compares stage #2 with the working tree files, and at the same time shows an unmerged record. When there is no stage #2 entry, you will only see the unmerged record. Notice that 1_3 is shown only once in the --numstat part of the output if you run the script attached at the end. I think the easiest thing to get the right information is to add --raw to get the raw entries and read the status letters off of them. -- >8 -- #!/bin/sh mkdir -p /tmp/xprm && mkdir /tmp/xprm/stages && cd /tmp/xprm/stages || exit git init for i in 1 2 3 do echo "$i" | git hash-object -w --stdin done git update-index --index-info <