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

[PATCH 5/8] git-gc --auto: add documentation.

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 17, 2007, 08:44 UTC
Message-ID
<11900187073420-git-send-email-gitster@pobox.com>
In-Reply-To
<11900186941912-git-send-email-gitster@pobox.com>

This documents the auto-packing of loose objects performed by git-gc --auto.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/config.txt |    7 +++++++
 Documentation/git-gc.txt |   11 ++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 866e053..3643c0b 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -439,6 +439,13 @@ gc.aggressiveWindow::
 	algorithm used by 'git gc --aggressive'.  This defaults
 	to 10.
 
+gc.auto::
+	When there are approximately more than this many loose
+	objects in the repository, `git gc --auto` that is
+	invoked by some Porcelain commands will create a new
+	pack and prune them.  Setting this to 0 disables the
+	auto garbage collection.
+
 gc.packrefs::
 	`git gc` does not run `git pack-refs` in a bare repository by
 	default so that older dumb-transport clients can still fetch
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index c7742ca..40c1ce4 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository
 
 SYNOPSIS
 --------
-'git-gc' [--prune] [--aggressive]
+'git-gc' [--prune] [--aggressive] [--auto]
 
 DESCRIPTION
 -----------
@@ -43,6 +43,15 @@ OPTIONS
 	persistent, so this option only needs to be used occasionally; every
 	few hundred changesets or so.
 
+--auto::
+	With this option, `git gc` checks if there are too many
+	loose objects in the repository and runs
+	gitlink:git-repack[1] with `-d -l` option to pack them.
+	The threshold is set with `gc.auto` configuration
+	variable, and can be disabled by setting it to 0.  Some
+	Porcelain commands use this after they perform operation
+	that could create many loose objects automatically.
+
 Configuration
 -------------
 
-- 
1.5.3.1.967.g6bb01
Previous: Junio C HamanoNext: Johannes Schindelin
Message 8 of 18 in “Export matches_pack_name() and fix its return value”
  1. 1/8 Export matches_pack_name() and fix its return valueJunio C Hamano, Sep 17, 2007
  2. 2/8 pack-objects --keep-unreachableJunio C Hamano, Sep 17, 2007
  3. 3/8 repack -A -d: use --keep-unreachable when repackingJunio C Hamano, Sep 17, 2007
  4. Johannes SchindelinSep 17, 2007
  5. Andreas EricssonSep 17, 2007
  6. Shawn O. PearceSep 18, 2007
  7. 4/8 git-gc --auto: move threshold check to need_to_gc() function.Junio C Hamano, Sep 17, 2007
  8. 5/8 git-gc --auto: add documentation.Junio C Hamano, Sep 17, 2007
  9. Johannes SchindelinSep 17, 2007
  10. Junio C HamanoSep 17, 2007
  11. 6/8 git-gc --auto: protect ourselves from accumulated cruftJunio C Hamano, Sep 17, 2007
  12. 7/8 git-gc --auto: restructure the way "repack" command line is built.Junio C Hamano, Sep 17, 2007
  13. Johannes SchindelinSep 17, 2007
  14. Junio C HamanoSep 17, 2007
  15. 8/8 git-gc --auto: run "repack -A -d -l" as necessary.Junio C Hamano, Sep 17, 2007
  16. Johannes SchindelinSep 17, 2007
  17. Junio C HamanoSep 17, 2007
  18. Shawn O. PearceSep 18, 2007

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.