git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index
@ 2009-04-06 20:45 Matthieu Moy
  2009-04-06 20:45 ` [PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given Matthieu Moy
  2009-04-07  1:08 ` [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Matthieu Moy @ 2009-04-06 20:45 UTC (permalink / raw)
  To: gitster, git; +Cc: Matthieu Moy

The command "git checkout" checks out from the index by default, not
HEAD (the introducing comment were correct, but the detailled
explanation added below were not).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 Documentation/git-checkout.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 1a6c19e..0b5485b 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -191,7 +191,7 @@ $ git checkout hello.c            <3>
 +
 <1> switch branch
 <2> take a file out of another commit
-<3> restore hello.c from HEAD of current branch
+<3> restore hello.c from the index
 +
 If you have an unfortunate branch that is named `hello.c`, this
 step would be confused as an instruction to switch to that branch.
-- 
1.6.2.1.427.g061ea

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given.
  2009-04-06 20:45 [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index Matthieu Moy
@ 2009-04-06 20:45 ` Matthieu Moy
  2009-04-07  9:41   ` Mike Ralphson
  2009-04-07  1:08 ` [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Matthieu Moy @ 2009-04-06 20:45 UTC (permalink / raw)
  To: gitster, git; +Cc: Matthieu Moy

Otherwise, the sentence "Defaults to HEAD." can be mis-read to mean
that "git checkout -- hello.c" checks-out from HEAD.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---

This may be a bit too verbose, but I've been biten by this (reading
the doc not carrefully enough, I really thought git checkout would
take HEAD, then I thought it was actually a documentation bug, and
then I realized I miss-read). This patch would have saved me time. But
if other disagree, I won't fight ;-).

 Documentation/git-checkout.txt |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 0b5485b..58bf508 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -126,9 +126,14 @@ the conflicted merge in the specified paths.
 <new_branch>::
 	Name for the new branch.
 
+<tree-ish>::
+	Tree to checkout from (when path are given). If not specified,
+	the index will be used.
+
 <branch>::
-	Branch to checkout; may be any object ID that resolves to a
-	commit.  Defaults to HEAD.
+	Branch to checkout (when no path are given); may be any object
+	ID that resolves to a commit.  Defaults to HEAD.
+
 +
 When this parameter names a non-branch (but still a valid commit object),
 your HEAD becomes 'detached'.
-- 
1.6.2.1.427.g061ea

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index
  2009-04-06 20:45 [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index Matthieu Moy
  2009-04-06 20:45 ` [PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given Matthieu Moy
@ 2009-04-07  1:08 ` Junio C Hamano
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2009-04-07  1:08 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

Thanks.  Both patches look good.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] git-checkout.txt: clarify that <branch> applies when  no path is given.
  2009-04-06 20:45 ` [PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given Matthieu Moy
@ 2009-04-07  9:41   ` Mike Ralphson
  2009-04-07 10:20     ` [PATCH 1/2] " Matthieu Moy
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Ralphson @ 2009-04-07  9:41 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: gitster, git

2009/4/6 Matthieu Moy <Matthieu.Moy@imag.fr>:
> Otherwise, the sentence "Defaults to HEAD." can be mis-read to mean
> that "git checkout -- hello.c" checks-out from HEAD.

> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
> index 0b5485b..58bf508 100644
> --- a/Documentation/git-checkout.txt
> +++ b/Documentation/git-checkout.txt
> @@ -126,9 +126,14 @@ the conflicted merge in the specified paths.
>  <new_branch>::
>        Name for the new branch.
>
> +<tree-ish>::
> +       Tree to checkout from (when path are given). If not specified,
> +       the index will be used.
> +
>  <branch>::
> -       Branch to checkout; may be any object ID that resolves to a
> -       commit.  Defaults to HEAD.
> +       Branch to checkout (when no path are given); may be any object
> +       ID that resolves to a commit.  Defaults to HEAD.
> +

s/path are/paths are/g

Sorry if I come across as picking on your grammar, I think your
documentation improvements are very worthwhile.

Mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] git-checkout.txt: clarify that <branch> applies when no path is given.
  2009-04-07  9:41   ` Mike Ralphson
@ 2009-04-07 10:20     ` Matthieu Moy
  2009-04-07 12:43       ` [PATCH v2] " Matthieu Moy
  0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Moy @ 2009-04-07 10:20 UTC (permalink / raw)
  To: gitster, git; +Cc: Matthieu Moy

Otherwise, the sentence "Defaults to HEAD." can be mis-read to mean
that "git checkout -- hello.c" checks-out from HEAD.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
> s/path are/paths are/g

Right.

I'm not 100% sure about "no paths are given" Vs "no path is given",
but my understanding of english grammar is that since there could have
been several paths, the absence of path is still plural (French would
be singular here).

> Sorry if I come across as picking on your grammar, I think your
> documentation improvements are very worthwhile.

No harm ;-).

 Documentation/git-checkout.txt |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 0b5485b..7eafcdf 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -126,9 +126,14 @@ the conflicted merge in the specified paths.
 <new_branch>::
 	Name for the new branch.
 
+<tree-ish>::
+	Tree to checkout from (when paths are given). If not specified,
+	the index will be used.
+
 <branch>::
-	Branch to checkout; may be any object ID that resolves to a
-	commit.  Defaults to HEAD.
+	Branch to checkout (when no paths are given); may be any object
+	ID that resolves to a commit.  Defaults to HEAD.
+
 +
 When this parameter names a non-branch (but still a valid commit object),
 your HEAD becomes 'detached'.
-- 
1.6.2.2.449.g92961.dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2] git-checkout.txt: clarify that <branch> applies when no path is given.
  2009-04-07 10:20     ` [PATCH 1/2] " Matthieu Moy
@ 2009-04-07 12:43       ` Matthieu Moy
  0 siblings, 0 replies; 6+ messages in thread
From: Matthieu Moy @ 2009-04-07 12:43 UTC (permalink / raw)
  To: gitster, git; +Cc: Matthieu Moy

Otherwise, the sentence "Defaults to HEAD." can be mis-read to mean
that "git checkout -- hello.c" checks-out from HEAD.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Sorry, patch v1 was introducing a spurious newline, which broke
asciidoc syntax. This fixes it, but Junio, if you already applied v1,
just remove the empty line after <branch>:: and before +.

 Documentation/git-checkout.txt |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 0b5485b..223ea9c 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -126,9 +126,13 @@ the conflicted merge in the specified paths.
 <new_branch>::
 	Name for the new branch.
 
+<tree-ish>::
+	Tree to checkout from (when paths are given). If not specified,
+	the index will be used.
+
 <branch>::
-	Branch to checkout; may be any object ID that resolves to a
-	commit.  Defaults to HEAD.
+	Branch to checkout (when no paths are given); may be any object
+	ID that resolves to a commit.  Defaults to HEAD.
 +
 When this parameter names a non-branch (but still a valid commit object),
 your HEAD becomes 'detached'.
-- 
1.6.2.2.449.g92961.dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-07 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-06 20:45 [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index Matthieu Moy
2009-04-06 20:45 ` [PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given Matthieu Moy
2009-04-07  9:41   ` Mike Ralphson
2009-04-07 10:20     ` [PATCH 1/2] " Matthieu Moy
2009-04-07 12:43       ` [PATCH v2] " Matthieu Moy
2009-04-07  1:08 ` [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).