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

Re: [PROPOSAL] .gitignore syntax modification

From
Kevin Ballard <kevin@sb.org>
Date
Oct 13, 2010, 03:05 UTC
Message-ID
<91EEA44C-E519-4375-BD9E-68D5C3D7C4EE@sb.org>
In-Reply-To
<20101013024034.GA26483@burratino>
On Oct 12, 2010, at 7:40 PM, Jonathan Nieder wrote:
Show 18 quoted lines
> Kevin Ballard wrote:
>> On Oct 12, 2010, at 7:24 PM, Nguyen Thai Ngoc Duy wrote:
> 
>>> Special case "**/" (also "path/to/**/") is probably good enough. You
>>> might need to handle all combinations of "**/" and other optimizations
>>> in excluded_from_list() though. Can you make a patch (or a few
>>> patches) for it?
> [...]
>>                                                                 At
>> this point I'm actually in favor of simply assuming all paths that
>> don't start with / can be matched at any level
> 
> As a long-term change with early warnings and proper deprecation
> procedure that may (or may not) be an ok idea, but in the short
> term it is certainly a no-go.
> 
> If linux-2.6 is any indication of what to expect, some projects are
> not using / in front of any paths with / at all.
Another possibility is using this new behavior for core.excludesfile and possibly .git/info/exclude, but not for patterns in .gitignore files. The benefit here is any existing project that uses .gitignore files will be unchanged, but global (and possibly repo-wide) patterns can benefit from the new behavior. The drawback is this would introduce a behavioral difference for patterns depending on which file they're in, which is probably not acceptable.
I will look into how much work is required to support **/ patterns without doing a wholesale replacement of fnmatch(). Hopefully it won't be infeasible.
-Kevin Ballard
Previous: Jonathan NiederNext: Junio C Hamano
Message 8 of 13 in “[PROPOSAL] .gitignore syntax modification”
  1. Kevin BallardOct 8, 2010
  2. MaaartinOct 8, 2010
  3. Kevin BallardOct 9, 2010
  4. MaaartinOct 11, 2010
  5. Nguyen Thai Ngoc DuyOct 13, 2010
  6. Kevin BallardOct 13, 2010
  7. Jonathan NiederOct 13, 2010
  8. Kevin BallardOct 13, 2010
  9. Junio C HamanoOct 13, 2010
  10. Nguyen Thai Ngoc DuyOct 13, 2010
  11. Kevin BallardOct 15, 2010
  12. Nguyen Thai Ngoc DuyOct 15, 2010
  13. Kevin BallardOct 15, 2010

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.