[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn add doesn't honor svn:ignore or global ignore?

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2006-10-31 08:52:53 CET

On 10/31/06, Reinhard Brandstädter <reinhard.brandstaedter@jku.at> wrote:
> Hi,
> I just ran into an unexpected behavior with 1.3.2 on RedHat EL here.
> I want to plate /etc under version control. So i have created a repository
> with a directory trunk/etc and set the svn:ignore property to "shadow*".
> I did a in-place checkout to /etc :
> # cd /etc
> # svn co https://host.mydomain.com/svn/rhelserver/trunk/etc .
> # svn propget svn:ignore
> shadow*
> svn status honors the svn:ignore property as I expected it (the file shadow is
> ignored)
> # svn status | grep shadow
> ? gshadow-
> ? gshadow
> However if i want to add all files and directories in /etc to the repository I
> would do this with 'svn add *'. This although adds also the 'shadow' file.
> I didn't expect this especially because i also added 'shadow' to my global
> ignore and there is the '--no-ignore' switch for svn add as well?
> # svn add * | grep shadow
> A gshadow
> A gshadow-
> A shadow
> A shadow-

> So is this behavior expected or do i have to pipe the output of 'svn status'
> to 'svn add' and not use 'svn add *'

Yes, the behaviour is expected: svn will always add explicitly
mentioned target. '*' expands to gshadow, gshadow- (etc), meaning you
explicitly mentioned them in the target list. the solution is to 'svn
add .' which is implicit for the files contained within '.' meaning
that it should honor your ignore pattern.

In other words: you can't use svn:ignore to prevent a file from ever
being committed. If you want to do that, I suggest using a pre-commit
hook which prevents commits with certain file names.


Received on Tue Oct 31 08:53:33 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.