Re: create reflog for reflog-less ref

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

 



On Tue, Feb 25, 2020 at 7:47 PM Jeff King <peff@xxxxxxxx> wrote:
> On Wed, Feb 26, 2020 at 02:39:09AM +0000, brian m. carlson wrote:
> > There is the option core.logAllRefUpdates, which has the value "always"
> > in more modern versions of Git.  The documentation says,
> > ...
> The current rule is actually to append to any reflog that already
> exists, or to consult core.logAllRefUpdates when deciding whether to
> create one that doesn't exist. So I think setting a one-shot config
> variable like:
>
>   git -c core.logAllRefUpdates=always update-ref refs/foo/bar ...

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..

--Chris

>
> would create the reflog, and then any subsequent updates (even without
> that config set) would append to it.



[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]

  Powered by Linux