git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Philip Oakley" <philipoakley@iee.org>
To: "Junio C Hamano" <gitster@pobox.com>,
	"Chris Rorvick" <chris@rorvick.com>
Cc: "Git List" <git@vger.kernel.org>,
	"Andrew Ardill" <andrew.ardill@gmail.com>,
	"Tomas Carnecky" <tomas.carnecky@gmail.com>,
	"Woody Wu" <narkewoody@gmail.com>
Subject: Re: [PATCH 1/2] Documentation/git-checkout.txt: clarify usage
Date: Mon, 17 Dec 2012 20:51:32 -0000	[thread overview]
Message-ID: <17103971665F4C4495C6C96086A58B8F@PhilipOakley> (raw)
In-Reply-To: 7vhanlnnz7.fsf@alter.siamese.dyndns.org

From: "Junio C Hamano" <gitster@pobox.com> Sent: Monday, December 17,
2012 7:21 AM
> Chris Rorvick <chris@rorvick.com> writes:
>
>> The forms of checkout that do not take a path are lumped together in
>> the
>> DESCRIPTION section, but the description for this group is dominated
>> by
>> explanation of the -b|-B form.  Split these apart for more clarity.
>>
>> Signed-off-by: Chris Rorvick <chris@rorvick.com>
>> ---
>>  Documentation/git-checkout.txt | 26 +++++++++++++++++---------
>>  1 file changed, 17 insertions(+), 9 deletions(-)
>>
>> diff --git a/Documentation/git-checkout.txt
>> b/Documentation/git-checkout.txt
>> index 7958a47..a47555c 100644
>> --- a/Documentation/git-checkout.txt
>> +++ b/Documentation/git-checkout.txt
>> @@ -22,17 +22,18 @@ also update `HEAD` to set the specified branch as
>> the current
>>  branch.
>>
>>  'git checkout' [<branch>]::
>> +
>> + Update the index, working tree, and HEAD to reflect the
>> + specified branch.
>
> This is to "check out the branch" ;-)
>
> But of course, we cannot define "checkout" in terms of "checkout",
> so we need to phrase it without saying "checkout" and explain what
> it *means* to check out the branch.
>
> I am not sure "Reflect" is a good word.  Making the result similar
> to the branch is only one aspect of the act of checking out the
> branch. The other equally important aspect is that this is done to
> advance the history of the branch.
>
> Perhaps...
>
> Prepare to work on building new history on <branch>, by
> pointing the HEAD to the branch and updating the index and
> the files in the working tree.  Local modifications to the
> files in the working tree are kept, so that they can be
> committed on the <branch>.

>From a user perspective it's better to refer to the working directory
first rather than the internal mechanics. Perhaps:

    Prepare to work on <branch>, by updating the files in the
    working tree and index to the branch's previous content, and
    pointing HEAD to it.

    Local modifications to the files in the working tree are kept,
    so that they can be committed on the <branch>.

>
>>  'git checkout' -b|-B <new_branch> [<start point>]::
>>
>> + Specifying `-b` causes a new branch to be created as if
>> + linkgit:git-branch[1] were called and then checked out.  In
>> + this case you can use the `--track` or `--no-track` options,
>> + which will be passed to 'git branch'.  As a convenience,
>> + `--track` without `-b` implies branch creation; see the
>> + description of `--track` below.
>>  +
>>  If `-B` is given, <new_branch> is created if it doesn't exist;
>> otherwise, it
>>  is reset. This is the transactional equivalent of
>> @@ -45,6 +46,13 @@ $ git checkout <branch>
>>  that is to say, the branch is not reset/created unless "git
>> checkout" is
>>  successful.
>>
>> +'git checkout' [--detach] [<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 building new history on top of <commit>,
>        by detaching HEAD at the commit and ...(likewise)...

  parent reply	other threads:[~2012-12-17 20:51 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 [this message]
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
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=17103971665F4C4495C6C96086A58B8F@PhilipOakley \
    --to=philipoakley@iee.org \
    --cc=andrew.ardill@gmail.com \
    --cc=chris@rorvick.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=narkewoody@gmail.com \
    --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.
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).