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

Re: gitignore: regex for the current dir files only?

From
Junio C Hamano <junkio@cox.net>
Date
Jun 8, 2006, 02:40 UTC
Message-ID
<7virnccquw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87mzcol7i3.wl@mail2.atmark-techno.com>
Yasushi SHOJI <yashi@atmark-techno.com> writes:
Show 5 quoted lines
> because we have "vmlinux*" in the toplevel .gitignore in linus's tree,
> all vmlinux.lds.S under arch/$(ARCH)/kernel/ is affected. for kernel,
> it might as easier to remove "*" from the exp.  but I was wandering if
> it's worth to have an expression for gitignore to handle "a regex for
> the current dir only"?

Yeah, that would be a very useful thing to have. Something like this?

#!/bin/sh

rm -rf test mkdir -p test/a/b/c cd test git init-db

date >a/vmlinux.1 date >a/b/vmlinux.2 date >a/b/c/vmlinux.3

echo 'vmlinux*' >a/.gitignore echo '!/vmlinux*' >a/b/.gitignore

git status -u
Previous: Yasushi SHOJI
Message 2 of 2 in “gitignore: regex for the current dir files only?”
  1. Yasushi SHOJIJun 8, 2006
  2. Junio C HamanoJun 8, 2006

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.