1
0
mirror of https://github.com/git/git.git synced 2025-04-02 06:30:38 +00:00
Linus Torvalds 5d86501742 Set up for better tree diff optimizations
This is mainly just a cleanup patch, and sets up for later changes where
the tree-diff.c "interesting()" function can return more than just a
yes/no value.

In particular, it should be quite possible to say "no subsequent entries
in this tree can possibly be interesting any more", and thus allow the
callers to short-circuit the tree entirely.

In fact, changing the callers to do so is trivial, and is really all this
patch really does, because changing "interesting()" itself to say that
nothing further is going to be interesting is definitely more complicated,
considering that we may have arbitrary pathspecs.

But in cleaning up the callers, this actually fixes a potential small
performance issue in diff_tree(): if the second tree has a lot of
uninterestign crud in it, we would keep on doing the "is it interesting?"
check on the first tree for each uninteresting entry in the second one.

The answer is obviously not going to change, so that was just not helping.
The new code is clearer and simpler and avoids this issue entirely.

I also renamed "interesting()" to "tree_entry_interesting()", because I
got frustrated by the fact that

 - we actually had *another* function called "interesting()" in another
   file, and I couldn't tell from the profiles which one was the one that
   mattered more.

 - when rewriting it to return a ternary value, you can't just do

	if (interesting(...))
		...

   any more, but want to assign the return value to a local variable. The
   name of choice for that variable would normally be "interesting", so
   I just wanted to make the function name be more specific, and avoid
   that whole issue (even though I then didn't choose that name for either
   of the users, just to avoid confusion in the patch itself ;)

In other words, this doesn't really change anything, but I think it's a
good thing to do, and if somebody comes along and writes the logic for
"yeah, none of the pathspecs you have are interesting", we now support
that trivially.

It could easily be a meaningful optimization for things like "blame",
where there's just one pathspec, and stopping when you've seen it would
allow you to avoid about 50% of the tree traversals on average.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-19 02:01:39 -07:00
2007-02-03 21:49:54 -08:00
2007-03-18 15:48:06 -07:00
2007-03-14 01:40:19 -07:00
2007-03-03 19:47:46 -08:00
2007-02-27 22:15:42 -08:00
2007-03-10 23:10:26 -08:00
2007-03-17 00:34:19 -07:00
2007-03-14 01:37:50 -07:00
2007-02-25 11:08:47 -08:00
2007-02-18 15:58:08 -08:00
2007-02-24 01:42:06 -08:00
2007-03-17 00:34:19 -07:00
2007-03-07 10:47:10 -08:00
2007-03-02 00:37:12 -08:00
2006-11-21 20:55:39 -08:00
2007-02-18 15:57:36 -08:00
2007-02-14 11:19:28 -08:00
2006-05-15 12:32:13 -07:00
2007-03-14 16:21:19 -07:00
2007-03-14 16:21:19 -07:00
2007-03-14 16:21:19 -07:00
2007-03-07 11:15:26 -08:00
2006-12-29 11:01:31 -08:00
2007-02-28 14:18:57 -08:00
2007-02-03 21:49:54 -08:00
2007-02-08 15:23:52 -08:00
2007-01-18 14:22:24 -08:00
2007-01-30 21:03:11 -08:00
2007-03-18 14:43:29 -07:00
2007-03-17 00:34:19 -07:00
2006-09-27 23:59:09 -07:00
2007-03-02 00:31:51 -08:00
2007-03-07 10:47:10 -08:00
2007-03-07 10:47:10 -08:00
2007-03-07 10:47:10 -08:00
2006-06-26 14:58:41 -07:00
2007-03-17 00:34:19 -07:00
2007-02-27 01:34:21 -08:00
2007-02-27 01:34:21 -08:00
2007-03-07 10:47:10 -08:00
2007-01-17 12:03:50 -08:00
2007-02-08 17:48:22 -08:00
2007-03-10 22:07:26 -08:00
2007-02-03 11:57:18 -08:00
2007-03-18 14:43:29 -07:00
2007-03-11 23:02:52 -07:00
2007-03-12 23:40:18 -07:00
2007-03-10 22:07:26 -08:00
2007-03-12 11:30:38 -07:00
2006-10-20 16:50:36 -07:00
2007-02-27 01:34:21 -08:00
2007-03-18 15:36:59 -07:00
2007-03-18 15:36:59 -07:00
2007-03-19 01:48:56 -07:00
2007-03-03 19:47:46 -08:00

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/tutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.
Description
Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.
Readme 808 MiB
Languages
C 50.1%
Shell 38.4%
Perl 5.1%
Tcl 3.2%
Python 0.8%
Other 2.1%