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

Re: [PATCH] Update "gc" behavior in commit, merge, am, rebase and index-pack

From
Jeff King <peff@peff.net>
Date
May 14, 2012, 20:50 UTC
Message-ID
<20120514205039.GB3740@sigill.intra.peff.net>
In-Reply-To
<1336810134-3103-1-git-send-email-pclouds@gmail.com>
On Sat, May 12, 2012 at 03:08:54PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 5 quoted lines
> Instead, we could just inform users that "gc" should be run soon in
> commonly used commands (this patch also reinstates "gc" check in
> commit, which was lost at the sh->C conversion). [1] and [2] can annoy
> users constantly with warnings. This patch shows the warning at most
> once a day.

Hmm. The missing "gc" from git-commit has been noticed before, but we decided not to reinstate it[1]:

  http://thread.gmane.org/gmane.comp.version-control.git/78524/focus=78693
However, I'm not sure Junio's argument in that thread is valid:
  I had an impression that we accepted the hook which made "gc --auto"
  more expensive by forcing it to check the hook (and possibly execute
  it every time) after vetting am, svn and friends to make sure nobody
  triggered "gc --auto" once per every commit, and during that vetting
  process we noticed that "git commit" lost the "gc --auto" at the end.

The pre-auto-gc hook runs only when we need to gc (i.e., when we would be doing something expensive, anyway). So it is still cheap to check whether we need to gc (although if you have an option like "--check" which does not _fix_ the situation after checking, then you may end up running the hook repeatedly).

-Peff
[1] It also came up other times:
      http://thread.gmane.org/gmane.comp.version-control.git/101667
      http://thread.gmane.org/gmane.comp.version-control.git/114089
    but each time it seems to have been rejected on the basis of the
    first argument.
Previous: Jeff KingNext: Junio C Hamano
Message 8 of 17 in “Update "gc" behavior in commit, merge, am, rebase and index-pack”
  1. Update "gc" behavior in commit, merge, am, rebase and index-packNguyễn Thái Ngọc Duy, May 12, 2012
  2. Nguyen Thai Ngoc DuyMay 12, 2012
  3. Nicolas PitreMay 12, 2012
  4. Nguyen Thai Ngoc DuyMay 14, 2012
  5. Sverre RabbelierMay 14, 2012
  6. Nguyen Thai Ngoc DuyMay 15, 2012
  7. Jeff KingMay 14, 2012
  8. Jeff KingMay 14, 2012
  9. Junio C HamanoMay 14, 2012
  10. 0/5 "git gc --auto" updateNguyễn Thái Ngọc Duy, May 16, 2012
  11. 1/5 Add convenient function to do automatic garbage collectionNguyễn Thái Ngọc Duy, May 16, 2012
  12. Junio C HamanoMay 18, 2012
  13. Nguyen Thai Ngoc DuyMay 19, 2012
  14. 2/5 index-pack: perform automatic gc, share receive.gc config with receive-packNguyễn Thái Ngọc Duy, May 16, 2012
  15. 3/5 commit: reinstate "gc --auto"Nguyễn Thái Ngọc Duy, May 16, 2012
  16. 4/5 gc: add --dry-runNguyễn Thái Ngọc Duy, May 16, 2012
  17. 5/5 Update "gc" behavior in commit, merge, am and rebaseNguyễn Thái Ngọc Duy, May 16, 2012

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.