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

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);
>  	}
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 4 in “commit: run git gc --auto just before the pre-commit hook”
  1. commit: run git gc --auto just before the pre-commit hookÆvar Arnfjörð Bjarmason, Feb 28, 2018
  2. Junio C HamanoFeb 28, 2018
  3. commit: run git gc --auto just before the pre-commit hookÆvar Arnfjörð Bjarmason, Feb 28, 2018
  4. Junio C HamanoFeb 28, 2018

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.