git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A few questions about git-reset's reflog messages
@ 2011-07-21 19:28 Ori Avtalion
  2011-07-22 16:12 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Ori Avtalion @ 2011-07-21 19:28 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-22 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21 19:28 A few questions about git-reset's reflog messages Ori Avtalion
2011-07-22 16:12 ` Jeff King
2011-07-22 20:57   ` Junio C Hamano

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