public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Scott Schmit <i.grok@comcast•net>
Cc: "Torsten Bögershausen" <tboegi@web•de>,
	git@vger•kernel.org, eda@waniasset•com,
	"Duy Nguyen" <pclouds@gmail•com>,
	"Eric Sunshine" <sunshine@sunshineco•com>
Subject: Re: [PATCH] git-checkout.txt: Document "git checkout <pathspec>" better
Date: Fri, 12 Jun 2015 09:24:06 -0700	[thread overview]
Message-ID: <xmqqa8w4evyx.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150612044906.GA17424@odin.ulthar.us> (Scott Schmit's message of "Fri, 12 Jun 2015 00:49:06 -0400")

Scott Schmit <i.grok@comcast•net> writes:

> On Wed, Jun 10, 2015 at 08:05:32AM -0700, Junio C Hamano wrote:
>
>> How about this?
>> 
>>         'git checkout' with <paths> or `--patch` is used to restore
>>         modified or deleted paths to their original contents from
>>         the index file or from a named <tree-ish> (most often a
>>         commit) without switching branches.
>
> I think these changes would improve the above:
>
> s/index file/index/
> - index file is implementation; the glossary only defines "index"

Yup, that was sloppy of me.  Thanks.

> s/or from/or replace paths with the contents from/
> - the latter case isn't always restoration, if <tree-ish> doesn't come
>   from an ancestor of HEAD (so I don't like "restore" in the summary
>   either)

Yes, that is why the original said 'checkout' in the first place.

> s/without switching/instead of switching/
> - 'without' implies it makes sense to restore/replace with switching
>   branches, but we've chosen not to.  (I then waste time trying to
>   understand that)

OK.

> s/commit/commit-ish/
> - tags are also tree-ishes, though you could argue this case is less
>   "often"

Correct.

> leaving:
>
> '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)
> instead of switching branches.

Yeah, I like that.  I'd appreciate if somebody can submit the final
version as a patch form after waiting for a few days to hear other's
opinions.

> does a sha1 count as "named"? Maybe s/named //.

The "named" in the original "named tree-ish" does not mean "the
tree-ish has a human readable name (e.g. a tag)"; it merely means
"the user tells Git to use one tree-ish to use for this operation;
and the tree-ish was specified (by some means) by the user", i.e.
the same thing as "specified".  If you specify the tree-ish with its
object name, yes, you are naming that (after all, that is what
everything in sha1-name.c does).

s/a named <tree-ish>/the <tree-ish>/ in the improved text you
proposed above would be sufficient, I would think, as it is clear
which <tree-ish> we are talking about in the context.

Thanks.

  reply	other threads:[~2015-06-12 16:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 20:21 [PATCH] git-checkout.txt: Document "git checkout <pathspec>" better Torsten Bögershausen
2015-06-10 15:05 ` Junio C Hamano
2015-06-10 15:11   ` Ed Avis
2015-06-10 16:38     ` Junio C Hamano
2015-06-11 10:24       ` [PATCH] git-checkout.txt: Document Ed Avis
2015-06-10 18:27   ` [PATCH] git-checkout.txt: Document "git checkout <pathspec>" better Torsten Bögershausen
2015-06-11 14:47     ` Junio C Hamano
2015-06-11 14:52       ` Ed Avis
2015-06-11 18:23         ` Junio C Hamano
2015-06-12  4:49   ` Scott Schmit
2015-06-12 16:24     ` Junio C Hamano [this message]
2015-06-12 20:41     ` Torsten Bögershausen

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=xmqqa8w4evyx.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=eda@waniasset$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=i.grok@comcast$(echo .)net \
    --cc=pclouds@gmail$(echo .)com \
    --cc=sunshine@sunshineco$(echo .)com \
    --cc=tboegi@web$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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