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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jari Aalto <jari.aalto@...>
Cc: <git@...>, Mike Hommey <mh@...>, Junio C Hamano <gitster@...>, Jakub Narebski <jnareb@...>, Johannes Schindelin <Johannes.Schindelin@...>
Date: Saturday, February 2, 2008 - 9:37 am

Jari Aalto <jari.aalto@cante.net> writes:


I think that focusing on the fact that "HEAD^1" is peel-like operator,
selecting first parent of HEAD, That "HEAD^" is a shortcut for that,
and that "HEAD~3" is a shortcut for "HEAD^^^" similarly to how "3 * 2"
is a shortcut for "2 + 2 + 2" is better solution. "HEAD~1" and
"HEAD~2" are not shorter than original notation.
 

The documentation should cater to both advanced users and newcomers,
unless it is specifically targeted towards newcomers like different
intro documentation, or first part of Git User's Manual.


IMHO the sequence: 
  "HEAD^1"     -> "HEAD^", 
  "HEAD^1^1^1" -> "HEAD^^^" -> "HEAD~3"
is the proper sequence to teach.

Especially that "rev^sth" is used also for other things, like
"HEAD^{tree}", or "v1.3.0^{commit}" peeling operators, or even
"master^0" used to force detach HEAD to 'master'.


This is stupid example. Numbering revisions is possible only in
centralized SCMs, or semi-centralized SCMs (with one repository given
special, central position). You need an authority to assign sequential
numbers to revisions.

Besides git uses the same notation, <rev1>..<rev2>, only it doesn't
need '-r' option to select revision or revision range.


It is also much less powerfull, as it can only follow first-parent
line. In the presence of merges you usually use ^n more.


That said, I personally don't have strong preference whether to use
"HEAD", "HEAD^", "HEAD^^", "HEAD~3" in examples, or "HEAD", "HEAD~1",
"HEAD~2", "HEAD~3". It is a bit of "bikeshed" discussion.

-- 
Jakub Narebski

  In related news: there is really no question that bike sheds should
  be painted red. Really. (Johannes Schindelin)
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Documentation/git-reset.txt: Use HEAD~N syntax e..., Jakub Narebski, (Sat Feb 2, 9:37 am)