Re: notify alternative to auto gc?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 28, 2010 at 9:10 AM, Karl Stenerud <kstenerud@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]