Skip to content

Commit f26eef3

Browse files
peffgitster
authored andcommitted
check_everything_connected: always pass --quiet to rev-list
The check_everything_connected function takes a "quiet" parameter which does two things if non-zero: 1. redirect rev-list's stderr to /dev/null to avoid showing errors to the user 2. pass "--quiet" to rev-list Item (1) is obviously useful. But item (2) is surprisingly not. For rev-list, "--quiet" does not have anything to do with chattiness on stderr; it tells rev-list not to bother writing the list of traversed objects to stdout, for efficiency. And since we always redirect rev-list's stdout to /dev/null in this function, there is no point in asking it to ever write anything to stdout. The efficiency gains are modest; a best-of-five run of "git rev-list --objects --all" on linux.git dropped from 32.013s to 30.502s when adding "--quiet". That's only about 5%, but given how easy it is, it's worth doing. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 08bb350 commit f26eef3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

connected.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ static int check_everything_connected_real(sha1_iterate_fn fn,
5656
argv[ac++] = "--stdin";
5757
argv[ac++] = "--not";
5858
argv[ac++] = "--all";
59-
if (quiet)
60-
argv[ac++] = "--quiet";
59+
argv[ac++] = "--quiet";
6160
argv[ac] = NULL;
6261

6362
rev_list.argv = argv;

0 commit comments

Comments
 (0)