git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-log: documenting pathspec usage

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 16, 2020, 18:55 UTC
Message-ID
<xmqqblfx9ln7.fsf@gitster.c.googlers.com>
In-Reply-To
<878sb1fpep.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 9 quoted lines
> It seems like a good idea to make these consistent, if you're feeling
> more ambitious than just git-log's manpage then:
>     
>     $ git grep '<pathspec>' -- Documentation/git-*.txt|wc -l
>     54
>     $ git grep '<path>' -- Documentation/git-*.txt|wc -l
>     161
>
> Most/all of these should probably be changed to one or the other.
There is another thing we want to normalize.

Originally <pathspec> was invented to be a collective noun (i.e. a set of one or more wildmatch patterns that specify paths that match any of these patterns is called a pathspec). These days, however, we more often refer to each individual pattern as <pathspec> than using the word in its original way. We can look for '<pathspec>...' in the documentation to find these more modern usage.

This latter form would match readers' expectation better, but there still are a few places (e.g. "stash forget <pathspec>") that use the word as a collection of pattterns. While these places may be using the word "correctly", in the modern world, they give an incorrect impression that the command somehow is special and can take a pathspec with only a single pattern, when they can take one or more patterns.

We should make sure we use "<pathspec>..." uniformly in the documentation in these places.

Thanks.
Previous: Philippe Blain
Message 4 of 4 in “git-log: documenting pathspec usage”
  1. Adam SpiersNov 16, 2020
  2. Ævar Arnfjörð BjarmasonNov 16, 2020
  3. Philippe BlainNov 16, 2020
  4. Junio C HamanoNov 16, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.