* Ignoring pattern in un-ignored directory not working anymore
@ 2013-06-06 8:29 Moritz Bunkus
2013-06-06 18:19 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Moritz Bunkus @ 2013-06-06 8:29 UTC (permalink / raw)
To: git
Hey,
What I want to do:
* ignore certain patterns completely
* but keep one important directoy
* but not the patterns from the first step that are located within
that directory.
Concrete example: I'm tracking certain parts of my $HOME including
~/.emacs.d/ -- but I don't want the compiled Emacs Lisp files therein.
This used to work until recently, though I'm not sure up to which
version excatly. I'm on Arch Linux and therefore usually pretty much
up to date. My current git version is 1.8.3.
More details and how to reproduce:
My ~/.gitignore usually looked like this:
--- cut ---------------------------------------------------------
/*
*.elc
!/.emacs.d/
--- cut ---------------------------------------------------------
With this setup the scenario described at the beginning was possible.
Now it's not as all files within ~/.emacs.d are always considered
regardless of what patterns came before.
Not even putting '*.elc' into ~/.emacs.d/.gitignore will work in such
a case, even though gitignore(5) seems to imply that .gitignore files
closer to the actual file have higher precendence.
Here's a copy & paste of a simple session demonstrating the problem on
a new repo:
--- cut ---------------------------------------------------------
[0 mbunkus@chai-latte ~/tmp/repo] git init
Initialized empty Git repository in /home/mbunkus/tmp/repo/.git/
[0 mbunkus@chai-latte (branchless-repo) ~/tmp/repo] cat > .gitignore
# Ignore all compiled Emacs lisp files
*.elc
# But I want this one directory
!important/
[0 mbunkus@chai-latte (branchless-repo) ~/tmp/repo] mkdir important
[0 mbunkus@chai-latte (branchless-repo) ~/tmp/repo] touch important/wanted.el
[0 mbunkus@chai-latte (branchless-repo) ~/tmp/repo] git add important
[0 mbunkus@chai-latte (branchless-repo) ~/tmp/repo] git commit -m 'all ok'
[master (root-commit) 5ab6055] all ok
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 important/wanted.el
[0 mbunkus@chai-latte (master) ~/tmp/repo] touch unwanted1.elc
[0 mbunkus@chai-latte (master) ~/tmp/repo] touch important/unwanted2.elc
[0 mbunkus@chai-latte (master) ~/tmp/repo] git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# important/unwanted2.elc
nothing added to commit but untracked files present (use "git add" to track)
[0 mbunkus@chai-latte (master) ~/tmp/repo] cat > .gitignore
# Second try: list *.elc twice
*.elc
!important/
*.elc
[0 mbunkus@chai-latte (master) ~/tmp/repo] git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# important/unwanted2.elc
nothing added to commit but untracked files present (use "git add" to track)
[0 mbunkus@chai-latte (master) ~/tmp/repo] cat > .gitignore
# Third times' the charm
*.elc
!important/
important/**/*elc
[0 mbunkus@chai-latte (master) ~/tmp/repo] git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# important/unwanted2.elc
nothing added to commit but untracked files present (use "git add" to track)
[0 mbunkus@chai-latte (master) ~/tmp/repo] echo '*.elc' > important/.gitignore
[0 mbunkus@chai-latte (master) ~/tmp/repo] git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# important/.gitignore
# important/unwanted2.elc
nothing added to commit but untracked files present (use "git add" to track)
--- cut ---------------------------------------------------------
Kind regards,
mosu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ignoring pattern in un-ignored directory not working anymore
2013-06-06 8:29 Ignoring pattern in un-ignored directory not working anymore Moritz Bunkus
@ 2013-06-06 18:19 ` Junio C Hamano
2013-06-06 21:08 ` Moritz Bunkus
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2013-06-06 18:19 UTC (permalink / raw)
To: Moritz Bunkus; +Cc: git, Karsten Blees
Moritz Bunkus <moritz@bunkus.org> writes:
> This used to work until recently, though I'm not sure up to which
> version excatly. I'm on Arch Linux and therefore usually pretty much
> up to date. My current git version is 1.8.3.
Could you test if 'master' at 3684101a654d (Merge branch
'kb/status-ignored-optim-2', 2013-06-03) or later fixes it?
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ignoring pattern in un-ignored directory not working anymore
2013-06-06 18:19 ` Junio C Hamano
@ 2013-06-06 21:08 ` Moritz Bunkus
0 siblings, 0 replies; 3+ messages in thread
From: Moritz Bunkus @ 2013-06-06 21:08 UTC (permalink / raw)
To: git
Hey,
yes, the problem is gone at 3684101a654d. Thanks.
Kind regards,
mosu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-06 21:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06 8:29 Ignoring pattern in un-ignored directory not working anymore Moritz Bunkus
2013-06-06 18:19 ` Junio C Hamano
2013-06-06 21:08 ` Moritz Bunkus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).