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

Re: [PATCH 04/10] attr: more matching optimizations from .gitignore

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 6, 2012, 06:59 UTC
Message-ID
<7v4nm8rspn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8Cn0rAV+u+8tzD2HOm1XkfKBPkFJVrPQAojMBtYe6wxRg@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 16 quoted lines
> On Sat, Oct 6, 2012 at 12:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Or the user might think "path/ attr1" sets attr1 for all files under
>>> "path/" because it does not make sense to attach attributes to a
>>> directory in git.
>>
>>    ...
>>
>>    We may not have a need to assign a real attribute to a directory
>>    right now, because nothing in Git asks for an attribute for a
>>    directory. But that does not necessarily mean we would never need a
>>    way to give an attribute to a directory but not to its contents.
>
> Exactly why we should not make "path/ attr" no-op. If we want to make
> it meaningful some day in future, I don't think we want those no-ops
> lay around and suddenly cause changes in behavior with a new version
> of git.

I do not think you understood. "path/ attr" is a no-op from the point of view of the *users* of the current versions of Git. It is perfectly fine to accept and apply attr to "path/"; no codepath in Git should be asking about path/ anyway, so it ends up to be a no-op. You shouldn't be erroring out at the syntactic level, i.e. when these lines are parsed.

Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 10 of 22 in “nd/wildmatch take 2”
  1. 00/10 nd/wildmatch take 2Nguyễn Thái Ngọc Duy, Oct 5, 2012
  2. 01/10 gitignore: make pattern parsing code a separate functionNguyễn Thái Ngọc Duy, Oct 5, 2012
  3. 02/10 attr: avoid strlen() on every matchNguyễn Thái Ngọc Duy, Oct 5, 2012
  4. 03/10 attr: avoid searching for basename on every matchNguyễn Thái Ngọc Duy, Oct 5, 2012
  5. 04/10 attr: more matching optimizations from .gitignoreNguyễn Thái Ngọc Duy, Oct 5, 2012
  6. Junio C HamanoOct 5, 2012
  7. Nguyen Thai Ngoc DuyOct 6, 2012
  8. Junio C HamanoOct 6, 2012
  9. Nguyen Thai Ngoc DuyOct 6, 2012
  10. Junio C HamanoOct 6, 2012
  11. Nguyen Thai Ngoc DuyOct 8, 2012
  12. Junio C HamanoOct 8, 2012
  13. 05/10 Import wildmatch from rsyncNguyễn Thái Ngọc Duy, Oct 5, 2012
  14. Peter KreftingOct 5, 2012
  15. Nguyen Thai Ngoc DuyOct 5, 2012
  16. 06/10 wildmatch: remove static variable force_lower_caseNguyễn Thái Ngọc Duy, Oct 5, 2012
  17. 07/10 wildmatch: fix case-insensitive matchingNguyễn Thái Ngọc Duy, Oct 5, 2012
  18. 08/10 Integrate wildmatch to gitNguyễn Thái Ngọc Duy, Oct 5, 2012
  19. Thiago FarinaOct 5, 2012
  20. Joachim SchmitzOct 6, 2012
  21. 09/10 Support "**" in .gitignore and .gitattributes patterns using wildmatch()Nguyễn Thái Ngọc Duy, Oct 5, 2012
  22. 10/10 gitignore: forbid "abc**def"Nguyễn Thái Ngọc Duy, Oct 5, 2012

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.