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

Cogito and --exclude vs --exclude-per-directory

From
Karl Hasselström <kha@treskal.com>
Date
Nov 16, 2005, 09:36 UTC
Message-ID
<20051116093630.GA2783@diana.vm.bytemark.co.uk>
[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
Next: Karl Hasselström
Message 1 of 3 in “Cogito and --exclude vs --exclude-per-directory”
  1. Karl HasselströmNov 16, 2005
  2. Karl HasselströmNov 16, 2005
  3. Junio C HamanoNov 16, 2005

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.