All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	"Andres G. Aragoneses" <knocte@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] git-checkout.txt: Document "git checkout <pathspec>" better
Date: Wed, 17 Jun 2015 12:58:06 -0700	[thread overview]
Message-ID: <xmqq8ubi6rap.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5581CAA6.5080306@web.de> ("Torsten Bögershausen"'s message of "Wed, 17 Jun 2015 21:29:42 +0200")

Torsten Bögershausen <tboegi@web.de> writes:

> On 2015-06-17 21.23, Junio C Hamano wrote:
> []
>>> Basically, I'm fine with anything starting with "Switch branches or",
>>> but please do change the headline ;-).
>> 
>> Likewise; I agree "switch branches or" part is good.
>
> How about this:
>
> git-checkout - Switch branches or restore changes to the working tree

Gahh.  We are NOT restoring CHANGES.  We are restoring the whole
contents to a path.

It is perfectly fine to do this:

	git reset --hard
        git checkout HEAD^ hello.c

There is no changes in hello.c after "reset --hard".

This is what makes it tempting for me to say "check out (an existing
contents to) a working tree file".

Moreover, it does not matter if the target file is changed or not in
the first place, so your added text:

>> 'git checkout' with <paths> or `--patch` is used to restore modified or
>> deleted paths to their original contents from the index or replace paths
>> with the contents from a named <tree-ish> (most often a commit-ish).

that says "restoring modified or deleted is from the index,
replacing is from a tree-ish" is placing a stress on a wrong spot, I
would think.

"Checkout individual files" is to "replace contents with existing
versions, taken either from the index or from a named tree-ish."
That is done in preparation to come up with the suitable contents
for specified paths.

This is a tangent, but on the other hand, "checkout a whole branch"
is to prepare the working tree to be used to modify the specified
branch.  And that is why the word "checkout" makes sense for both
operations.

  reply	other threads:[~2015-06-17 19:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17  7:54 [PATCH v2] git-checkout.txt: Document "git checkout <pathspec>" better Torsten Bögershausen
2015-06-17  9:58 ` Duy Nguyen
2015-06-17 10:54   ` Matthieu Moy
2015-06-17 11:47     ` Andres G. Aragoneses
2015-06-17 11:54       ` Matthieu Moy
2015-06-17 11:56         ` Andres G. Aragoneses
2015-06-17 12:17           ` Matthieu Moy
2015-06-17 15:29             ` Junio C Hamano
2015-06-17 16:12               ` Torsten Bögershausen
2015-06-17 16:19               ` Junio C Hamano
2015-06-17 16:43                 ` Torsten Bögershausen
2015-06-17 17:24                   ` Matthieu Moy
2015-06-17 17:53                     ` Andres G. Aragoneses
2015-06-17 19:24                       ` Junio C Hamano
2015-06-17 19:23                     ` Junio C Hamano
2015-06-17 19:29                       ` Torsten Bögershausen
2015-06-17 19:58                         ` Junio C Hamano [this message]
2015-06-18  0:37                           ` Duy Nguyen
2015-06-18  1:07                             ` Junio C Hamano
2015-06-18  7:00                       ` Matthieu Moy

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=xmqq8ubi6rap.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=knocte@gmail.com \
    --cc=tboegi@web.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.