git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* feature suggestion: git symbolic-ref --create-reflog
@ 2020-03-01  2:08 Chris Jerdonek
  0 siblings, 0 replies; only message in thread
From: Chris Jerdonek @ 2020-03-01  2:08 UTC (permalink / raw)
  To: git

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-01  2:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-01  2:08 feature suggestion: git symbolic-ref --create-reflog Chris Jerdonek

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