* Cogito and --exclude vs --exclude-per-directory
@ 2005-11-16 9:36 Karl Hasselström
2005-11-16 9:38 ` Karl Hasselström
2005-11-16 19:01 ` Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Karl Hasselström @ 2005-11-16 9:36 UTC (permalink / raw)
To: git
[Note: this experiment was done with git 0.99.9g and Cogito 0.15.1, so ]
It seems that --exclude patterns always take precedence over
--exclude-per-directory patterns. For example:
$ ls -a
./ ../ .bar bar.txt .foo foo.txt .git/ .gitignore
$ cat .gitignore
!.bar
$ git-ls-files -o --exclude='.*' --exclude='!.bar'
.bar
bar.txt
foo.txt
$ git-ls-files -o --exclude='.*' --exclude-per-directory=.gitignore
bar.txt
foo.txt
Is this the intended behavior?
Since Cogito specifies a few "default" ignore patterns with --exclude,
(such as .* and *.o) these become impossible to override with !
patterns in .gitignore files. In effect, the default patterns are
given priority over user-supplied patterns.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Cogito and --exclude vs --exclude-per-directory
2005-11-16 9:36 Cogito and --exclude vs --exclude-per-directory Karl Hasselström
@ 2005-11-16 9:38 ` Karl Hasselström
2005-11-16 19:01 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Karl Hasselström @ 2005-11-16 9:38 UTC (permalink / raw)
To: git
On 2005-11-16 10:36:30 +0100, Karl Hasselström wrote:
> [Note: this experiment was done with git 0.99.9g and Cogito 0.15.1,
> so ]
. . . please scream if I should just upgrade to fix all my problems.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Cogito and --exclude vs --exclude-per-directory
2005-11-16 9:36 Cogito and --exclude vs --exclude-per-directory Karl Hasselström
2005-11-16 9:38 ` Karl Hasselström
@ 2005-11-16 19:01 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2005-11-16 19:01 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
Karl Hasselström <kha@treskal.com> writes:
> [Note: this experiment was done with git 0.99.9g and Cogito 0.15.1, so ]
>
> It seems that --exclude patterns always take precedence over
> --exclude-per-directory patterns.
>
> Is this the intended behavior?
Yes, we had a lengthy discussion on this before ls-files
acquired the exclude patterns.
Documentation/git-ls-files.txt "Exclude Patterns" summarizes the
precedence rule, and it was done that way to allow command line
users to override what are in individual per-directory pattern
files per-invocation basis. That is, --exclude-per-directory is
to store project defaults, and --exclude is for end-users to
specify override per-invocation. --exclude-from has the lowest
precedence to give overall default. The example in the
documetation has a a good illustration.
* --exclude-from contains '*.[oa]' to catch generic
"uninteresting" files.
* --exclude-per-directory files contain patterns to
catch files that are built by the Makefile in the
directory.
* --exclude specifies whatever the user feels like for
the particular invocation.
If I were writing a Porcelain, I would probably install default
exclude list in /usr/lib/MyPorcelain/exclude file and point at
the file with --exclude-from. I may also be tempted to check
$HOME/.MyPorcelain/exclude file and add it to give defaults per
user, but I do not do Porcelains, so...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-16 19:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-16 9:36 Cogito and --exclude vs --exclude-per-directory Karl Hasselström
2005-11-16 9:38 ` Karl Hasselström
2005-11-16 19:01 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox