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

Re: [PATCH] gitignore: root most patterns at the top-level directory

From
JPJames Pickens <jepicken@gmail.com>
Date
Oct 30, 2009, 21:52 UTC
Message-ID
<885649360910301452g7d7311d7w1133f5d4c98072dc@mail.gmail.com>
In-Reply-To
<20091030182431.GA19901@coredump.intra.peff.net>
On Fri, Oct 30, 2009 at 11:24 AM, Jeff King <peff@peff.net> wrote:
Show 15 quoted lines
>> If we do so, there is no need to change the current .gitignore entires.
>> You need to spell a concrete filename as a glob pattern that matches only
>> one path if you want the recursive behaviour.  E.g. if you have a Makefile
>> per subdirectory, each of which generates and includes Makefile.depend
>> file, you would write "Makefile.depen[d]" in the toplevel .gitignore file.
>
> While clever, that use of '[d]' seems unneccessarily obscure to me. Why
> not just give a wildcard for "any subdirectory of me" and do:
>
>  Makefile.depend
>  **/Makefile.depend
>
> Since "**" is in common use in other systems, it's pretty clear (to me,
> anyway, but then I am the one suggesting the syntax ;) ) what that
> means.

+1 to that. I've often wished for Git to support the ** wildcard, not only in .gitignore but also in other places like .gitattributes and sparse checkout (if that feature ever gets completed anyways). It's on my list of "git features I would work on if I ever had any free time."

James
Previous: Jeff King
Message 5 of 5 in “gitignore: root most patterns at the top-level directory”
  1. gitignore: root most patterns at the top-level directoryJeff King, Oct 27, 2009
  2. Junio C HamanoOct 28, 2009
  3. Johannes SixtOct 28, 2009
  4. Jeff KingOct 30, 2009
  5. James PickensOct 30, 2009

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.