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

Subsystems: documentation, the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Jari Aalto <hidden>
Date: 2016-06-15 22:44:09

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>
---
 Documentation/git-reset.txt |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index a4e0a77..0566956 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -58,7 +58,7 @@ Undo a commit and redo::
 +
 ------------
 $ git commit ...
-$ git reset --soft HEAD^      <1>
+$ git reset --soft HEAD~1     <1>
 $ edit                        <2>
 $ git commit -a -c ORIG_HEAD  <3>
 ------------
@@ -80,7 +80,7 @@ $ git commit ...
 $ git reset --hard HEAD~3   <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
 and you do not want to ever see them again.  Do *not* do this if
 you have already given these commits to somebody else.
 
@@ -165,7 +165,7 @@ $ git checkout master
 $ fix fix fix
 $ git commit ;# commit with real log
 $ git checkout feature
-$ git reset --soft HEAD^ ;# go back to WIP state  <2>
+$ git reset --soft HEAD~1 ;# go back to WIP state <2>
 $ git reset                                       <3>
 ------------
 +
-- 
1.5.4-rc5.GIT-dirty



-- 
Welcome to FOSS revolution: we fix and modify until it shines

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:09

Hi,

On Sat, 2 Feb 2008, Jari Aalto wrote:
The examples in the documentation refer to multiple ~N commits. To Keep 
the exampels unified with the same syntax, use ~N in all examples.
AFAIR it was already shot down.  Personally, I think it is not expecting 
too much of people to have the ambiguity between ~1 and ^1.  Even worse, 
if you hide the ^-syntax from new users, they will be puzzled how to 
access the different parents of merge commits.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help