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

Re: [PATCH 3/4] gc docs: de-duplicate "OPTIONS" and "CONFIGURATION"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 18, 2019, 22:48 UTC
Message-ID
<87ef73er3l.fsf@evledraar.gmail.com>
In-Reply-To
<20190318214905.GG29661@sigill.intra.peff.net>
On Mon, Mar 18 2019, Jeff King wrote:
Show 45 quoted lines
> On Mon, Mar 18, 2019 at 05:15:01PM +0100, Ævar Arnfjörð Bjarmason wrote:
>
>> In an earlier commit I started including the "gc.*" documentation from
>> git-config(1) in the git-gc(1) documentation. That still left us in a
>> state where the "--auto" option and "gc.auto" were redundantly
>> discussing the same thing.
>>
>> Fix that by briefly discussing how the option itself works for
>> "--auto", and for the rest referring to the configuration
>> documentation.
>>
>> This revealed existing blind spots in the configuration documentation,
>> move over the documentation and reword as appropriate.
>
> Nice improvement. A few comments:
>
>> diff --git a/Documentation/config/gc.txt b/Documentation/config/gc.txt
>> index a834a801cd6..605e14bc80b 100644
>> --- a/Documentation/config/gc.txt
>> +++ b/Documentation/config/gc.txt
>> @@ -19,13 +19,27 @@ gc.auto::
>>  	objects in the repository, `git gc --auto` will pack them.
>>  	Some Porcelain commands use this command to perform a
>>  	light-weight garbage collection from time to time.  The
>> -	default value is 6700.  Setting this to 0 disables it.
>> +	default value is 6700.
>> ++
>> +Setting this to 0 disables not only automatic packing based on the
>> +number of loose objects, but any other heuristic `git gc --auto` will
>> +otherwise use to determine if there's work to do, such as
>> +`gc.autoPackLimit`.
>> ++
>> +The repacking of loose objects will be performed with `git repack -d
>> +-l`.
>
> I know this last sentence came from the existing documentation, but I
> wonder if we should be more vague here. We'd pack with "repack -dl" when
> we have just loose objects, and "repack -Adl" when we have too many
> packs. Or "repack -adl" if we're pruning now, and "--unpack-unreachable"
> otherwise.
>
> I think the point of git-gc is that you don't have to care about that
> stuff. It works magically, and if you are implementing your own custom
> gc scheme, then you are probably better off reading the output of
> GIT_TRACE or looking at the source, rather than this documentation.

Yeah I can just drop it while I'm at it. Was just losslessly trying to port the existing docs.

Show 7 quoted lines
>>  gc.autoPackLimit::
>> +
>>  	When there are more than this many packs that are not
>
> What's this newline for? I'm not completely opposed if that's the style
> we want, but it seems odd that just this one has a blank between the
> variable name and the text.
Mistake, will fix.
Show 9 quoted lines
>>  	marked with `*.keep` file in the repository, `git gc
>>  	--auto` consolidates them into one larger pack.  The
>> -	default	value is 50.  Setting this to 0 disables it.
>> +	default value is 50.  Setting this (or `gc.auto`) to 0
>> +	disables it. Packs will be consolidated using the `-A` option
>> +	of `git repack`.
>
> If we do revise the "-d -l" bit for the loose limit, we'd probably want
> to adjust this to match.
Or not mention it either?
Show 12 quoted lines
>> @@ -35,13 +49,18 @@ gc.bigPackThreshold::
>>  	If non-zero, all packs larger than this limit are kept when
>>  	`git gc` is run. This is very similar to `--keep-base-pack`
>>  	except that all packs that meet the threshold are kept, not
>> -	just the base pack. Defaults to zero. Common unit suffixes of
>> -	'k', 'm', or 'g' are supported.
>> +	just the base pack. Defaults to zero or a memory heuristic.
>> +	Common unit suffixes of 'k', 'm', or 'g' are supported.
>
> I'm not sure how to read this "or". What's the difference between "0" or
> the memory heuristic, and when is one used? Or is that what the "if the
> number of kept packs is more than..." below is trying to say?

That by default we don't use gc.bigPackThreshold, unless we find that you're under memory pressure. I.e. "it's off by default, unless your system has too little memory".

