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

Re: notify alternative to auto gc?

From
Karl Stenerud <kstenerud@gmail.com>
Date
Jun 28, 2010, 16:56 UTC
Message-ID
<ECC14D96-DAA0-4165-9FC5-43328504CE09@gmail.com>
In-Reply-To
<AANLkTikjbu_q6QToVUeNAAL0Fls9eQ5BZkzZ1-8L93zh@mail.gmail.com>
On 2010-06-28, at 12:29 PM, Chris Packham wrote:
Show 30 quoted lines
> On Mon, Jun 28, 2010 at 9:10 AM, Karl Stenerud <kstenerud@gmail.com> wrote:
>> Hi,
>> 
>> As I did a git pull on my project today, git went into some kind of auto gc mode:
>> 
>> Auto packing the repository for optimum performance. You may also
>> run "git gc" manually. See "git help gc" for more information.
>> Counting objects: 4531, done.
>> 
>> This is, of course, quite an annoying feature since it could hit at any (inconvenient) time.
>> 
>> The git help tells me I can disable it by setting gc.auto to 0, while the mailing list archive tells me I also have to set gc.autopacklimit to 0.  This is fine, but if I do that, I won't know when the repo is in need of cleanup.  Is there any option I can set to instruct it to simply TELL me when it's in need of gc?
>> 
> 
> I don't think there is an existing configuration for this but I think
> you can achieve what you want with the "pre-auto-gc" hook. From the
> githooks(5) man page
> 
>  pre-auto-gc
>     This hook is invoked by git gc --auto. It takes no parameter, and
>     exiting with non-zero status from this script causes the git gc --auto
>     to abort.
> 
> So a hook like
> 
>  #! /bin/sh
>  echo "repository needs git gc"
>  exit 1
> 
> Should cause the auto gc to be skipped.
Cool thanks!  I'll give that a shot.
Previous: Chris PackhamNext: Chris Packham
Message 8 of 21 in “notify alternative to auto gc?”
  1. Karl StenerudJun 28, 2010
  2. Ævar Arnfjörð BjarmasonJun 28, 2010
  3. Karl StenerudJun 28, 2010
  4. Matthieu MoyJun 29, 2010
  5. Sam VilainJun 30, 2010
  6. Matthieu MoyJun 28, 2010
  7. Chris PackhamJun 28, 2010
  8. Karl StenerudJun 28, 2010
  9. Documentation/git-gc.txt: add reference to githooksChris Packham, Jun 28, 2010
  10. Marc BranchaudJun 28, 2010
  11. Junio C HamanoJun 29, 2010
  12. Chris PackhamJun 29, 2010
  13. Junio C HamanoJun 29, 2010
  14. Chris PackhamJun 29, 2010
  15. [PATCHv2] Documentation/git-gc.txt: add reference to githooksChris Packham, Jun 30, 2010
  16. David BrownSep 21, 2010
  17. Chris PackhamSep 21, 2010
  18. David BrownSep 21, 2010
  19. Re* [PATCH/RFC] Documentation/git-gc.txt: add reference to githooksJunio C Hamano, Sep 21, 2010
  20. Eric RaibleJun 28, 2010
  21. Jacob HelwigJun 28, 2010

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.