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

Re: Forcing GC to always fail

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 28, 2018, 00:11 UTC
Message-ID
<87d0qqysay.fsf@evledraar.gmail.com>
In-Reply-To
<CAGyf7-F-zs9Xyx623HizpOrv80y3PydReFYw-64w3T7Xfr3CNg@mail.gmail.com>
On Wed, Nov 28 2018, Bryan Turner wrote:
Show 25 quoted lines
> On Tue, Nov 27, 2018 at 3:47 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>>
>>
>> On Tue, Nov 27 2018, Bryan Turner wrote:
>>
>> >
>> > Is there anything I can set, perhaps some invalid configuration
>> > option/value, that will make "git gc" (most important) and "git
>> > reflog" (ideal, but less important) fail when they're run in our
>> > repositories? Hopefully at that point customers will reach out to us
>> > for help _before_ they corrupt their repositories.
>>
>> You could fix this and so many other issues by just hanging up a "Is
>> This Good For The Company?" banner up in Atlassian offices .
>
> Not sure I understand what this means, or what your goal was in saying
> it. No one inside Atlassian is running these commands. I'm trying to
> help save administrators from themselves, which reduces real world
> end-user pain that comes from decisions made without fully
> understanding the consequences. It feels like this comment is mocking
> my earnest desire to help, and my genuine question looking for any
> insight people more familiar with the code might be able to offer.
> Perhaps I'm just missing the joke, but if it's an Office Space
> reference it feels like it's in pretty poor taste.

I (mis)read 'administrators' as being other people at Atlassian. Yeah it's a reference to Office Space. I meaning to poke some fun at the situation of having to defensively configure tools least co-workers run them the wrong way, which I'm sure we've all had to do at some point. I didn't mean any offense by it.

Show 16 quoted lines
>>
>> But more seriously:
>>
>>     $ stahp='Bryan.Turner.will.hunt.you.down.if.you.manually.run.gc' && git -c gc.pruneExpire=$stahp gc; git -c gc.reflogExpire=$stahp reflog expire
>>     error: Invalid gc.pruneexpire: 'Bryan.Turner.will.hunt.you.down.if.you.manually.run.gc'
>>     fatal: unable to parse 'gc.pruneexpire' from command-line config
>>     error: 'Bryan.Turner.will.hunt.you.down.if.you.manually.run.gc' for 'gc.reflogexpire' is not a valid timestamp
>>     fatal: unable to parse 'gc.reflogexpire' from command-line config
>
> Thanks for that! It looks like that does block both "git gc" and "git
> reflog expire" without blocking "git pack-refs", "git repack" or "git
> prune". Fantastic! The fact that it shows the invalid value means it
> might also be possible to at least provide a useful hint that manual
> GC is not safe.
>
> I appreciate your help, Ævar.

No problem. I was going to add that you can set e.g. pack.windowMemory='some.message' to make this go for git-repack too, but it sounds like you don't want that.

Is there a reason for why BitBucket isn't using 'git-gc'? Some other hosting providers use it, and if you don't run it with "expire now" or similarly aggressive non-default values on an active repository it won't corrupt anything.

Previous: Bryan TurnerNext: Elijah Newren
Message 4 of 8 in “Forcing GC to always fail”
  1. Bryan TurnerNov 27, 2018
  2. Ævar Arnfjörð BjarmasonNov 27, 2018
  3. Bryan TurnerNov 28, 2018
  4. Ævar Arnfjörð BjarmasonNov 28, 2018
  5. Elijah NewrenNov 28, 2018
  6. Bryan TurnerNov 28, 2018
  7. Junio C HamanoNov 29, 2018
  8. Bryan TurnerNov 29, 2018

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.