git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Chris Jerdonek <chris.jerdonek@gmail.com>
To: git@vger.kernel.org
Subject: feature suggestion: git symbolic-ref --create-reflog
Date: Sat, 29 Feb 2020 18:08:24 -0800	[thread overview]
Message-ID: <CAOTb1wcJyQchyGqTqY6B+j94Tw6Htp7tB4Bt-J7pyXBC7q-XCg@mail.gmail.com> (raw)

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/

                 reply	other threads:[~2020-03-01  2:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAOTb1wcJyQchyGqTqY6B+j94Tw6Htp7tB4Bt-J7pyXBC7q-XCg@mail.gmail.com \
    --to=chris.jerdonek@gmail.com \
    --cc=git@vger.kernel.org \
    /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).