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

Re: [PATCH] make slash-rules more readable

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2019, 18:01 UTC
Message-ID
<xmqqsgsqv98w.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<979f6497-5e26-4a93-c345-f61b31c736c6@talktalk.net>
Philip Oakley <philipoakley@talktalk.net> writes:
> From a user perspective, implementation issues shouldn't be part of
> the description unless absolutely essential.
> Most user aren't aware of the implementation so don't grok/understand
> what the fuss is about and ignore it...

Oh, absolutely. But unfortunately I do not see what that principle has anything to do with the comments you made in your message.

>> Specifically, if you took my suggestion in an earlier review to
>> explicitly say that leading slash is merely a workaround for a
>> string without slash to anchor the pattern to the directory and
>> it should be treated as if it does not exist otherwise, then ...

Perhaps you thought "workaround" refers to some implementation glitch? That is not what the word means in that sentence. It is a technique to work around "you need a slash somewhere in the pattern to anchor it to a specific directory" that is a very user visible design. The user absolutely need to be aware of it, if s/he wants to anchor a pattern that does not have a slash (e.g. "I need a pattern to name/match the README file at this level but not in any of the subdirectories"), and an extra leading slash is a way to mark such a pattern that otherwise does not have a slash as anchored.

The fact that the leading slash is such a syntactic marking of a pattern *and* is not a part of the pattern itself, would not help you understand the implementation, but you need to know it in order to use that feature effectively.

Show 10 quoted lines
>>> + - The pattern `doc/frotz` and `/doc/frotz` have the same effect
>>> +   in any `.gitignore` file. Both pattern contain a non-trailing
>>> +   slash and thus match relative to the location of the
>>> +   `.gitignore` file.
>> ... this paragraph wouldn't have been necessary.
> ...leading to that user mistake having to be explained in numerous Q&A
> threads - Why can't we an explicit explanation of this common user
> mistake?
> Arguably the issue is the special trailing slash rule getting
> users confused..

What common user mistake? The above is about leading slash rule, by the way, so perhaps you are getting confused?

Previous: Dr. Adam NielsenNext: Philip Oakley
Message 7 of 11 in “make slash-rules more readable”
  1. make slash-rules more readableDr. Adam Nielsen, May 31, 2019
  2. Junio C HamanoMay 31, 2019
  3. Dr. Adam NielsenMay 31, 2019
  4. Junio C HamanoMay 31, 2019
  5. Philip OakleyJun 1, 2019
  6. Dr. Adam NielsenJun 2, 2019
  7. Junio C HamanoJun 3, 2019
  8. Philip OakleyJun 4, 2019
  9. Philip OakleyJun 1, 2019
  10. Philip OakleyJun 4, 2019
  11. Dr. Adam NielsenJun 4, 2019

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.