Re: [PATCH] commit: run git gc --auto just before the pre-commit hook
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 28, 2018, 22:29 UTC
- Message-ID
- <xmqqzi3siw88.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180228221358.16286-1-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Change the behavior of git-commit back to what it was back in
> d4bb43ee27 ("Invoke "git gc --auto" from commit, merge, am and
> rebase.", 2007-09-05) when it was git-commit.sh.... which was to run it just before post-commit. Do I retitle this patch before queuing?
The code seems to run it "after" post-commit. We need to explain why we chose to run it differently from the old practice, when we claim we resurrect the old behaviour with this change.
> Shortly afterwards in f5bbc3225c ("Port git commit to C.", 2007-11-08)
> when it was ported to C the "git gc --auto" invocation went away.So this is a decade late regression fix? As they say, better late than never, probably.
Show 8 quoted lines
> @@ -1608,6 +1609,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>
> rerere(0);
> run_commit_hook(use_editor, get_index_file(), "post-commit", NULL);
> + run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
> if (amend && !no_post_rewrite) {
> commit_post_rewrite(current_head, &oid);
> }