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

Re: [PATCH] doc/gitattributes: mention non-recursive behavior

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 21, 2018, 16:16 UTC
Message-ID
<CACsJy8DCkh=kn1bmCQf4idPggsh5cEY936gfR-5qaQKRsmLBzA@mail.gmail.com>
In-Reply-To
<20180321065005.GB16784@sigill.intra.peff.net>
On Wed, Mar 21, 2018 at 7:50 AM, Jeff King <peff@peff.net> wrote:
Show 13 quoted lines
> On Tue, Mar 20, 2018 at 05:41:52PM +0100, Duy Nguyen wrote:
>
>> > +The rules by which the pattern matches paths are the same as in
>> > +`.gitignore` files (see linkgit:gitignore[5]), with a few exceptions:
>> > +
>> > +  - negative patterns are forbidden
>>
>> After 8b1bd02415 (Make !pattern in .gitattributes non-fatal -
>> 2013-03-01) maybe we could use the verb "ignored" too instead of
>> "forbidden"
>
> Makes sense. The original is already in 'next', so do you want to send
> an incremental patch?
It's up to you. After all it's you who's doing all the work :)
Show 10 quoted lines
>> > +    pointless in an attributes file; use `path/**` instead)
>>
>> We probably could do this internally too (converting "path/" to
>> "path/**") but we need to deal with corner cases (e.g. "path" without
>> the trailing slash, but is a directory). So yes, suggesting the user
>> to do it instead may be easier.
>
> Yeah, I almost suggested that, but I worried about those corner cases.
> It seems like documenting the current behavior is the right first step
> in any case.
Agreed.
Show 5 quoted lines
> One other maybe-difference I came across coincidentally today: you have
> to quote the pattern in .gitattributes if it contains spaces, but not in
> .gitignore. But that's more an artifact of the rest of the file syntax
> than the pattern syntax (.gitignore has no other fields to confuse it
> with).

Yeah I forgot about that (and I was the one who started it). The document was updated in 860a74d9d9 (attr: support quoting pathname patterns in C style - 2017-01-27) though.

-- 
Duy
Previous: Jeff KingNext: Jeff King
Message 11 of 28 in “.gitattributes override behavior (possible bug, or documentation bug)”
  1. Dakota HawkinsMar 20, 2018
  2. Jeff KingMar 20, 2018
  3. Dakota HawkinsMar 20, 2018
  4. Dakota HawkinsMar 20, 2018
  5. Jeff KingMar 20, 2018
  6. Jeff KingMar 20, 2018
  7. doc/gitattributes: mention non-recursive behaviorJeff King, Mar 20, 2018
  8. Dakota HawkinsMar 20, 2018
  9. Duy NguyenMar 20, 2018
  10. Jeff KingMar 21, 2018
  11. Duy NguyenMar 21, 2018
  12. Jeff KingMar 23, 2018
  13. Dakota HawkinsMar 20, 2018
  14. Jeff KingMar 20, 2018
  15. Dakota HawkinsMar 20, 2018
  16. Duy NguyenMar 20, 2018
  17. Dakota HawkinsMar 21, 2018
  18. Jeff KingMar 21, 2018
  19. Dakota HawkinsMar 21, 2018
  20. Dakota HawkinsMar 21, 2018
  21. Jeff KingMar 21, 2018
  22. Dakota HawkinsMar 21, 2018
  23. Jeff KingMar 21, 2018
  24. Junio C HamanoMar 21, 2018
  25. Duy NguyenMar 21, 2018
  26. Junio C HamanoMar 20, 2018
  27. Dakota HawkinsMar 20, 2018
  28. Jeff KingMar 20, 2018

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.