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

[PATCH 5/5] builtin/repack.c: reword comment around pack-objects flags

From
Taylor Blau <me@ttaylorr.com>
Date
Mar 5, 2021, 15:22 UTC
Message-ID
<de4715c7c75e36c446782107f3194a3eedaffdde.1614957681.git.me@ttaylorr.com>
In-Reply-To
<cover.1614957681.git.me@ttaylorr.com>
From: Junio C Hamano <gitster@pobox.com>

The comment in this block is meant to indicate that passing '--all', '--reflog', and so on aren't necessary when repacking with the '--geometric' option.

But, it has two problems: first, it is factually incorrect ('--all' is *not* incompatible with '--stdin-packs' as the comment suggests); second, it is quite focused on the geometric case for a block that is guarding against it.

Reword this comment to address both issues.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 builtin/repack.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/builtin/repack.c b/builtin/repack.c
index 677c6b75c1..6ce2556c9e 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -545,12 +545,14 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 	strvec_push(&cmd.args, "--non-empty");
 	if (!geometry) {
 		/*
-		 * 'git pack-objects' will up all objects loose or packed
-		 * (either rolling them up or leaving them alone), so don't pass
-		 * these options.
+		 * We need to grab all reachable objects, including those that
+		 * are reachable from reflogs and the index.
 		 *
-		 * The implementation of 'git pack-objects --stdin-packs'
-		 * makes them redundant (and the two are incompatible).
+		 * When repacking into a geometric progression of packs,
+		 * however, we ask 'git pack-objects --stdin-packs', and it is
+		 * not about packing objects based on reachability but about
+		 * repacking all the objects in specified packs and loose ones
+		 * (indeed, --stdin-packs is incompatible with these options).
 		 */
 		strvec_push(&cmd.args, "--all");
 		strvec_push(&cmd.args, "--reflog");
-- 
2.30.0.667.g81c0cbc6fd
Previous: Jeff KingNext: Taylor Blau
Message 11 of 12 in “clean-ups to geometric repacking”
  1. 0/5 clean-ups to geometric repackingTaylor Blau, Mar 5, 2021
  2. 1/5 builtin/repack.c: do not repack single packs with --geometricTaylor Blau, Mar 5, 2021
  3. Junio C HamanoMar 5, 2021
  4. Taylor BlauMar 5, 2021
  5. Taylor BlauMar 5, 2021
  6. 2/5 t7703: test --geometric repack with loose objectsTaylor Blau, Mar 5, 2021
  7. 4/5 builtin/repack.c: be more conservative with unsigned overflowsTaylor Blau, Mar 5, 2021
  8. Junio C HamanoMar 5, 2021
  9. Taylor BlauMar 5, 2021
  10. Jeff KingMar 10, 2021
  11. 5/5 builtin/repack.c: reword comment around pack-objects flagsTaylor Blau, Mar 5, 2021
  12. 3/5 builtin/repack.c: assign pack split laterTaylor Blau, Mar 5, 2021

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.