* What's the point of saying "HEAD is now at ..."?
@ 2012-09-14 5:14 Junio C Hamano
2012-09-14 10:48 ` Michael J Gruber
0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2012-09-14 5:14 UTC (permalink / raw)
To: git
I sometimes wonder what value the message is giving us.
For example, while reviewing a patch in my Emacs session, I may say
| git am -s3c <RETURN>
which runs the command on the contents of the e-mail I am reading,
to apply the patch. After that, I would go to a separate terminal
and do things like "git show -U20", etc. Once I am done, I reset
the temporary commit away, and get this:
$ git reset --hard HEAD^
HEAD is now at ce5cf6f Merge git://github.com/git-l10n/git-po
or often it is
$ git reset --hard ko/master
HEAD is now at ce5cf6f Merge git://github.com/git-l10n/git-po
In either case, I know where I am resetting to, so "HEAD is now at"
is a less than useful noise. If it contained "HEAD was at ...", it
may let me realize that I was still going to use the contents in
some other way and quickly go back to it with another reset, with
cut and paste or with HEAD@{1}. In either case, showing the tip of
what I just discarded seems to be a lot more useful information than
what we are currently giving the users.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: What's the point of saying "HEAD is now at ..."?
2012-09-14 5:14 What's the point of saying "HEAD is now at ..."? Junio C Hamano
@ 2012-09-14 10:48 ` Michael J Gruber
0 siblings, 0 replies; 2+ messages in thread
From: Michael J Gruber @ 2012-09-14 10:48 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano venit, vidit, dixit 14.09.2012 07:14:
> I sometimes wonder what value the message is giving us.
>
> For example, while reviewing a patch in my Emacs session, I may say
>
> | git am -s3c <RETURN>
>
> which runs the command on the contents of the e-mail I am reading,
> to apply the patch. After that, I would go to a separate terminal
> and do things like "git show -U20", etc. Once I am done, I reset
> the temporary commit away, and get this:
>
> $ git reset --hard HEAD^
> HEAD is now at ce5cf6f Merge git://github.com/git-l10n/git-po
>
> or often it is
>
> $ git reset --hard ko/master
> HEAD is now at ce5cf6f Merge git://github.com/git-l10n/git-po
>
> In either case, I know where I am resetting to, so "HEAD is now at"
> is a less than useful noise. If it contained "HEAD was at ...", it
> may let me realize that I was still going to use the contents in
> some other way and quickly go back to it with another reset, with
> cut and paste or with HEAD@{1}. In either case, showing the tip of
> what I just discarded seems to be a lot more useful information than
> what we are currently giving the users.
>
Unless you use a git aware prompt, it's always good to know where your
HEAD is ;) Just think of:
git reset --hard HEAD^2
HEAD is now at ...
Oh, I meant HEAD~2 aka HEAD^^ ...
In that case, information about HEAD@{1} might be useful but is not
necessary, unless you are leaving behind a detached HEAD.
Cheers,
Michael
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-14 10:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-14 5:14 What's the point of saying "HEAD is now at ..."? Junio C Hamano
2012-09-14 10:48 ` Michael J Gruber
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).