Show 19 quoted lines
> If so, I wonder if it would be simpler to say "defaults to a memory
> heuristic", but with a note for "but under these conditions it is not
> used".
>
> Or am I totally misunderstanding how it actually works (which seems
> likely to me)?
>
>> +If the amount of memory is estimated not enough for `git repack` to
>> +run smoothly and `gc.bigPackThreshold` is not set, the largest pack
>> +will also be excluded (which is the equivalent of running `git gc`
>> +with `--keep-base-pack`).
>
> I had trouble parsing this first line. Maybe:
>
>   If the amount of memory estimated for `git repack` to run smoothly is
>   not available and ...
>
> I guess a lot of this is just being copied from elsewhere, but it's
> probably worth cleaning it up while we're here.
Will try to make it suck less.
Show 12 quoted lines
>> --- a/Documentation/git-gc.txt
>> +++ b/Documentation/git-gc.txt
>> [...]
>> +See the `gc.auto' option in the "CONFIGURATION" below for how this
>> +heuristic works.
>
> s/CONFIGURATION/& section/?
>
>> +Once housekeeping is triggered by exceeding the limits of
>> +configurations options such as `gc.auto` and `gc.autoPackLimit`, all
>
> s/configurations/configuration/
*Nod*. Thanks.
Previous: Jeff KingNext: Jeff King
Message 11 of 64 in “gc docs: modernize and fix the documentation”
  1. 0/4 gc docs: modernize and fix the documentationÆvar Arnfjörð Bjarmason, Mar 18, 2019
  2. 1/4 gc docs: modernize the advice for manually running "gc"Ævar Arnfjörð Bjarmason, Mar 18, 2019
  3. Jeff KingMar 18, 2019
  4. Ævar Arnfjörð BjarmasonMar 18, 2019
  5. 2/4 gc docs: include the "gc.*" section from "config" in "gc"Ævar Arnfjörð Bjarmason, Mar 18, 2019
  6. Jeff KingMar 18, 2019
  7. Andreas HeidukMar 21, 2019
  8. Duy NguyenMar 19, 2019
  9. 3/4 gc docs: de-duplicate "OPTIONS" and "CONFIGURATION"Ævar Arnfjörð Bjarmason, Mar 18, 2019
  10. Jeff KingMar 18, 2019
  11. Ævar Arnfjörð BjarmasonMar 18, 2019
  12. Jeff KingMar 18, 2019
  13. 4/4 gc docs: downplay the usefulness of --aggressiveÆvar Arnfjörð Bjarmason, Mar 18, 2019
  14. Jonathan NiederMar 18, 2019
  15. Jeff KingMar 18, 2019
  16. Ævar Arnfjörð BjarmasonMar 18, 2019
  17. Jeff KingMar 18, 2019
  18. Johannes SixtMar 19, 2019
  19. Ævar Arnfjörð BjarmasonMar 19, 2019
  20. Jeff KingMar 18, 2019
  21. Ævar Arnfjörð BjarmasonMar 18, 2019
  22. Jeff KingMar 19, 2019
  23. Ævar Arnfjörð BjarmasonMay 6, 2019
  24. Jeff KingMay 7, 2019
  25. Ævar Arnfjörð BjarmasonMay 9, 2019
  26. Jeff KingJul 31, 2019
  27. Ævar Arnfjörð BjarmasonJul 31, 2019
  28. 00/10 gc docs: modernize and fix the documentationÆvar Arnfjörð Bjarmason, Mar 21, 2019
  29. 00/11 gc docs: modernize the advice for manually running "gc"Ævar Arnfjörð Bjarmason, Mar 22, 2019
  30. 01/11 gc docs: modernize the advice for manually running "gc"Ævar Arnfjörð Bjarmason, Mar 22, 2019
  31. 02/11 gc docs: stop noting "repack" flagsÆvar Arnfjörð Bjarmason, Mar 22, 2019
  32. 03/11 gc docs: clean grammar for "gc.bigPackThreshold"Ævar Arnfjörð Bjarmason, Mar 22, 2019
  33. 06/11 gc docs: fix formatting for "gc.writeCommitGraph"Ævar Arnfjörð Bjarmason, Mar 22, 2019
  34. 05/11 gc docs: re-flow the "gc.*" section in "config"Ævar Arnfjörð Bjarmason, Mar 22, 2019
  35. 07/11 gc docs: note how --aggressive impacts --window & --depthÆvar Arnfjörð Bjarmason, Mar 22, 2019
  36. 04/11 gc docs: include the "gc.*" section from "config" in "gc"Ævar Arnfjörð Bjarmason, Mar 22, 2019
  37. Todd ZullingerMar 30, 2019
  38. 00/11 gc docs: modernize and fix the documentationÆvar Arnfjörð Bjarmason, Apr 7, 2019
  39. 01/11 gc docs: modernize the advice for manually running "gc"Ævar Arnfjörð Bjarmason, Apr 7, 2019
  40. 02/11 gc docs: stop noting "repack" flagsÆvar Arnfjörð Bjarmason, Apr 7, 2019
  41. 03/11 gc docs: clean grammar for "gc.bigPackThreshold"Ævar Arnfjörð Bjarmason, Apr 7, 2019
  42. 04/11 gc docs: include the "gc.*" section from "config" in "gc"Ævar Arnfjörð Bjarmason, Apr 7, 2019
  43. 05/11 gc docs: re-flow the "gc.*" section in "config"Ævar Arnfjörð Bjarmason, Apr 7, 2019
  44. 06/11 gc docs: fix formatting for "gc.writeCommitGraph"Ævar Arnfjörð Bjarmason, Apr 7, 2019
  45. 07/11 gc docs: note how --aggressive impacts --window & --depthÆvar Arnfjörð Bjarmason, Apr 7, 2019
  46. 09/11 gc docs: note "gc --aggressive" in "fast-import"Ævar Arnfjörð Bjarmason, Apr 7, 2019
  47. 10/11 gc docs: clarify that "gc" doesn't throw away referenced objectsÆvar Arnfjörð Bjarmason, Apr 7, 2019
  48. 11/11 gc docs: remove incorrect reference to gc.auto=0Ævar Arnfjörð Bjarmason, Apr 7, 2019
  49. 08/11 gc docs: downplay the usefulness of --aggressiveÆvar Arnfjörð Bjarmason, Apr 7, 2019
  50. 10/11 gc docs: clarify that "gc" doesn't throw away referenced objectsÆvar Arnfjörð Bjarmason, Mar 22, 2019
  51. 08/11 gc docs: downplay the usefulness of --aggressiveÆvar Arnfjörð Bjarmason, Mar 22, 2019
  52. 11/11 gc docs: remove incorrect reference to gc.auto=0Ævar Arnfjörð Bjarmason, Mar 22, 2019
  53. 09/11 gc docs: note "gc --aggressive" in "fast-import"Ævar Arnfjörð Bjarmason, Mar 22, 2019
  54. 02/10 gc docs: stop noting "repack" flagsÆvar Arnfjörð Bjarmason, Mar 21, 2019
  55. 01/10 gc docs: modernize the advice for manually running "gc"Ævar Arnfjörð Bjarmason, Mar 21, 2019
  56. Junio C HamanoMar 22, 2019
  57. 03/10 gc docs: clean grammar for "gc.bigPackThreshold"Ævar Arnfjörð Bjarmason, Mar 21, 2019
  58. 04/10 gc docs: include the "gc.*" section from "config" in "gc"Ævar Arnfjörð Bjarmason, Mar 21, 2019
  59. 05/10 gc docs: re-flow the "gc.*" section in "config"Ævar Arnfjörð Bjarmason, Mar 21, 2019
  60. 06/10 gc docs: note how --aggressive impacts --window & --depthÆvar Arnfjörð Bjarmason, Mar 21, 2019
  61. 07/10 gc docs: downplay the usefulness of --aggressiveÆvar Arnfjörð Bjarmason, Mar 21, 2019
  62. 08/10 gc docs: note "gc --aggressive" in "fast-import"Ævar Arnfjörð Bjarmason, Mar 21, 2019
  63. 09/10 gc docs: clarify that "gc" doesn't throw away referenced objectsÆvar Arnfjörð Bjarmason, Mar 21, 2019
  64. 10/10 gc docs: remove incorrect reference to gc.auto=0Ævar Arnfjörð Bjarmason, Mar 21, 2019

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.