Re: [BUG?] gc and impatience
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 3, 2013, 04:44 UTC
- Message-ID
- <CAPc5daXi_ZG6GcK6pWafffyOY4MEZHUMkZxTxiRiU4BaFybqqg@mail.gmail.com>
- In-Reply-To
- <CACsJy8DRo9Akoydwn9-EPOSyJiPhqAf1=HncYjHvXZwS4S_d7A@mail.gmail.com>
On Fri, Aug 2, 2013 at 8:53 PM, Duy Nguyen <pclouds@gmail.com> wrote:
> Good point. I think that is because gc does not check if gc is already > running. Adding such a check should not be too hard. I think gc could > save its pid in $GIT_DIR/auto-gc.pid. The next auto-gc checks this, if > the pid is valid, skip auto-gc.
Defining "valid" is a tricky business, though, as pid can and will wrap around, and the directory could be shared on multiple machines. A pid written by a process on one machine has no relation to any pid on another machine.