git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Rorvick <chris@rorvick.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Andrew Ardill <andrew.ardill@gmail.com>,
	Philip Oakley <philipoakley@iee.org>,
	Git List <git@vger.kernel.org>,
	Tomas Carnecky <tomas.carnecky@gmail.com>,
	Woody Wu <narkewoody@gmail.com>,
	Johannes Sixt <j.sixt@viscovery.net>
Subject: Re: [PATCH 1/2] Documentation/git-checkout.txt: clarify usage
Date: Mon, 17 Dec 2012 21:33:09 -0600	[thread overview]
Message-ID: <CAEUsAPa1XMeymEXbLu=iy8VTdLO=iPUeVN3QPH+FbQecL8XnsA@mail.gmail.com> (raw)
In-Reply-To: <7vvcc0i0rz.fsf@alter.siamese.dyndns.org>

On Mon, Dec 17, 2012 at 7:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Here is a work-in-progress relative to Chris's 83c9989
> (Documentation/git-checkout.txt: document 70c9ac2 behavior,
> 2012-12-17).

It sounds pretty good to me.

> @@ -54,12 +61,17 @@ $ git checkout <branch>
>  that is to say, the branch is not reset/created unless "git checkout" is
>  successful.
>
> -'git checkout' [--detach] [<commit>]::
> +'git checkout' --detach [<commit>]::
> +'git checkout' <commit>::
>
> -       Update the index and working tree to reflect the specified
> -       commit and set HEAD to point directly to <commit> (see
> -       "DETACHED HEAD" section.)  Passing `--detach` forces this
> -       behavior even if <commit> is a branch.
> +       Prepare to work on top of <commit>, by detaching HEAD at it
> +       (see "DETACHED HEAD" section), and updating the index and the
> +       files in the working tree.  Local modifications to the files
> +       in the working tree are kept, so that the resulting working
> +       tree will be the state recorded in the commit plus the local
> +       modifications.
> ++
> +Passing `--detach` forces this behavior even if <commit> is a branch.
>
>  'git checkout' [-p|--patch] [<tree-ish>] [--] <pathspec>...::
>

I like Johannes' suggestion of using "<branch>" in the --detach case
instead of "<commit>" as I think it makes the reason for the
separation more obvious at a glance.  On top of your changes, maybe
something like:

--->8---
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index dcf1a32..4fdf41a 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -61,8 +61,8 @@ $ git checkout <branch>
 that is to say, the branch is not reset/created unless "git checkout" is
 successful.

-'git checkout' --detach [<commit>]::
 'git checkout' <commit>::
+'git checkout' --detach [<branch>]::

        Prepare to work on top of <commit>, by detaching HEAD at it
        (see "DETACHED HEAD" section), and updating the index and the
@@ -71,7 +71,8 @@ successful.
        tree will be the state recorded in the commit plus the local
        modifications.
 +
-Passing `--detach` forces this behavior even if <commit> is a branch.
+Passing `--detach` forces this behavior in the case of a <branch>, or
+the current branch if one is not specified.

 'git checkout' [-p|--patch] [<tree-ish>] [--] <pathspec>...::

  parent reply	other threads:[~2012-12-18  3:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17  6:45 [PATCH 0/2] Documentation: clarify usage of checkout Chris Rorvick
2012-12-17  6:45 ` [PATCH 1/2] Documentation/git-checkout.txt: clarify usage Chris Rorvick
2012-12-17  7:21   ` Junio C Hamano
2012-12-17  8:20     ` Johannes Sixt
2012-12-17  8:48       ` Junio C Hamano
2012-12-17  8:59         ` Johannes Sixt
2012-12-17 19:12           ` Junio C Hamano
2012-12-17  8:53       ` Andrew Ardill
2012-12-18  2:55       ` Chris Rorvick
2012-12-17 20:51     ` Philip Oakley
2012-12-17 21:13       ` Junio C Hamano
2012-12-17 21:50         ` Andrew Ardill
2012-12-17 21:59           ` Junio C Hamano
2012-12-18  1:29             ` Andrew Ardill
2012-12-18  1:53             ` Junio C Hamano
2012-12-18  2:12               ` Andrew Ardill
2012-12-18  3:33               ` Chris Rorvick [this message]
2012-12-18 16:43                 ` Junio C Hamano
2012-12-17 22:40         ` Philip Oakley
2012-12-17  6:45 ` [PATCH 2/2] Documentation/git-checkout.txt: document 70c9ac2 behavior Chris Rorvick
2012-12-17  7:21   ` Junio C Hamano
2012-12-17  7:23     ` Andrew Ardill
2012-12-17  7:26       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEUsAPa1XMeymEXbLu=iy8VTdLO=iPUeVN3QPH+FbQecL8XnsA@mail.gmail.com' \
    --to=chris@rorvick.com \
    --cc=andrew.ardill@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=narkewoody@gmail.com \
    --cc=philipoakley@iee.org \
    --cc=tomas.carnecky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).