git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Trac+Git: rev-list with pathspec performance?

From
SBStephen Bash <bash@genarts.com>
Date
Oct 7, 2010, 17:49 UTC
Message-ID
<2595121.446745.1286473792827.JavaMail.root@mail.hq.genarts.com>
In-Reply-To
<17750617.441668.1286378804923.JavaMail.root@mail.hq.genarts.com>
Show 12 quoted lines
> > Note that there is proof of concept
> > "tree blame" (in Perl) which generates such 'last change to file'
> > information, I think faster than running 'git rev-list -1 <file>'
> > for
> > each file. Even better would be to encode used algorithm in C.
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/150063/focus=150183
> 
> My early experiments with your script are good for speed, but for some
> reason I'm always getting the first commit for a file rather than the
> most recent. I'll do some experimenting to see if I can uncover the
> issue.
Following up, I had to add -r to the diff-tree command line when requesting a subdirectory to work around the problem (script always returned the first commit).
I'm curious if it's faster to get the SHA of the sub-tree and compare that before actually running diff-tree?  And for that matter, just run diff-tree on the sub-tree that we care about rather than a recursive sub-tree on the root?  These may be early optimizations, but they're ideas that occurred to me while debugging the code...
> > P.S. Alternate solution would be to simply get rid of SVN-inspired
> > view.  Git tracks history of a *project* as a whole, not set of
> > histories for individual files (like CVS).
After a lot of experimentation, this is basically what we did.  I modified the Trac templates to not list the last change SHA or log message in the directory view.  After all my testing, I just don't think there's a fast way to get this information from Git.  This blame-dir script is the fastest alternative I've tried (about 5x faster than rev-list'ing each file), but it's still ~30 seconds on my machine (which is faster than our web server), and IMHO that's too long to ask a user to wait for a page to load.

Thanks, Stephen

Previous: Stephen BashNext: Jakub Narebski
Message 5 of 6 in “Trac+Git: rev-list with pathspec performance?”
  1. Stephen BashOct 4, 2010
  2. Jonathan NiederOct 4, 2010
  3. Jakub NarebskiOct 5, 2010
  4. Stephen BashOct 6, 2010
  5. Stephen BashOct 7, 2010
  6. Jakub NarebskiOct 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.