From: Mike Hommey <mh@glandium.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jari Aalto <jari.aalto@cante.net>, git@vger.kernel.org
Subject: Re: [PATCH] Documentation/git-reset.txt: Use HEAD~N syntax everywhere (unify examples)
Date: Sat, 2 Feb 2008 09:44:06 +0100 [thread overview]
Message-ID: <20080202084406.GA15305@glandium.org> (raw)
In-Reply-To: <7v7iho6p2m.fsf@gitster.siamese.dyndns.org>
On Fri, Feb 01, 2008 at 06:59:29PM -0800, Junio C Hamano wrote:
> Jari Aalto <jari.aalto@cante.net> writes:
>
> > The examples in the documentation refer to multiple ~N commits. To
> > Keep the exampels unified with the same syntax, use ~N in all examples.
> >
> > Signed-off-by: Jari Aalto <jari.aalto AT cante.net>
>
> > -$ git reset --soft HEAD^ <1>
> > +$ git reset --soft HEAD~1 <1>
> > -<1> The last three commits (HEAD, HEAD^, and HEAD~2) were bad
> > +<1> The last three commits (HEAD, HEAD~1, and HEAD~2) were bad
> > -$ git reset --soft HEAD^ ;# go back to WIP state <2>
> > +$ git reset --soft HEAD~1 ;# go back to WIP state <2>
>
> I personally think this is a regression, not an improvement.
>
> People need to refer to the HEAD^ (one commit ago) much more
> often than HEAD~N for larger values of N. And we should give
> them exposure to HEAD^ and HEAD^^; both are faster and easier to
> type and read than HEAD~1 and HEAD~2.
>
> Especially about HEAD~1, nobody sane would type that. It is
> there only for consistency.
>
> Otherwise, twisted people would complain "I can say HEAD~4
> instead of HEAD^^^^ and it helps brevity; but it is inconsistent
> that I cannot say HEAD~1 instead of HEAD^".
I wonder if it wouldn't make sense to have ^ described with ^1 ^2, and
add the possibility to also have ~, which would have the same meaning by
side effect, described with ~1 ~2, etc.
The problem with ^ being described with ~1 ~2 is that it makes things
harder to understand than they actually are. The real problem being that
^ sounds like having different meanings depending whether it's followed
by a number or not.
Mike
next prev parent reply other threads:[~2008-02-02 8:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-02 1:41 [PATCH] Documentation/git-reset.txt: Use HEAD~N syntax everywhere (unify examples) Jari Aalto
2008-02-02 2:37 ` Johannes Schindelin
2008-02-02 2:59 ` Junio C Hamano
2008-02-02 8:44 ` Mike Hommey [this message]
2008-02-02 12:59 ` Jari Aalto
2008-02-02 13:37 ` Jakub Narebski
2008-02-02 20:10 ` Jari Aalto
2008-02-03 2:07 ` Johannes Schindelin
2008-02-02 16:18 ` J. Bruce Fields
2008-02-02 20:15 ` Jari Aalto
2008-02-02 22:39 ` Robin Rosenberg
2008-02-02 21:31 ` Junio C Hamano
2008-02-03 19:30 ` Dmitry Potapov
2008-02-03 23:48 ` Jari Aalto
2008-02-04 0:28 ` Jakub Narebski
2008-02-04 22:33 ` Dmitry Potapov
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=20080202084406.GA15305@glandium.org \
--to=mh@glandium.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jari.aalto@cante.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.
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).