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

Re: [PATCH] Let users override name of per-directory ignore file

From
Karl Hasselström <kha@treskal.com>
Date
Oct 22, 2007, 10:50 UTC
Message-ID
<20071022105029.GB31862@diana.vm.bytemark.co.uk>
In-Reply-To
<20071021144542.8855A5BB85@nox.op5.se>
On 2007-10-15 14:09:32 +0200, Andreas Ericsson wrote:
Show 5 quoted lines
> When collaborating with projects managed by some other scm, it often
> makes sense to have git read that other scm's ignore-files. This
> patch lets git do just that, if the user only tells it the name of
> the per-directory ignore file by specifying the newly introduced git
> config option 'core.ignorefile'.
> +	For example, setting core.ignorefile to .svnignore in
> +	repos where one interacts with the upstream project repo
> +	using gitlink:git-svn[1] will make a both SVN users and
> +	your own repo ignore the same files.
Show 5 quoted lines
> +   The name of the `.gitignore` file can be changed by setting
> +   the configuration variable 'core.ignorefile'. This is useful
> +   when using git for projects where upstream is using some other
> +   SCM. For example, setting 'core.ignorefile' to `.cvsignore`
> +   will make git ignore the same files CVS would.

I agree with what you're trying to do, but you're ignoring the fact that Subversion's ignore patterns (and possibly cvs's too -- I haven't checked) are not recursive, while the patterns in .gitignore are recursive per default. So using ignore patterns directly from Subversion ignores more files under git than the same patterns did under Subversion.

One possible way to solve that would be to optionally have non-recursive per-directory ignore files. I haven't looked at how this is implemented, though, so I don't know if it's a good suggestion or not.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Andreas EricssonNext: Andreas Ericsson
Message 2 of 3 in “Let users override name of per-directory ignore file”
  1. Let users override name of per-directory ignore fileAndreas Ericsson, Oct 15, 2007
  2. Karl HasselströmOct 22, 2007
  3. Andreas EricssonOct 22, 2007

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.