Re: [PATCH v4 4/6] pack-objects: generate cruft packs at most one object over threshold
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 12, 2025, 20:43 UTC
- Message-ID
- <xmqq5xkex9md.fsf@gitster.g>
- In-Reply-To
- <CABPp-BH0rbieCV4Z11pHOX-mwrtEO-FPNdywV0P5HxXnusdRKQ@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 8 quoted lines
> Would it make sense to break the assumption that --max-cruft-size == > --max-pack-size and perhaps rename the former? I think the problem is > that the two imply different things (one is a minimum, the other a > maximum), and thus really should be different values. E.g. > --combine-cruft-below-size that is set to e.g. half of > --max-pack-size, and then you can continue combining cruft packs > together until they do go above the cruft threshold, while avoiding > actually exceeding the pack size threshold?
With below-size and max-size set to say 180 and 200 respectively, an attempt to combine the crufts may end up filling a cruft pack to 170 but the smallest of the remaining cruft may weigh 40, which means including it would cause the max-size to be exceeded. In such a scenario, there may not be a solution to satisfy given constraints, i.e. go above the below-size without stay below the max-size.
So I am not sure if the approach would really solve much.
Other than that a separate names, especially losing "max" from the threshold that really does not mean "max", would solve the confusion that comes from naming, that is.