From: Chris Mason <mason@suse.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: Finding file revisions
Date: Wed, 27 Apr 2005 14:23:37 -0400 [thread overview]
Message-ID: <200504271423.37433.mason@suse.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0504271027460.18901@ppc970.osdl.org>
[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]
On Wednesday 27 April 2005 13:34, Linus Torvalds wrote:
> On Wed, 27 Apr 2005, Chris Mason wrote:
> > Is there a faster way?
>
> Yes. Tell "diff-tree" what your desired files are, and it will cut down
> the amount of work by a _lot_ (because then diff-tree doesn't need to
> recurse into subdirectories that don't matter).
Thanks. I originally called diff-tree without the file list so that I could
do the regexp matching, but this is probably one of those features that will
never get used.
My test case here is a tree with 400 commits, giving diff-tree the file list
brings us down from 16s to 9s on a cold cache. Hot cache is about 1.5
seconds on both.
>
> > This will scale pretty badly as the tree grows, but
> > I usually only want to search back a few months in the history. So, it
> > might make sense to limit the results by date or commit/tag.
>
> With more history, "rev-list" should do basically the right thing: it will
> be constant-time for _recent_ commits, and it is linear time in how far
> back you want to go. Which seems quite reasonable.
>
> And diff-tree is obviously constant-time (and very fast at that,
> especially if you limit it to just a few files, since then it won't even
> bother with any other subdirectories).
Usually the question I will want to ask is "how did foo.c change since tag X",
which usually won't go back more then a few months. This should be
reasonable, and I'd rather not slow down common operations adding extra
indexing for the uncommon file-changes run.
So, new prog attached. New usage:
file-changes [-c commit_id] [-s commit_id] file ...
-c is the commit where you want to start searching
-s is the commit where you want to stop searching
-chris
[-- Attachment #2: file-changes --]
[-- Type: application/x-perl, Size: 2027 bytes --]
next prev parent reply other threads:[~2005-04-27 18:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-27 16:50 Finding file revisions Chris Mason
2005-04-27 17:34 ` Linus Torvalds
2005-04-27 18:23 ` Chris Mason [this message]
2005-04-27 22:19 ` Linus Torvalds
2005-04-27 22:31 ` Chris Mason
2005-04-28 8:41 ` Simon Fowler
2005-04-28 11:56 ` Chris Mason
2005-04-28 13:13 ` Simon Fowler
2005-04-28 11:45 ` Chris Mason
2005-04-28 16:34 ` Kay Sievers
2005-04-28 17:10 ` Tony Luck
2005-04-28 17:22 ` Thomas Glanzmann
2005-04-28 19:11 ` Kay Sievers
2005-04-28 20:58 ` Chris Mason
2005-04-28 21:32 ` Linus Torvalds
2005-04-28 21:33 ` Kay Sievers
2005-04-28 21:50 ` Linus Torvalds
2005-04-28 22:27 ` Chris Mason
2005-04-28 13:09 ` David Woodhouse
2005-04-28 13:01 ` David Woodhouse
2005-04-27 18:41 ` Thomas Gleixner
2005-04-28 15:24 ` Linus Torvalds
2005-04-28 16:47 ` Thomas Gleixner
2005-04-28 16:08 ` Daniel Barkalow
2005-04-28 17:05 ` Chris Mason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200504271423.37433.mason@suse.com \
--to=mason@suse.com \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).