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

[PATCH] Invoke "gc --auto" from git commit

From
JHJean-Luc Herren <jlh@gmx.ch>
Date
Nov 25, 2008, 16:15 UTC
Message-ID
<492C24B9.6090200@gmx.ch>
This feature was lost during the port of git commit to C.
Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
---
 builtin-commit.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 591d16b..209805b 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -947,6 +947,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	struct commit_list *parents = NULL, **pptr = &parents;
 	struct stat statbuf;
 	int allow_fast_forward = 1;
+	const char *argv_gc_auto[] = { "gc", "--auto", NULL };
 
 	git_config(git_commit_config, NULL);
 
@@ -1068,6 +1069,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		     "not exceeded, and then \"git reset HEAD\" to recover.");
 
 	rerere();
+	run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
 	run_hook(get_index_file(), "post-commit", NULL);
 	if (!quiet)
 		print_summary(prefix, commit_sha1);
-- 
1.6.0.4
Next: Johannes Schindelin
Message 1 of 4 in “Invoke "gc --auto" from git commit”
  1. Invoke "gc --auto" from git commitJean-Luc Herren, Nov 25, 2008
  2. Johannes SchindelinNov 25, 2008
  3. Jean-Luc HerrenNov 26, 2008
  4. Johannes SchindelinNov 26, 2008

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.