From: Ori Avtalion <ori@avtalion.name>
To: git@vger.kernel.org
Subject: A few questions about git-reset's reflog messages
Date: Thu, 21 Jul 2011 22:28:30 +0300 [thread overview]
Message-ID: <4E287DDE.8020108@avtalion.name> (raw)
Hi,
I noticed an inconsistency with the reset command's reflog messages.
The command:
g reset <tree-ish>
Prints this reflog message:
<tree-ish>: updating HEAD
Usually, actual lines from "git reflog" are:
640a027 HEAD@{0}: HEAD~1: updating HEAD
0657539 HEAD@{1}: 0657539: updating HEAD
This feels redundant and not very informative.
Is there any reason to print the tree-ish in the command? The 'raw' sha1
is already recorded in the reflog.
Why does the message not mention 'reset' in the beginning like (most?)
other commands?
I dug into builtin/reset.c to try and improve it, and came across a few
odd things, that I'd appreciate if someone would clarify:
* There is code to set a "updating ORIG_HEAD" reflog message, but I
can't trigger it. What use-case causes it?
* The part of the reflog message before the colon is composed by
args_to_str() which prints all of the arguments after the opts. This
seems redundant as the only form of 'reset' that updates the reflog is
one with a single '<commit>' argument after the options. What is there
for args_to_str to loop over?
Thanks,
Ori
next reply other threads:[~2011-07-21 19:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-21 19:28 Ori Avtalion [this message]
2011-07-22 16:12 ` A few questions about git-reset's reflog messages Jeff King
2011-07-22 20:57 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E287DDE.8020108@avtalion.name \
--to=ori@avtalion.name \
--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.
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 NNTP newsgroup(s).