threads / discuss / 34486

Documentation/git-checkout.txt: Inconsistent naming of paths arguments

Subject: Documentation/git-checkout.txt: Inconsistent naming of paths arguments

## tl;dr

3 messages between Jul 19, 2013 and Jul 19, 2013.

replies: 2people: 3as markdown or json

Adam Brengesjö· Jul 19, 2013, 07:16 UTC · lore
From SYNOPSIS:
git checkout [-p|--patch] [<tree-ish>] [--] [<paths>…]
From DESCRIPTION
git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>…
1. Named <paths> in SYNOPSIS, but <pathspec> in DESCRIPTION. (It's
referred to as <path> in the body text).
2. <paths> is marked as optional in SYNOPSIS, but <pathspec> is not.
I'm not submitting a patch now, as I'm not sure which is correct.
Duy Nguyen· Jul 19, 2013, 07:40 UTC · re: Adam Brengesjö · lore

Re: Documentation/git-checkout.txt: Inconsistent naming of paths arguments

On Fri, Jul 19, 2013 at 2:16 PM, Adam Brengesjö <ca.brengesjo@gmail.com> wrote:
Show 17 quoted lines
> From SYNOPSIS:
>
> git checkout [-p|--patch] [<tree-ish>] [--] [<paths>…]
>
>
> From DESCRIPTION
>
> git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>…
>
>
>
> 1. Named <paths> in SYNOPSIS, but <pathspec> in DESCRIPTION. (It's
> referred to as <path> in the body text).
>
> 2. <paths> is marked as optional in SYNOPSIS, but <pathspec> is not.
>
> I'm not submitting a patch now, as I'm not sure which is correct.

If I'm not mistaken, "git checkout" takes pathspec in all cases. -- Duy

Junio C Hamano· Jul 19, 2013, 14:36 UTC · re: Duy Nguyen · lore

Re: Documentation/git-checkout.txt: Inconsistent naming of paths arguments

Duy Nguyen <pclouds@gmail.com> writes:
Show 20 quoted lines
> On Fri, Jul 19, 2013 at 2:16 PM, Adam Brengesjö <ca.brengesjo@gmail.com> wrote:
>> From SYNOPSIS:
>>
>> git checkout [-p|--patch] [<tree-ish>] [--] [<paths>…]
>>
>>
>> From DESCRIPTION
>>
>> git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>…
>>
>>
>>
>> 1. Named <paths> in SYNOPSIS, but <pathspec> in DESCRIPTION. (It's
>> referred to as <path> in the body text).
>>
>> 2. <paths> is marked as optional in SYNOPSIS, but <pathspec> is not.
>>
>> I'm not submitting a patch now, as I'm not sure which is correct.
>
> If I'm not mistaken, "git checkout" takes pathspec in all cases.
Correct.

And I think -p form (which I do not use myself so please double check) can be run with an empty pathspec.

It looks somewhat idiotic that
	git checkout master
        git checout -p next

will finish on the 'master' branch, with random selected bits of differences for 'master' to go to 'next' applied to the index and the working tree, but that seems to be how it works.

← back to recent threads