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

[PATCH] Documentation/git-gc.txt: change --aggressive description

From
PBPieter de Bie <pdebie@ai.rug.nl>
Date
May 13, 2008, 09:53 UTC
Message-ID
<1210672413-8761-1-git-send-email-pdebie@ai.rug.nl>

The documentation for the --aggressive flag was misleading, hinting that running git gc with --aggressive is a good thing. However, --aggressive only really makes sense if you have a bad pack file, such as from git-fast-import. ---

I keep seeing people regularly packing their repo with git gc --aggressive. However, in my experience, this seldom results in a smaller repository. This can be because the repository was repacked tightly previously (for example, with a high --window value) or because incremental "git gc" just makes better packs anyway. Throwing away that information is often not a good idea.

The documentation for the --aggressive flag was misleading, in that it hints that you'll get a smaller pack, which is often not the case.
 Documentation/git-gc.txt |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index b6b5ce1..ebf972c 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -36,9 +36,11 @@ OPTIONS
 	Usually 'git-gc' runs very quickly while providing good disk
 	space utilization and performance.  This option will cause
 	git-gc to more aggressively optimize the repository at the expense
-	of taking much more time.  The effects of this optimization are
-	persistent, so this option only needs to be used occasionally; every
-	few hundred changesets or so.
+	of taking much more time. Note that this will throw away all previous
+	optimizations. As a result, running git gc with --aggressive will not
+	necessarily create a smaller pack file, especially when the repository was
+	packed tightly already. Using --aggressive only makes sense if you have a
+	badly packed repository, such as created by git-fast-import.
 
 --auto::
 	With this option, `git gc` checks whether any housekeeping is
-- 
1.5.5.1.174.g32fa0.dirty
Next: Teemu Likonen
Message 1 of 10 in “Documentation/git-gc.txt: change --aggressive description”
  1. Documentation/git-gc.txt: change --aggressive descriptionPieter de Bie, May 13, 2008
  2. Teemu LikonenMay 13, 2008
  3. Teemu LikonenMay 13, 2008
  4. Johannes SchindelinMay 13, 2008
  5. Teemu LikonenMay 13, 2008
  6. Pieter de BieMay 13, 2008
  7. Johannes SchindelinMay 13, 2008
  8. Pieter de BieMay 14, 2008
  9. Matthieu MoyMay 14, 2008
  10. Pieter de BieMay 24, 2008

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.