git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: "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 18:43:15 +0200	[thread overview]
Message-ID: <5581A3A3.1070908@web.de> (raw)
In-Reply-To: <xmqqd20u48at.fsf@gitster.dls.corp.google.com>

On 2015-06-17 18.19, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>>
>>> Yes, but "Switch branchs or discard local changes" still does not
>>> describe "git checkout HEAD^^^ -- file.txt" (restore to an old state,
>>> but does not switch branch) or "git checkout -- file.txt" (get from the
>>> index).
>>
>> You are right, especially when file.txt does not have any change
>> relative to HEAD, there is no "discarding" going on.  You are
>> actively introducing a change to an unchanged file by checking
>> contents out of a different revision.
>>
>>> To me, "discard local changes" imply that there will be no uncommited
>>> changes on the files implied in the command after the operation.
>>
>> Yup.
> 
> What was discussed in this thread sounded suspiciously familiar ;-).
> 
> Unfortunately "overwrite changes in the working tree" and "discard
> local changes" are equally bad.  As it does not say overwrite with
> what, we invite the original confusion that triggered these threads
> if the reader thought an equally useful but different "overwrites
> with result of merging your local changes to the pristine" (similar
> to what "checkout -m" does) would happen.
> 
> At least, "restore working tree files" without saying "restoring
> them to what state?" is much less likely to cause such a confusion.
> 
> So perhaps
> 
>     git-checkout - Switch branches or restore working tree files
> 
> in the headline, and then explain "restore to what state" in the
> description?
I'm not sure if the "restore" is always the right thing to describe:
'git checkout <commit> -- <path>'
will "copy" the version from another commit into the workspace.

My v3 will probably use the original line:
git-checkout - Checkout a branch or paths to the working tree

(and improve the description)

git-checkout - Checkout a branch or paths to the working tree

  reply	other threads:[~2015-06-17 16:43 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 [this message]
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
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=5581A3A3.1070908@web.de \
    --to=tboegi@web.de \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=knocte@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).