Re: create reflog for reflog-less ref

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

 



On Wed, Feb 26, 2020 at 1:47 AM Jeff King <peff@xxxxxxxx> wrote:
> On Tue, Feb 25, 2020 at 11:18:39PM -0800, Chris Jerdonek wrote:
> > 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..
> ...
> 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.

Thanks. By the way, this functionality does already seem to exist for ref HEAD:

$ git update-ref -m my-message HEAD HEAD
$ git reflog HEAD
3ccacdc (HEAD -> master) HEAD@{0}: my-message
...

I don't know why it would work for HEAD though and what's different
about the mechanism. I thought it might be because it's a symbolic
ref, but it didn't work for other symbolic refs when I tried (even
ones that already had a reflog).

--Chris



[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