mbox series

[00/10] gc: enable cruft packs by default

Message ID cover.1681764848.git.me@ttaylorr.com (mailing list archive)
Headers show
Series gc: enable cruft packs by default | expand

Message

Taylor Blau April 17, 2023, 8:54 p.m. UTC
This series graduates `gc.cruftPacks` out of `feature.experimental` and
enables it by default, meaning that a bare `git gc` will generate a
cruft pack.

The main benefits are described in detail in the second to last patch,
but a brief summary is that:

  - cruft packs avoid an issue where repositories with many unreachable
    objects that were written too recently to be pruned causes an
    explosion of loose object files

  - cruft packs allow pairs of unreachable objects with similar content
    to delta with each other since they can be represented in a single
    pack instead of as individual loose objects.

Cruft packs have been in the tree for the vast majority of the past
calendar year, and have been in use at GitHub for even longer without
issue.

The series is structured as follows:

  - The first two patches are cleanup.
  - The third patches fixes an oversight where the code for `git gc`'s
    `--keep-largest-pack` option would incorrectly consider cruft packs.
  - The next five patches are test preparation.
  - Then the substantive patch, to actually graduate `gc.cruftPacks` and
    enable it by default.
  - The final patch is some cleanup that can only take place towards the
    end of the series.

Cruft packs have been a success for us at GitHub, and I am really
excited to get it in the hands of more users by default.

Thanks in advance for your review.

-Taylor

Taylor Blau (10):
  pack-write.c: plug a leak in stage_tmp_packfiles()
  builtin/repack.c: fix incorrect reference to '-C'
  builtin/gc.c: ignore cruft packs with `--keep-largest-pack`
  t/t5304-prune.sh: prepare for `gc --cruft` by default
  t/t9300-fast-import.sh: prepare for `gc --cruft` by default
  t/t6500-gc.sh: refactor cruft pack tests
  t/t6500-gc.sh: add additional test cases
  t/t6501-freshen-objects.sh: prepare for `gc --cruft` by default
  builtin/gc.c: make `gc.cruftPacks` enabled by default
  repository.h: drop unused `gc_cruft_packs`

 Documentation/config/feature.txt |   3 -
 Documentation/config/gc.txt      |  12 +--
 Documentation/git-gc.txt         |  12 +--
 Documentation/gitformat-pack.txt |   4 +-
 builtin/gc.c                     |   8 +-
 builtin/repack.c                 |   2 +-
 pack-write.c                     |  14 ++--
 repo-settings.c                  |   4 +-
 repository.h                     |   1 -
 t/t5304-prune.sh                 |  28 +++----
 t/t6500-gc.sh                    | 136 ++++++++++++++++---------------
 t/t6501-freshen-objects.sh       |  10 +--
 t/t9300-fast-import.sh           |  13 +--
 13 files changed, 121 insertions(+), 126 deletions(-)

Comments

Jeff King April 18, 2023, 11:04 a.m. UTC | #1
On Mon, Apr 17, 2023 at 04:54:11PM -0400, Taylor Blau wrote:

> The series is structured as follows:
> 
>   - The first two patches are cleanup.
>   - The third patches fixes an oversight where the code for `git gc`'s
>     `--keep-largest-pack` option would incorrectly consider cruft packs.
>   - The next five patches are test preparation.
>   - Then the substantive patch, to actually graduate `gc.cruftPacks` and
>     enable it by default.
>   - The final patch is some cleanup that can only take place towards the
>     end of the series.

Thanks, this was a pleasant read. Besides Junio's small fixup in the
docs, everything I pointed out was minor enough that it wouldn't be a
big deal to go in as-is.

> Cruft packs have been a success for us at GitHub, and I am really
> excited to get it in the hands of more users by default.

Me too. :)

-Peff
Taylor Blau April 18, 2023, 7:53 p.m. UTC | #2
On Tue, Apr 18, 2023 at 07:04:24AM -0400, Jeff King wrote:
> On Mon, Apr 17, 2023 at 04:54:11PM -0400, Taylor Blau wrote:
>
> > The series is structured as follows:
> >
> >   - The first two patches are cleanup.
> >   - The third patches fixes an oversight where the code for `git gc`'s
> >     `--keep-largest-pack` option would incorrectly consider cruft packs.
> >   - The next five patches are test preparation.
> >   - Then the substantive patch, to actually graduate `gc.cruftPacks` and
> >     enable it by default.
> >   - The final patch is some cleanup that can only take place towards the
> >     end of the series.
>
> Thanks, this was a pleasant read. Besides Junio's small fixup in the
> docs, everything I pointed out was minor enough that it wouldn't be a
> big deal to go in as-is.

Thanks, both, for the review. Most (all?) of the clean-up was all pretty
minor, but I would have rerolled here regardless. New version incoming
just as soon as CI says it's all good.

Thanks,
Taylor