git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Chris Rorvick <chris@rorvick.com>,
	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 11:12:16 -0800	[thread overview]
Message-ID: <7vbodsmr1r.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <50CEDF0A.7040603@viscovery.net> (Johannes Sixt's message of "Mon, 17 Dec 2012 09:59:54 +0100")

Johannes Sixt <j.sixt@viscovery.net> writes:

> Am 12/17/2012 9:48, schrieb Junio C Hamano:
>> Here is what I tentatively have ...
>
> Thanks!
>
>> -'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 building new history on top of <commit>,
>> +	by detaching HEAD at the commit (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 they can be committed on the
>> +	<branch>.
>
> The last half-sentence should better be removed.

True; we do not have a particular "on the <branch>" in this state.
At least, "on the <branch>" needs to be removed.  But I think we may
want a more different wording here, including the earlier "work on
building new history on top of" part.

The detached HEAD state primarily is a sightseeing mode, where the
user is expected to view but not touch.  Even for experienced users,
commits on a detached HEAD are for keeping snapshots of interim
states during a throw-away experiment, so the purpose of detaching
is not exactly "to work on *building* new history" in the first
place.

Carefree experimentation is encouraged by not forbidding commmits
from this state, with the expectation that:

 (1) if it does not lead to interesting result, another "git
     checkout <branch>" will wipe the throw-away experiment without
     affecting any of your more important branches; and

 (2) an experiment that yielded something useful can be further
     polished on a concrete branch by "git checkout -b <newbranch>".

I think the above discussion on detached HEAD can be added to its
own section.

	Prepare to work on top of <commit>, by detaching HEAD at it
	(see "DETACHED HEAD" section), and updating te 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.

Or something, perhaps?

  reply	other threads:[~2012-12-17 19:12 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 [this message]
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
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=7vbodsmr1r.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=andrew.ardill@gmail.com \
    --cc=chris@rorvick.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --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).