Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:28

Yasushi SHOJI [off-list ref] writes:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help