Re: [PATCH] Documentation/git-diff: remove -r from --name-status example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sun, 29 Jul 2007, Jeff King wrote:

> On Sun, Jul 29, 2007 at 12:14:49PM +0100, Johannes Schindelin wrote:
> 
> > How about
> > 
> > 	if (!rev.diffopt.quiet)
> > 		rev.diffopt.recursive = 1;
> > 
> > instead?
> 
> Can you explain?

The idea is this: when "--quiet" was given, we do not output anything, and 
therefore do not have to recurse into the directories, because we already 
know that there are differences when a _tree_ is different.  I do not 
remember all details of the "--quiet" implementation, but I think that it

- exits early (as you said)

- does not turn on "recursive" to avoid unnecessary work.

Imagine something like this: tree "a" and "b" contain 100,000 elements 
each, which are identical except for the last entry.  "--quiet" does not 
need to check the 99,999 elements before that one, since the tree hashes 
are already different.

Of course, this reasoning breaks down fatally when you specify something 
like "--ignore-whitespace", but those cases should turn on recursive 
explicitely, so that the performance penalty of "recursive = 1" does not 
percolate back to the (much more common) trivial cases.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux