{"thread":{"id":"16464","subject":"[PATCH] Invoke \"gc --auto\" from git commit","startedAt":"2008-11-25T16:15:53Z","lastAt":"2008-11-26T12:37:09Z","messageCount":4,"participants":["Jean-Luc Herren","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"96478","messageId":"492C24B9.6090200@gmx.ch","threadId":"16464","inReplyTo":null,"subject":"[PATCH] Invoke \"gc --auto\" from git commit","fromName":"Jean-Luc Herren","fromEmail":"jlh@gmx.ch","sentAt":"2008-11-25T16:15:53Z","receivedAt":"2008-11-25T16:15:53Z","isPatch":true,"sender":{"key":"jlh@gmx.ch","avatar":null},"body":"This feature was lost during the port of git commit to C.\n\nSigned-off-by: Jean-Luc Herren <jlh@gmx.ch>\n---\n builtin-commit.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 591d16b..209805b 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -947,6 +947,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \tstruct commit_list *parents = NULL, **pptr = &parents;\n \tstruct stat statbuf;\n \tint allow_fast_forward = 1;\n+\tconst char *argv_gc_auto[] = { \"gc\", \"--auto\", NULL };\n \n \tgit_config(git_commit_config, NULL);\n \n@@ -1068,6 +1069,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\t     \"not exceeded, and then \\\"git reset HEAD\\\" to recover.\");\n \n \trerere();\n+\trun_command_v_opt(argv_gc_auto, RUN_GIT_CMD);\n \trun_hook(get_index_file(), \"post-commit\", NULL);\n \tif (!quiet)\n \t\tprint_summary(prefix, commit_sha1);\n-- \n1.6.0.4\n"},{"id":"96506","messageId":"alpine.DEB.1.00.0811260056480.30769@pacific.mpi-cbg.de","threadId":"16464","inReplyTo":"492C24B9.6090200@gmx.ch","subject":"Re: [PATCH] Invoke \"gc --auto\" from git commit","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-11-25T23:57:06Z","receivedAt":"2008-11-25T23:57:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 25 Nov 2008, Jean-Luc Herren wrote:\n\n> This feature was lost during the port of git commit to C.\n\nSee http://article.gmane.org/gmane.comp.version-control.git/82125\n\nCiao,\nDscho\n"},{"id":"96510","messageId":"492C9FAF.4090407@gmx.ch","threadId":"16464","inReplyTo":"alpine.DEB.1.00.0811260056480.30769@pacific.mpi-cbg.de","subject":"Re: [PATCH] Invoke \"gc --auto\" from git commit","fromName":"Jean-Luc Herren","fromEmail":"jlh@gmx.ch","sentAt":"2008-11-26T01:00:31Z","receivedAt":"2008-11-26T01:00:31Z","isPatch":true,"sender":{"key":"jlh@gmx.ch","avatar":null},"body":"Johannes Schindelin wrote:\n> On Tue, 25 Nov 2008, Jean-Luc Herren wrote:\n>> This feature was lost during the port of git commit to C.\n> \n> See http://article.gmane.org/gmane.comp.version-control.git/82125\n\nOh, I missed that.  But then the only commands ever invoking git\ngc --auto would be git rebase -i, git merge, git svn and git am.\nI don't know if some people have repositories where they never use\nany of those, but I certainly have repositories where I only ever\nuse git rebase -i and never any of the other.  'git commit' is\nsomething everyone is bound to use and thus it would be the best\nplace for running 'git gc --auto'.\n\nAs for the performance impact, on my machine 'git gc --auto' runs\n500 times per second in a loop on the git repository (it won't\ncall the hook unless repacking is necessary).  I suppose any\nscript calling git commit in a loop would do substantially more\nwork than git gc --auto itself.  And if that bit of performance\nreally matters, it could be invoked by git commit only if (rand()\n% 20 == 0).\n\nMy two cents anyway.\n\njlh\n"},{"id":"96540","messageId":"alpine.DEB.1.00.0811261335320.30769@pacific.mpi-cbg.de","threadId":"16464","inReplyTo":"492C9FAF.4090407@gmx.ch","subject":"Re: [PATCH] Invoke \"gc --auto\" from git commit","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-11-26T12:37:09Z","receivedAt":"2008-11-26T12:37:09Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Nov 2008, Jean-Luc Herren wrote:\n\n> As for the performance impact, on my machine 'git gc --auto' runs\n> 500 times per second in a loop on the git repository (it won't\n> call the hook unless repacking is necessary).\n\nUmmm.\n\nHow many people do you think share your luck?  git.git is _small_.  Your \nmachine is _fast_.  It is the typical mistake in IT, not thinking about \nreal-world cases...\n\nCiao,\nDscho\n"}]}