* [PATCH] Invoke "git gc --auto" when a commit is successful.
@ 2009-03-21 22:34 David J. Mellor
2009-03-21 23:26 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: David J. Mellor @ 2009-03-21 22:34 UTC (permalink / raw)
To: gitster; +Cc: git
This functionality was added to the previous git-commit.sh script in d4bb43e,
but omitted when the script was ported to C in f5bbc32. This patch reinstates
the functionality by copying the equivalent code that was introduced in
builtin-merge.c in 1c7b76b.
Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
---
builtin-commit.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 46e649c..780c142 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -1029,5 +1029,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (!quiet)
print_summary(prefix, commit_sha1);
+ /*
+ * Perform an automatic garbage collection if the commit was successful.
+ * We ignore errors in 'gc --auto', since the user should see them.
+ */
+ const char *argv_gc_auto[] = { "gc", "--auto", NULL };
+ run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+
return 0;
}
--
1.6.2.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Invoke "git gc --auto" when a commit is successful.
2009-03-21 22:34 [PATCH] Invoke "git gc --auto" when a commit is successful David J. Mellor
@ 2009-03-21 23:26 ` Junio C Hamano
2009-03-21 23:37 ` David J. Mellor
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2009-03-21 23:26 UTC (permalink / raw)
To: David J. Mellor; +Cc: git
I do not think situation has changed since the previous round:
http://thread.gmane.org/gmane.comp.version-control.git/78524/focus=82130
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Invoke "git gc --auto" when a commit is successful.
2009-03-21 23:26 ` Junio C Hamano
@ 2009-03-21 23:37 ` David J. Mellor
0 siblings, 0 replies; 3+ messages in thread
From: David J. Mellor @ 2009-03-21 23:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On 03/21/2009 04:26 PM, Junio C Hamano wrote:
> I do not think situation has changed since the previous round:
>
> http://thread.gmane.org/gmane.comp.version-control.git/78524/focus=82130
>
>
Thanks for the pointer. I had searched the list before coding this up,
but somehow had missed this thread.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-21 23:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-21 22:34 [PATCH] Invoke "git gc --auto" when a commit is successful David J. Mellor
2009-03-21 23:26 ` Junio C Hamano
2009-03-21 23:37 ` David J. Mellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).