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

Re: git list files

From
Jeff King <peff@peff.net>
Date
Jan 13, 2013, 20:10 UTC
Message-ID
<20130113201027.GA4436@sigill.intra.peff.net>
In-Reply-To
<20130113175602.GD5973@elie.Belkin>
On Sun, Jan 13, 2013 at 09:56:02AM -0800, Jonathan Nieder wrote:
Show 15 quoted lines
> > lets, say the equivalent of the $ls -d b* within git.git root directory
> > would look like:
> >
> > ----------------
> > 98746061 jrnieder 2010-08-12 17:11 Standardize-do-.-while-0-style   base85.c
> > c43cb386 pclouds  2012-10-26 22:53 Move-estimate_bisect_steps-to-li bisect.c
> > efc7df45 pclouds  2012-10-26 22:53 Move-print_commit_list-to-libgit bisect.h
> > 837d395a barkalow 2010-01-18 13:06 Replace-parse_blob-with-an-expla blob.c
> > 837d395a barkalow 2010-01-18 13:06 Replace-parse_blob-with-an-expla blob.h
> > ebcfa444 gitster  2012-07-23 20:56 Merge-branch-jn-block-sha1       block-sha1
> 
> You might like Peff's or Jakub's tree blame script.  The newest version
> I can find is
> 
>  http://thread.gmane.org/gmane.comp.version-control.git/168323

As far as I recall, that script works. However, I have a pure-C blame-tree implementation that is much faster, which may also be of interest. I need to clean up and put a few finishing touches on it to send it to the list, but it has been in production at GitHub for a few months. You can find it here:

  git://github.com/peff/git jk/blame-tree

It's built on the regular diff traversal, just like the perl script you linked, but doing it all in-process makes things fast. I also added a "--max-depth" parameter for diff, so you can do:

  git blame-tree --max-depth=1 -- Documentation

to recurse into the Documentation subdir, but not go into its subdirectories. One of the things I need to clean up is that my counting of --max-depth is different from that used by "git grep", and we would probably want reconcile that.

-Peff
Previous: Стойчо СлепцовNext: Jonathan Nieder
Message 6 of 9 in “git list files”
  1. Стойчо СлепцовJan 13, 2013
  2. Matthieu MoyJan 13, 2013
  3. Стойчо СлепцовJan 13, 2013
  4. Jonathan NiederJan 13, 2013
  5. Стойчо СлепцовJan 13, 2013
  6. Jeff KingJan 13, 2013
  7. Jonathan NiederJan 14, 2013
  8. Jeff KingJan 14, 2013
  9. Стойчо СлепцовJan 14, 2013

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.