Re: create reflog for reflog-less ref
- From
Jeff King <peff@peff.net>
- Date
- Feb 26, 2020, 09:47 UTC
- Message-ID
- <20200226094716.GA14546@coredump.intra.peff.net>
- In-Reply-To
- <CAOTb1wfWtFsy415k+goRiuLUiVBqtizmmoyxqFdy7xsRhjnBww@mail.gmail.com>
On Tue, Feb 25, 2020 at 11:18:39PM -0800, Chris Jerdonek wrote:
Show 19 quoted lines
> Thanks for the suggestions both of you. I didn't know about "always." > It looks like it was added in 2.12.0: > https://github.com/git/git/blob/master/Documentation/RelNotes/2.12.0.txt#L129 > > After experimenting a bit more, I seem to be finding that-- > > * The "one-shot" `-c core.logAllRefUpdates=always` approach only seems > to work with git-update-ref if you're *changing* the SHA with > update-ref, and > * Passing `--create-reflog` also seems to work like the one-shot > config approach (again, as long as you're changing the SHA). > > I feel like these options are still wanting.. If you want to add a > missing reflog without changing the ref, these approaches still seem > to require you to temporarily change it to something different (as did > the delete-create approach I stated in my first email). It would be > nice to be able to create (or append to) the reflog without having to > change where the ref is pointing. Or maybe I'm missing a variation > that will do this..
No, I don't think there is a variation that will do that. You'd have to wait for the next update.
The "touch" trick I showed would work for that, but it's not going to be portable going forward. I don't think it would be a bad idea to have some way of triggering a "noop" reflog update via update-ref, where we either create the reflog as empty, or insert a pointless entry going from the current sha1 to itself. But AFAIK that doesn't exist right now.
-Peff