git/list[1] front-page[2] threads[3] people[4] search[5] about
 

feature suggestion: git symbolic-ref --create-reflog

From
Chris Jerdonek <chris.jerdonek@gmail.com>
Date
Mar 1, 2020, 02:08 UTC
Message-ID
<CAOTb1wcJyQchyGqTqY6B+j94Tw6Htp7tB4Bt-J7pyXBC7q-XCg@mail.gmail.com>

This email is to suggest the idea of adding a --create-reflog flag to git-symbolic-ref in the same way that git-update-ref has one.

(This suggestion relates to my previous email with subject "ambiguous git-reflog output for symbolic refs," which points out an issue with git-reflog for symbolic refs that don't have a reflog: https://public-inbox.org/git/CAOTb1wfXp+gXSwbG-CVgVE8E_5yzxQKwNKh_=3ECqTMvZFw7dQ@mail.gmail.com/T/#u )

To illustrate, if you create a symbolic ref in the standard set, it creates a reflog for the symbolic ref:

$ git symbolic-ref -m create-symref refs/heads/my-new-symref refs/heads/master $ cat .git/logs/refs/heads/my-new-symref 0000000000000000000000000000000000000000 b2d80b44f20594470d9f3c2d16bbb83d71370e1e Chris Jerdonek <chris.jerdonek@gmail.com> 1583026811 -0800 create-symref

But if you create one outside of the standard set, it doesn't (and there's no --create-reflog option like there is with git-update-ref):

$ git symbolic-ref -m create-symref refs/foo/my-new-symref refs/heads/master $ cat .git/logs/refs/foo/my-new-symref cat: .git/logs/refs/foo/my-new-symref: No such file or directory

I do notice that Jeff's "one-shot config" approach that he suggested in reply to an earlier email of mine [1] (with subject line "create reflog for reflog-less ref") provides a workaround in the absence of this option:

$ git -c core.logAllRefUpdates=always symbolic-ref -m one-shot refs/foo/my-symref refs/heads/master $ cat .git/logs/refs/foo/my-symref 0000000000000000000000000000000000000000 b2d80b44f20594470d9f3c2d16bbb83d71370e1e Chris Jerdonek <chris.jerdonek@gmail.com> 1583027929 -0800 one-shot

--Chris
[1]: https://public-inbox.org/git/CAOTb1wc2uMSyc7DMau2cWrWtk=_Z94+CCovORj1dGCrwgJhL=w@mail.gmail.com/
Message 1 of 1 in “feature suggestion: git symbolic-ref --create-reflog”
  1. Chris JerdonekMar 1, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.