From: Jeff King <peff@peff.net>
To: Chris Jerdonek <chris.jerdonek@gmail.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: create reflog for reflog-less ref
Date: Wed, 26 Feb 2020 13:40:38 -0500 [thread overview]
Message-ID: <20200226184038.GB23188@coredump.intra.peff.net> (raw)
In-Reply-To: <CAOTb1weTWOsHkbGqmj8mJ-KpkoiteHBDYDxe-j2E0yf3DccjjQ@mail.gmail.com>
On Wed, Feb 26, 2020 at 02:21:59AM -0800, Chris Jerdonek wrote:
> > 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).
I suspect that wasn't really intentional, but just a by-product of the
way we treat HEAD's reflog specially (when we update any other ref, if
HEAD points to it, we'll update the HEAD reflog, too). But I could be
wrong (you'd have to dig in the commit history around that code).
-Peff
prev parent reply other threads:[~2020-02-26 18:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 1:07 create reflog for reflog-less ref Chris Jerdonek
2020-02-26 2:39 ` brian m. carlson
2020-02-26 3:47 ` Jeff King
2020-02-26 7:18 ` Chris Jerdonek
2020-02-26 9:47 ` Jeff King
2020-02-26 10:21 ` Chris Jerdonek
2020-02-26 18:40 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200226184038.GB23188@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=chris.jerdonek@gmail.com \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).