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

[PATCH v3 04/11] gc docs: include the "gc.*" section from "config" in "gc"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 22, 2019, 09:32 UTC
Message-ID
<20190322093242.5508-5-avarab@gmail.com>
In-Reply-To
<20190321205054.17109-1-avarab@gmail.com>

Rather than duplicating the documentation for the various "gc" options let's include the "gc" docs from git-config. They were mostly better already, and now we don't have the same docs in two places with subtly different wording.

In the cases where the git-gc(1) docs were saying something the "gc" docs in git-config(1) didn't cover move the relevant section over to the git-config(1) docs.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Documentation/config/gc.txt | 29 ++++++++++++-
 Documentation/git-gc.txt    | 86 +++----------------------------------
 2 files changed, 35 insertions(+), 80 deletions(-)
diff --git a/Documentation/config/gc.txt b/Documentation/config/gc.txt
index c6fbb8a96f..a255ae67b0 100644
--- a/Documentation/config/gc.txt
+++ b/Documentation/config/gc.txt
@@ -2,24 +2,39 @@ gc.aggressiveDepth::
 	The depth parameter used in the delta compression
 	algorithm used by 'git gc --aggressive'.  This defaults
 	to 50.
++
+See the documentation for the `--depth` option in
+linkgit:git-repack[1] for more details.
 
 gc.aggressiveWindow::
 	The window size parameter used in the delta compression
 	algorithm used by 'git gc --aggressive'.  This defaults
 	to 250.
++
+See the documentation for the `--window` option in
+linkgit:git-repack[1] for more details.
 
 gc.auto::
 	When there are approximately more than this many loose
 	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`.
 
 gc.autoPackLimit::
 	When there are more than this many packs that are not
 	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.
+	Setting `gc.auto` to 0 will also disable this.
++
+See the `gc.bigPackThreshold` configuration variable below. When in
+use, it'll affect how the auto pack limit works.
 
 gc.autoDetach::
 	Make `git gc --auto` return immediately and run in background
@@ -36,6 +51,11 @@ Note that if the number of kept packs is more than gc.autoPackLimit,
 this configuration variable is ignored, all packs except the base pack
 will be repacked. After this the number of packs should go below
 gc.autoPackLimit and gc.bigPackThreshold should be respected again.
++
+If the amount of memory estimated for `git repack` to run smoothly is
+not available and `gc.bigPackThreshold` is not set, the largest
+pack will also be excluded (this is the equivalent of running `git gc`
+with `--keep-base-pack`).
 
 gc.writeCommitGraph::
 	If true, then gc will rewrite the commit-graph file when
@@ -94,6 +114,13 @@ gc.<pattern>.reflogExpireUnreachable::
 	With "<pattern>" (e.g. "refs/stash")
 	in the middle, the setting applies only to the refs that
 	match the <pattern>.
++
+These types of entries are generally created as
+a result of using `git commit --amend` or `git rebase` and are the
+commits prior to the amend or rebase occurring.  Since these changes
+are not part of the current project most users will want to expire
+them sooner, which is why the default is more aggressive than
+`gc.reflogExpire`.
 
 gc.rerereResolved::
 	Records of conflicted merge you resolved earlier are
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index 66386439b7..c037a46b09 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -45,28 +45,12 @@ OPTIONS
 --auto::
 	With this option, 'git gc' checks whether any housekeeping is
 	required; if not, it exits without performing any work.
-	Some git commands run `git gc --auto` after performing
-	operations that could create many loose objects. Housekeeping
-	is required if there are too many loose objects or too many
-	packs in the repository.
 +
-If the number of loose objects exceeds the value of the `gc.auto`
-configuration variable, then all loose objects are combined into a
-single pack.  Setting the value of `gc.auto`
-to 0 disables automatic packing of loose objects.
+See the `gc.auto' option in the "CONFIGURATION" section below for how
+this heuristic works.
 +
-If the number of packs exceeds the value of `gc.autoPackLimit`,
-then existing packs (except those marked with a `.keep` file
-or over `gc.bigPackThreshold` limit)
-are consolidated into a single pack.
-If the amount of memory estimated for `git repack` to run smoothly is
-not available and `gc.bigPackThreshold` is not set, the largest
-pack will also be excluded (this is the equivalent of running `git gc`
-with `--keep-base-pack`).
-Setting `gc.autoPackLimit` to 0 disables automatic consolidation of
-packs.
-+
-If houskeeping is required due to many loose objects or packs, all
+Once housekeeping is triggered by exceeding the limits of
+configuration options such as `gc.auto` and `gc.autoPackLimit`, all
 other housekeeping tasks (e.g. rerere, working trees, reflog...) will
 be performed as well.
 
@@ -97,66 +81,10 @@ be performed as well.
 CONFIGURATION
 -------------
 
-The optional configuration variable `gc.reflogExpire` can be
-set to indicate how long historical entries within each branch's
-reflog should remain available in this repository.  The setting is
-expressed as a length of time, for example '90 days' or '3 months'.
-It defaults to '90 days'.
-
-The optional configuration variable `gc.reflogExpireUnreachable`
-can be set to indicate how long historical reflog entries which
-are not part of the current branch should remain available in
-this repository.  These types of entries are generally created as
-a result of using `git commit --amend` or `git rebase` and are the
-commits prior to the amend or rebase occurring.  Since these changes
-are not part of the current project most users will want to expire
-them sooner.  This option defaults to '30 days'.
-
-The above two configuration variables can be given to a pattern.  For
-example, this sets non-default expiry values only to remote-tracking
-branches:
-
-------------
-[gc "refs/remotes/*"]
-	reflogExpire = never
-	reflogExpireUnreachable = 3 days
-------------
-
-The optional configuration variable `gc.rerereResolved` indicates
-how long records of conflicted merge you resolved earlier are
-kept.  This defaults to 60 days.
-
-The optional configuration variable `gc.rerereUnresolved` indicates
-how long records of conflicted merge you have not resolved are
-kept.  This defaults to 15 days.
-
-The optional configuration variable `gc.packRefs` determines if
-'git gc' runs 'git pack-refs'. This can be set to "notbare" to enable
-it within all non-bare repos or it can be set to a boolean value.
-This defaults to true.
-
-The optional configuration variable `gc.writeCommitGraph` determines if
-'git gc' should run 'git commit-graph write'. This can be set to a
-boolean value. This defaults to false.
-
-The optional configuration variable `gc.aggressiveWindow` controls how
-much time is spent optimizing the delta compression of the objects in
-the repository when the --aggressive option is specified.  The larger
-the value, the more time is spent optimizing the delta compression.  See
-the documentation for the --window option in linkgit:git-repack[1] for
-more details.  This defaults to 250.
-
-Similarly, the optional configuration variable `gc.aggressiveDepth`
-controls --depth option in linkgit:git-repack[1]. This defaults to 50.
-
-The optional configuration variable `gc.pruneExpire` controls how old
-the unreferenced loose objects have to be before they are pruned.  The
-default is "2 weeks ago".
-
-Optional configuration variable `gc.worktreePruneExpire` controls how
-old a stale working tree should be before `git worktree prune` deletes
-it. Default is "3 months ago".
+The below documentation is the same as what's found in
+linkgit:git-config[1]:
 
+include::config/gc.txt[]
 
 NOTES
 -----
-- 
2.21.0.360.g471c308f928
Previous: Ævar Arnfjörð BjarmasonNext: Todd Zullinger
Message 36 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.