threads / bug / 49536

Bug: manpage for `git ls-files` uses <file> instead of <pathspec>

Subject: Bug: manpage for `git ls-files` uses <file> instead of <pathspec>

## tl;dr

2 messages between Oct 11, 2018 and Oct 13, 2018.

replies: 1people: 2as markdown or json

Lily Ballard· Oct 11, 2018, 03:20 UTC · lore
`git ls-files` takes zero or more <pathspec>s, but the manpage (and the `-h` output) lists it as taking zero or more <file>s instead. This is confusing as <file> is documented in `man git` as a filename, without any magic. But a pathspec has a lot of special handling. The gitglossary entry for pathspec does say that `git ls-files` takes it, but nobody is going to know to look there in the first place if they look at `git ls-files` and see that it takes files. 
I haven’t checked any other commands that the glossary lists as taking pathspecs (except `git add`, which does properly list it as taking pathspecs), so I don’t know if any of the other commands incorrectly list themselves as taking files when they take pathspecs.
git version 2.19.1.
-Lily Ballard
Junio C Hamano· Oct 13, 2018, 08:03 UTC · re: Lily Ballard · lore

Re: Bug: manpage for `git ls-files` uses <file> instead of <pathspec>

Lily Ballard <lily@sb.org> writes:
Show 5 quoted lines
> I haven’t checked any other commands that the glossary lists as
> taking pathspecs (except `git add`, which does properly list it as
> taking pathspecs), so I don’t know if any of the other commands
> incorrectly list themselves as taking files when they take
> pathspecs.

I do not offhand think of a command that only takes pathname, including "ls-files". New users would think "git cmd README" is taking a single filename "README", and "ls-files" doc uses "file" in a misguided attempt to be "newbie friendly", but it always has used that "README" string as a pattern to match paths against.

← back to recent threads