Re: [PATCH] Documentation/git-reset.txt: Use HEAD~N syntax everywhere (unify examples)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jari Aalto <jari.aalto@xxxxxxxxx> 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^".
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux