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

Re: [PATCH 2/2] rev-list: add --disk-usage option for calculating disk usage

From
Jeff King <peff@peff.net>
Date
Jan 27, 2021, 23:34 UTC
Message-ID
<YBH4b04kZL8V6GFe@coredump.intra.peff.net>
In-Reply-To
<YBHv0ZHZD4VMHLYR@nand.local>
On Wed, Jan 27, 2021 at 05:57:21PM -0500, Taylor Blau wrote:
Show 10 quoted lines
> > You can find that out by generating a list of objects, getting their
> > sizes from cat-file, and then summing them, like:
> >
> >     git rev-list --objects main..branch
> >     cut -d' ' -f1 |
> 
> I suspect that this is from the original commit message that you wrote a
> half-decade ago. Not that it really means much, but you could shave one
> process off of this example by passing '--no-object-names' to 'git
> rev-list'.

That, plus my muscle memory to do the cut. We should probably model the better form here, and use it in the test, though (not worth a re-roll on its own, but it looks like there are a few other minor bits).

Show 19 quoted lines
> >   - not counting up all reachable objects (i.e., requiring --objects for
> >     this output, and omitting it just counts up commits). This could be
> >     handled in the bitmap case with some extra code (OR-ing with the
> >     type bitmaps).
> >
> >     But after 5 years of this patch, I've never wanted that once. The
> >     disk usage of just some of the objects isn't really that useful (and
> >     of course you can still get it by piping to cat-file).
> 
> Yeah. I think it's trivial to support it, but I'm in favor of a simpler
> interface.
> 
> That said, I worry about painting ourselves into a corner if the default
> implies --objects. If we wanted to change that, I'm pretty sure you'd
> have to write a rule that says "imply objects, unless --tags, --blobs or
> etc. are specified, and then only do that".
> 
> Maybe we'll never have to address that, but it's worth thinking about
> before committing to implying '--objects'.

Yeah, the one thing that gives me pause is that it would be hard to undo later. I didn't write the code to handle it in the bitmap case, but I don't think it would be _too_ bad. It is slightly annoying for the all-objects case, because the existing code isn't set up well to iterate either a specific type, or all types.

> I have no comments on the patch itself, which looks fine to me (and I
> have seen over and over again as it seems to regularly cause conflicts
> when merging new releases into GitHub's fork :-)).
You are exposing my ulterior motive. :)
-Peff
Previous: Taylor BlauNext: Eric Sunshine
Message 6 of 30 in “rev-list --disk-usage”
  1. 0/2 rev-list --disk-usageJeff King, Jan 27, 2021
  2. 1/2 t: add --no-tag option to test_commitJeff King, Jan 27, 2021
  3. Taylor BlauJan 27, 2021
  4. 2/2 rev-list: add --disk-usage option for calculating disk usageJeff King, Jan 27, 2021
  5. Taylor BlauJan 27, 2021
  6. Jeff KingJan 27, 2021
  7. Eric SunshineJan 27, 2021
  8. Jeff KingJan 27, 2021
  9. Kyle MeyerJan 27, 2021
  10. Jeff KingJan 27, 2021
  11. Taylor BlauJan 27, 2021
  12. rev-list --disk-usageJeff King, Feb 9, 2021
  13. 1/2 t: add --no-tag option to test_commitJeff King, Feb 9, 2021
  14. 2/2 rev-list: add --disk-usage option for calculating disk usageJeff King, Feb 9, 2021
  15. Jeff KingFeb 9, 2021
  16. Junio C HamanoFeb 9, 2021
  17. Jeff KingFeb 10, 2021
  18. Junio C HamanoFeb 10, 2021
  19. Taylor BlauFeb 10, 2021
  20. Jeff KingFeb 10, 2021
  21. Junio C HamanoFeb 10, 2021
  22. Jeff KingFeb 10, 2021
  23. Taylor BlauFeb 10, 2021
  24. Jeff KingFeb 11, 2021
  25. Ævar Arnfjörð BjarmasonFeb 11, 2021
  26. Junio C HamanoFeb 11, 2021
  27. 0/2 rev-list --disk-usage example docsJeff King, Feb 17, 2021
  28. 1/2 docs/rev-list: add an examples sectionJeff King, Feb 17, 2021
  29. 2/2 docs/rev-list: add some examples of --disk-usageJeff King, Feb 17, 2021
  30. Taylor BlauFeb 17, 2021

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.