summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-03-05 10:22:02 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-03-05 11:33:52 -0800
commitccae01cab817f64a52fcb403cb355e41c2303b74 (patch)
treeddcd8fb1a0a3d94343abbc5382090287ee19db72 /builtin
parentbuiltin/repack.c: be more conservative with unsigned overflows (diff)
downloadtgif-ccae01cab817f64a52fcb403cb355e41c2303b74.tar.xz
builtin/repack.c: reword comment around pack-objects flags
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/repack.c12
1 files 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");