Re: [PATCH v2 5/5] Reftable support for git-core
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 29, 2020, 18:34 UTC
- Message-ID
- <xmqqmua65cxi.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20200129081259.GB601903@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> I was mostly thinking of hacky scripts that tried to touch .git/refs > directly. And there are a few levels of dangerous there: > > - if you're doing "echo $sha1 >.git/refs/heads/master", then you're > not locking properly. But it would probably work most of the time. > > - if you're properly taking a lock on ".git/refs/heads/master.lock" > and renaming into place but not looking at packed-refs, then you > might overwrite somebody else's update which is in the packed file > > - if you're trying to read refs and not reading packed-refs, obviously > you might miss some values
... but the values you read are the right ones as loose refs overlay and trump what is in packed-refs.
- if you're trying to delete a branch by removing a file under refs/, that would uncover the corresponding entry in packed-refs, if exists---in other words, you may resurrect an older value of a branch instead of deleting it.