Re: [PATCH 2/4] t4011: illustrate "diff-index -p" on stat-dirty paths
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 1, 2012, 16:18 UTC
- Message-ID
- <7vzkc0nvlk.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <87399slmh4.fsf@thomas.inf.ethz.ch>
Thomas Rast <trast@inf.ethz.ch> writes:
Show 6 quoted lines
> If that analysis is correct, then > > we do not show any "diff --git" header for blobs whose true contents > are different but compares the same when whitespaces are ignored > > is not what is going on here; the blobs have exactly the same content.
True; an earlier draft actually had an 'echo " xyzzy" >nitfol' in there, but it meant that it needed another annoying 'sleep 3' (I could have used test-chmtime), so the test was updated but the above description stayed.
> The difference is that > > * without -w, the code "knows" from the lstat() data that the files are > different, prints a header, and then fails to find any differences;
Correct. Those quotes around "knows" are the most important ;-)
The code incorrectly thinks the stat dirtyness is all that it "knows"; even though it has a way to act on a better knowledge from the xdiff these days, it does not utilize it.
Show 9 quoted lines
> * with -w, the code correctly holds off on printing anything since it > will invariably have to inspect the contents beforehand. > > So perhaps you can say > > Illustrate this current behaviour. Also demonstrate that with the > "-w" option, we (correctly) hold off showing a "diff --git" header > until actual differences have been found. This also suppresses the > header for merely stat-dirty files, which is inconsistent.
That is much better; thanks.