{"thread":{"id":"18755","subject":"[PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given.","startedAt":"2009-04-06T20:45:21Z","lastAt":"2009-04-07T12:43:53Z","messageCount":6,"participants":["Matthieu Moy","Junio C Hamano","Mike Ralphson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"110628","messageId":"1239050722-1227-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"18755","inReplyTo":null,"subject":"[PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-04-06T20:45:21Z","receivedAt":"2009-04-06T20:45:21Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The command \"git checkout\" checks out from the index by default, not\nHEAD (the introducing comment were correct, but the detailled\nexplanation added below were not).\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git-checkout.txt |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex 1a6c19e..0b5485b 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -191,7 +191,7 @@ $ git checkout hello.c            <3>\n +\n <1> switch branch\n <2> take a file out of another commit\n-<3> restore hello.c from HEAD of current branch\n+<3> restore hello.c from the index\n +\n If you have an unfortunate branch that is named `hello.c`, this\n step would be confused as an instruction to switch to that branch.\n-- \n1.6.2.1.427.g061ea\n"},{"id":"110627","messageId":"1239050722-1227-2-git-send-email-Matthieu.Moy@imag.fr","threadId":"18755","inReplyTo":"1239050722-1227-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-04-06T20:45:22Z","receivedAt":"2009-04-06T20:45:22Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Otherwise, the sentence \"Defaults to HEAD.\" can be mis-read to mean\nthat \"git checkout -- hello.c\" checks-out from HEAD.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n\nThis may be a bit too verbose, but I've been biten by this (reading\nthe doc not carrefully enough, I really thought git checkout would\ntake HEAD, then I thought it was actually a documentation bug, and\nthen I realized I miss-read). This patch would have saved me time. But\nif other disagree, I won't fight ;-).\n\n Documentation/git-checkout.txt |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex 0b5485b..58bf508 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -126,9 +126,14 @@ the conflicted merge in the specified paths.\n <new_branch>::\n \tName for the new branch.\n \n+<tree-ish>::\n+\tTree to checkout from (when path are given). If not specified,\n+\tthe index will be used.\n+\n <branch>::\n-\tBranch to checkout; may be any object ID that resolves to a\n-\tcommit.  Defaults to HEAD.\n+\tBranch to checkout (when no path are given); may be any object\n+\tID that resolves to a commit.  Defaults to HEAD.\n+\n +\n When this parameter names a non-branch (but still a valid commit object),\n your HEAD becomes 'detached'.\n-- \n1.6.2.1.427.g061ea\n"},{"id":"110646","messageId":"7v4ox146f3.fsf@gitster.siamese.dyndns.org","threadId":"18755","inReplyTo":"1239050722-1227-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 1/2] git-checkout.txt: fix incorrect statement about HEAD and index","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-07T01:08:16Z","receivedAt":"2009-04-07T01:08:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  Both patches look good.\n"},{"id":"110689","messageId":"e2b179460904070241y493ef876xc628d35b606e4032@mail.gmail.com","threadId":"18755","inReplyTo":"1239050722-1227-2-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 2/2] git-checkout.txt: clarify that <branch> applies when no path is given.","fromName":"Mike Ralphson","fromEmail":"mike.ralphson@gmail.com","sentAt":"2009-04-07T09:41:40Z","receivedAt":"2009-04-07T09:41:40Z","isPatch":true,"sender":{"key":"mike.ralphson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/21603?v=4"},"body":"2009/4/6 Matthieu Moy <Matthieu.Moy@imag.fr>:\n> Otherwise, the sentence \"Defaults to HEAD.\" can be mis-read to mean\n> that \"git checkout -- hello.c\" checks-out from HEAD.\n\n> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\n> index 0b5485b..58bf508 100644\n> --- a/Documentation/git-checkout.txt\n> +++ b/Documentation/git-checkout.txt\n> @@ -126,9 +126,14 @@ the conflicted merge in the specified paths.\n>  <new_branch>::\n>        Name for the new branch.\n>\n> +<tree-ish>::\n> +       Tree to checkout from (when path are given). If not specified,\n> +       the index will be used.\n> +\n>  <branch>::\n> -       Branch to checkout; may be any object ID that resolves to a\n> -       commit.  Defaults to HEAD.\n> +       Branch to checkout (when no path are given); may be any object\n> +       ID that resolves to a commit.  Defaults to HEAD.\n> +\n\ns/path are/paths are/g\n\nSorry if I come across as picking on your grammar, I think your\ndocumentation improvements are very worthwhile.\n\nMike\n"},{"id":"110693","messageId":"1239099643-11959-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"18755","inReplyTo":"e2b179460904070241y493ef876xc628d35b606e4032@mail.gmail.com","subject":"[PATCH 1/2] git-checkout.txt: clarify that <branch> applies when no path is given.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-04-07T10:20:43Z","receivedAt":"2009-04-07T10:20:43Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Otherwise, the sentence \"Defaults to HEAD.\" can be mis-read to mean\nthat \"git checkout -- hello.c\" checks-out from HEAD.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n> s/path are/paths are/g\n\nRight.\n\nI'm not 100% sure about \"no paths are given\" Vs \"no path is given\",\nbut my understanding of english grammar is that since there could have\nbeen several paths, the absence of path is still plural (French would\nbe singular here).\n\n> Sorry if I come across as picking on your grammar, I think your\n> documentation improvements are very worthwhile.\n\nNo harm ;-).\n\n Documentation/git-checkout.txt |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex 0b5485b..7eafcdf 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -126,9 +126,14 @@ the conflicted merge in the specified paths.\n <new_branch>::\n \tName for the new branch.\n \n+<tree-ish>::\n+\tTree to checkout from (when paths are given). If not specified,\n+\tthe index will be used.\n+\n <branch>::\n-\tBranch to checkout; may be any object ID that resolves to a\n-\tcommit.  Defaults to HEAD.\n+\tBranch to checkout (when no paths are given); may be any object\n+\tID that resolves to a commit.  Defaults to HEAD.\n+\n +\n When this parameter names a non-branch (but still a valid commit object),\n your HEAD becomes 'detached'.\n-- \n1.6.2.2.449.g92961.dirty\n"},{"id":"110702","messageId":"1239108233-20924-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"18755","inReplyTo":"1239099643-11959-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2] git-checkout.txt: clarify that <branch> applies when no path is given.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-04-07T12:43:53Z","receivedAt":"2009-04-07T12:43:53Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Otherwise, the sentence \"Defaults to HEAD.\" can be mis-read to mean\nthat \"git checkout -- hello.c\" checks-out from HEAD.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nSorry, patch v1 was introducing a spurious newline, which broke\nasciidoc syntax. This fixes it, but Junio, if you already applied v1,\njust remove the empty line after <branch>:: and before +.\n\n Documentation/git-checkout.txt |    8 ++++++--\n 1 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex 0b5485b..223ea9c 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -126,9 +126,13 @@ the conflicted merge in the specified paths.\n <new_branch>::\n \tName for the new branch.\n \n+<tree-ish>::\n+\tTree to checkout from (when paths are given). If not specified,\n+\tthe index will be used.\n+\n <branch>::\n-\tBranch to checkout; may be any object ID that resolves to a\n-\tcommit.  Defaults to HEAD.\n+\tBranch to checkout (when no paths are given); may be any object\n+\tID that resolves to a commit.  Defaults to HEAD.\n +\n When this parameter names a non-branch (but still a valid commit object),\n your HEAD becomes 'detached'.\n-- \n1.6.2.2.449.g92961.dirty\n"}]}