Thread (13 messages) flat view 13 messages, 5 authors, 2016-06-15

Re: [PATCH] Add --show-touched option to show "diff --git" line when contents are unchanged

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:43:27

Possibly related (same subject, not in this thread)


On Thu, 2 Aug 2007, Steven Grimm wrote:
The default is now to not show the diff --git header line if the file's
timestamp has changed but the contents and/or file mode haven't.
I don't mind this per se, but I'd *really* want some kind of warning that 
the index is not up-to-date.

Otherwise, git usage can be horrendously slow, and you're never even told 
why. The diffs just take lots of time (because it reads each file), but 
the output is empty.
	Personally I'm in favor of doing away with the option altogether
	and having the code always work the way it works by default with
	this patch, but if some people find the old behavior useful they
	can still get at it with the new option.
It's not that the old output is "useful" in itself, but it's important for 
people to know that the index is clean. So I'd suggest just setting a flag 
when the header isn't printed, and then printing out a single line at the 
end about "git index not up-to-date" or something.

Doing a "git diff" cannot actually update the index (since it very much 
has to work on a read-only setup too), which is why the index _stays_ 
stale unless something is done (eg "git status") to refresh it. And it's 
that stale index that continues to make for bad performance without any 
indication of why that is a problem.

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help