0
votes

(Editing note: Since the problem is still unsolved, I have also crossposted it here: https://softwareengineering.stackexchange.com/questions/241406/subversion-files-added-although-svnignore-is-set)

In the base directory of my application, I have set:

$ cd .../trunk
$ svn propget svn:ignore .
log
tmp

This is to make sure, that the directories log and tmp are exempted from subversion control.

When I create many new files in my project, and want to add them to subversion, I usually do a

$ svn add --force *

I am using --force, because the new files are in several subdirectories. If I would not use --force, svn would stop looking recursively into those directories which are already under version control.

However, I just noticed that --force also seems to ignore the svn:ignore list, because this command added also files which are inside the tmp tree.

Now my questions:

(1) How would I correctly add only those new files which are somewhere below a directory which is not ignored?

(2) What is the easiest way to remove all those new files and directories which had been added below tmp and log from version control? Of course they should still be kept in the trunk.

1

1 Answers

0
votes

Read carefully svn help (you must to use propset command, not propget) + svn help ps

Subversion recognizes the following special versioned properties on a directory:

svn:ignore         - A list of file glob patterns to ignore, one per line.

You can't define multiline value for svn:ignore inside single command: you have to use -F FILE option in order to read values from file or use ps+pe pair (propset+propedit) in order to have two ignored patterns

When you'll get for svn:ignore the same result as here

>svn pl -v
Properties on '.':
  svn:ignore
    log
    tmp

then (unversioned) files in these folders will be ignored on commit

>dir /B /S
z:\WC\a.txt
z:\WC\b.txt
z:\WC\log
z:\WC\tmp
...
z:\WC\log\a.txt
z:\WC\log\b.txt
z:\WC\tmp\a.txt
z:\WC\tmp\b.txt

but

>svn st
 M      .
?       a.txt
?       b.txt