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

[PATCHv2 5/5] builtin/gc: add --assume-pack-keep-transitive

From
NFNathaniel Filardo <nwf20@cl.cam.ac.uk>
Date
Mar 16, 2019, 20:05 UTC
Message-ID
<20190316200520.14260-6-nwf20@cl.cam.ac.uk>
In-Reply-To
<20190316200520.14260-1-nwf20@cl.cam.ac.uk>
Just pass it on down to builtin/repack.
Signed-off-by: Nathaniel Filardo <nwf20@cl.cam.ac.uk>
---
 Documentation/git-gc.txt | 5 +++++
 builtin/gc.c             | 5 +++++
 2 files changed, 10 insertions(+)
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index a7c1b0f60e..7115564f7d 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -96,6 +96,11 @@ be performed as well.
 	`.keep` files are consolidated into a single pack. When this
 	option is used, `gc.bigPackThreshold` is ignored.
 
+--assume-pack-keep-transitive::
+	Pass the `--assume-pack-keep-transitive` option to `git-repack`;
+	see linkgit:git-repack[1].
+
+
 CONFIGURATION
 -------------
 
diff --git a/builtin/gc.c b/builtin/gc.c
index 020f725acc..b0c160abec 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -504,6 +504,7 @@ static void gc_before_repack(void)
 int cmd_gc(int argc, const char **argv, const char *prefix)
 {
 	int aggressive = 0;
+	int assume_pack_keep_transitive = 0;
 	int auto_gc = 0;
 	int quiet = 0;
 	int force = 0;
@@ -526,6 +527,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 			   PARSE_OPT_NOCOMPLETE),
 		OPT_BOOL(0, "keep-largest-pack", &keep_base_pack,
 			 N_("repack all other packs except the largest pack")),
+		OPT_BOOL(0, "assume-pack-keep-transitive", &assume_pack_keep_transitive,
+			 N_("assume kept packs reference only kept packs")),
 		OPT_END()
 	};
 
@@ -564,6 +567,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 	}
 	if (quiet)
 		argv_array_push(&repack, "-q");
+	if (assume_pack_keep_transitive)
+		argv_array_push(&repack, "--assume-pack-keep-transitive");
 
 	if (auto_gc) {
 		/*
-- 
2.17.1
Previous: Nathaniel FilardoNext: Nathaniel Filardo
Message 3 of 6 in “[PATCHv2 0/5] Speed up repacking when lots of pack-kept objects”
  1. Nathaniel FilardoMar 16, 2019
  2. 4/5 repack: optionally assume transitive kept packsNathaniel Filardo, Mar 16, 2019
  3. 5/5 builtin/gc: add --assume-pack-keep-transitiveNathaniel Filardo, Mar 16, 2019
  4. 1/5 count-objects: report statistics about kept packsNathaniel Filardo, Mar 16, 2019
  5. 2/5 revision walk: optionally use sparse reachabilityNathaniel Filardo, Mar 16, 2019
  6. 3/5 repack: add --sparse and pass to pack-objectsNathaniel Filardo, Mar 16, 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.