Skip to content

Commit ccae01c

Browse files
committed
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 <[email protected]> Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2a15964 commit ccae01c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

builtin/repack.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,14 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
545545
strvec_push(&cmd.args, "--non-empty");
546546
if (!geometry) {
547547
/*
548-
* 'git pack-objects' will up all objects loose or packed
549-
* (either rolling them up or leaving them alone), so don't pass
550-
* these options.
548+
* We need to grab all reachable objects, including those that
549+
* are reachable from reflogs and the index.
551550
*
552-
* The implementation of 'git pack-objects --stdin-packs'
553-
* makes them redundant (and the two are incompatible).
551+
* When repacking into a geometric progression of packs,
552+
* however, we ask 'git pack-objects --stdin-packs', and it is
553+
* not about packing objects based on reachability but about
554+
* repacking all the objects in specified packs and loose ones
555+
* (indeed, --stdin-packs is incompatible with these options).
554556
*/
555557
strvec_push(&cmd.args, "--all");
556558
strvec_push(&cmd.args, "--reflog");

0 commit comments

Comments
 (0)