threads / discuss / 4429

gitignore: regex for the current dir files only?

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

## tl;dr

2 messages between Jun 8, 2006 and Jun 8, 2006.

replies: 1people: 2as markdown or json

Yasushi SHOJI· Jun 8, 2006, 02:13 UTC · lore
Hello,

this problem came up when I was editing vmlinux.lds.S in the kernel tree.

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"?

comments?
--
       yashi
Junio C Hamano· Jun 8, 2006, 02:40 UTC · re: Yasushi SHOJI · lore

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

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

← back to recent threads