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

Re: RFC: git cat-file --follow-symlinks?

From
David Turner <dturner@twopensource.com>
Date
Apr 30, 2015, 19:00 UTC
Message-ID
<1430420422.22711.37.camel@ubuntu>
In-Reply-To
<20150430184944.GA3661@peff.net>
On Thu, 2015-04-30 at 14:49 -0400, Jeff King wrote:
Show 22 quoted lines
> On Thu, Apr 30, 2015 at 11:44:50AM -0700, David Turner wrote:
> 
> > > git ls-tree HEAD -- BUILD ?
> > 
> > This does not actually seem to work (even with -r); it only recurses
> > into directories that are named BUILD, rather than being equivalent to
> > git ls-tree -r HEAD |grep /BUILD$.
> 
> Ah, I thought that was what you wanted (to find specific files, not a
> pattern). I think `ls-tree` doesn't understand our normal pathspecs, for
> historical reasons.
> 
> > Also, BUILD files are scattered throughout the tree, so the entire tree
> > would still need to be traversed.  At present, our monorepo is not quite
> > large enough for this to matter (a full ls-tree only takes me 0.6s), but
> > it is growing.
> 
> But aren't you asking git to do that internally? I.e., it can limit the
> traversal for a prefix-match, but it cannot do so for an arbitrary
> filename. It has to open every tree. So the extra expense is really just
> the I/O over the pipe. That's not optimal, but it is a constant factor
> slowdown from what git would do internally.

No, I'm not trying to find all BUILD files -- only ones that are in the transitive dependency tree of the target I'm trying to sparsely check out. So if the target foo/bar/baz depends on morx/fleem, and morx/fleem depends on plugh/xyzzy, then I have to examine those three places only. I don't have to examine anything in the gibbberish/ subtree, for instance.

Previous: Jeff KingNext: Jeff King
Message 26 of 43 in “RFC: git cat-file --follow-symlinks?”
  1. David TurnerApr 29, 2015
  2. Jonathan NiederApr 29, 2015
  3. David TurnerApr 29, 2015
  4. Junio C HamanoApr 29, 2015
  5. David TurnerApr 29, 2015
  6. Jeff KingApr 29, 2015
  7. Jonathan NiederApr 29, 2015
  8. Jeff KingApr 29, 2015
  9. David TurnerApr 29, 2015
  10. Jeff KingApr 29, 2015
  11. Jeff KingApr 30, 2015
  12. David TurnerApr 30, 2015
  13. Jeff KingApr 30, 2015
  14. Junio C HamanoApr 30, 2015
  15. Jeff KingApr 30, 2015
  16. David TurnerApr 30, 2015
  17. Jeff KingApr 30, 2015
  18. Junio C HamanoApr 30, 2015
  19. Michael HaggertyApr 30, 2015
  20. David TurnerApr 30, 2015
  21. Junio C HamanoApr 30, 2015
  22. David TurnerApr 30, 2015
  23. Jeff KingApr 30, 2015
  24. David TurnerApr 30, 2015
  25. Jeff KingApr 30, 2015
  26. David TurnerApr 30, 2015
  27. Jeff KingApr 30, 2015
  28. David TurnerApr 30, 2015
  29. Andreas SchwabApr 30, 2015
  30. Jeff KingApr 30, 2015
  31. Junio C HamanoApr 30, 2015
  32. David TurnerApr 30, 2015
  33. Junio C HamanoApr 30, 2015
  34. Jeff KingApr 30, 2015
  35. Junio C HamanoApr 30, 2015
  36. David TurnerMay 1, 2015
  37. Jeff KingMay 1, 2015
  38. David TurnerMay 1, 2015
  39. Jeff KingMay 1, 2015
  40. David TurnerMay 1, 2015
  41. Junio C HamanoApr 29, 2015
  42. David TurnerApr 29, 2015
  43. Michael HaggertyApr 30, 2015

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.