From: Junio C Hamano Date: Fri, 19 Jul 2013 14:36:16 GMT Subject: Re: Documentation/git-checkout.txt: Inconsistent naming of paths arguments Message-ID: <7va9lizkf3.fsf@alter.siamese.dyndns.org> In-Reply-To: Duy Nguyen writes: > On Fri, Jul 19, 2013 at 2:16 PM, Adam Brengesjö wrote: >> From SYNOPSIS: >> >> git checkout [-p|--patch] [] [--] […] >> >> >> From DESCRIPTION >> >> git checkout [-p|--patch] [] [--] … >> >> >> >> 1. Named in SYNOPSIS, but in DESCRIPTION. (It's >> referred to as in the body text). >> >> 2. is marked as optional in SYNOPSIS, but 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.