git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Chris Jerdonek <chris.jerdonek@gmail.com>
To: Jeff King <peff@peff.net>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: create reflog for reflog-less ref
Date: Tue, 25 Feb 2020 23:18:39 -0800	[thread overview]
Message-ID: <CAOTb1wfWtFsy415k+goRiuLUiVBqtizmmoyxqFdy7xsRhjnBww@mail.gmail.com> (raw)
In-Reply-To: <20200226034731.GA2915944@coredump.intra.peff.net>

On Tue, Feb 25, 2020 at 7:47 PM Jeff King <peff@peff.net> wrote:
> On Wed, Feb 26, 2020 at 02:39:09AM +0000, brian m. carlson wrote:
> > There is the option core.logAllRefUpdates, which has the value "always"
> > in more modern versions of Git.  The documentation says,
> > ...
> The current rule is actually to append to any reflog that already
> exists, or to consult core.logAllRefUpdates when deciding whether to
> create one that doesn't exist. So I think setting a one-shot config
> variable like:
>
>   git -c core.logAllRefUpdates=always update-ref refs/foo/bar ...

Thanks for the suggestions both of you. I didn't know about "always."
It looks like it was added in 2.12.0:
https://github.com/git/git/blob/master/Documentation/RelNotes/2.12.0.txt#L129

After experimenting a bit more, I seem to be finding that--

* The "one-shot" `-c core.logAllRefUpdates=always` approach only seems
to work with git-update-ref if you're *changing* the SHA with
update-ref, and
* Passing `--create-reflog` also seems to work like the one-shot
config approach (again, as long as you're changing the SHA).

I feel like these options are still wanting.. If you want to add a
missing reflog without changing the ref, these approaches still seem
to require you to temporarily change it to something different (as did
the delete-create approach I stated in my first email). 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..

--Chris

>
> would create the reflog, and then any subsequent updates (even without
> that config set) would append to it.

  reply	other threads:[~2020-02-26  7:18 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 [this message]
2020-02-26  9:47       ` Jeff King
2020-02-26 10:21         ` Chris Jerdonek
2020-02-26 18:40           ` Jeff King

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=CAOTb1wfWtFsy415k+goRiuLUiVBqtizmmoyxqFdy7xsRhjnBww@mail.gmail.com \
    --to=chris.jerdonek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --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).