Ryan Schmidt wrote, On 31/12/05 09:13:
> So when you say "svn add *" you're explicitly telling Subversion to
> add every file in the current directory, and Subversion will do so,
> even if those items were in one of your ignore lists.
>
> I do not know what your use of "--force" is doing here; I have no
> experience with that option.
>
> Note that your shell expands "*" to all items whose names do not
> begin with "." which explains why you didn't perceive a problem with
> items beginning with ".".
After more testing and learning (always something to learn for a
newbie): To add every (including filenames beginning with "." )
unversioned objects in and under the current directory AND having
global-ignores rules / svn:ignore property applied, I think using the
followings instead of "svn add * --force" is the solution:
$ svn add ./ --force
$ svn add ./ --force --no-ignore <= To include literally
everything... (1.3.0 only... I think)
To revert...
$ svn revert ./ --recursive
The Subversion book
(http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-9-sect-1.2-re-add)
should probably be reviewed to reflect this subtlety... because "svn add
* --force" doesn't "add every unversioned object in your working copy"
as stated (* excludes filenames beginning with "." as explained by Ryan)...
Finally, "svn add .* --force --no-ignore", "svn add .* --force" and "svn
revert .* --recursive" at the end of my testcase (see below) are
producing surprising results from my point of view... I'm missing
something again?
So far... 1.3.0 is very promising... Thanks for your great work!
Benjamin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Complet testcase... svn, version 1.3.0 (r17949)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ cat ~/.subversion/config | grep foo
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store ._*
.Trashes foo-dir foo.txt .foo.txt .foo-dir
$ svnadmin create repository
$ svn co file:///tmp/repository/ wc
Checked out revision 0.
$ cd wc/
$ mkdir -p .foo-dir/bar-dir
$ mkdir -p .foo-dir/foo-dir
$ mkdir -p .bar-dir/bar-dir
$ mkdir -p .bar-dir/foo-dir
$ mkdir -p .foo-dir/.bar-dir
$ mkdir -p .foo-dir/.foo-dir
$ mkdir -p .bar-dir/.bar-dir
$ mkdir -p .bar-dir/.foo-dir
$ mkdir -p bar-dir/bar-dir/
$ mkdir -p bar-dir/foo-dir/
$ mkdir -p foo-dir/bar-dir/
$ mkdir -p foo-dir/foo-dir/
$ touch .foo.txt
$ touch .bar.txt
$ touch .foo-dir/foo.txt
$ touch .foo-dir/bar.txt
$ touch .bar-dir/bar.txt
$ touch .bar-dir/foo.txt
$ touch .foo-dir/.foo.txt
$ touch .foo-dir/.bar.txt
$ touch .bar-dir/.bar.txt
$ touch .bar-dir/.foo.txt
$ touch foo.txt
$ touch bar.txt
$ touch bar-dir/foo.txt
$ touch bar-dir/bar.txt
$ touch foo-dir/bar.txt
$ touch foo-dir/foo.txt
$ touch bar-dir/foo-dir/foo.txt
$ touch bar-dir/foo-dir/bar.txt
$ touch bar-dir/bar-dir/foo.txt
$ touch bar-dir/bar-dir/bar.txt
$ svn st --no-ignore
I foo-dir
I .foo.txt
? bar-dir
? .bar.txt
I foo.txt
? bar.txt
I .foo-dir
? .bar-dir
$ svn add ./ --force
A .bar-dir
A .bar-dir/bar-dir
A .bar-dir/.bar-dir
A .bar-dir/bar.txt
A .bar-dir/.bar.txt
A bar-dir
A bar-dir/bar-dir
A bar-dir/bar-dir/bar.txt
A bar-dir/bar.txt
A .bar.txt
A bar.txt
$ svn st --no-ignore
I foo-dir
I .foo.txt
I foo.txt
I .foo-dir
I bar-dir/foo-dir
I bar-dir/foo.txt
A bar-dir
I bar-dir/bar-dir/foo.txt
A bar-dir/bar-dir
A bar-dir/bar-dir/bar.txt
A bar-dir/bar.txt
A .bar.txt
A bar.txt
I .bar-dir/foo-dir
I .bar-dir/.foo.txt
I .bar-dir/foo.txt
I .bar-dir/.foo-dir
A .bar-dir
A .bar-dir/bar-dir
A .bar-dir/.bar.txt
A .bar-dir/bar.txt
A .bar-dir/.bar-dir
$ touch ignore.txt bar-dir/ignore.txt foo-dir/ignore.txt
$ svn propset svn:ignore ignore.txt .
property 'svn:ignore' set on '.'
$ svn propset svn:ignore ignore.txt bar-dir
property 'svn:ignore' set on 'bar-dir'
$ svn st --no-ignore
I foo-dir
I .foo.txt
I foo.txt
I ignore.txt
I .foo-dir
M .
I bar-dir/foo-dir
I bar-dir/foo.txt
I bar-dir/ignore.txt
A bar-dir
I bar-dir/bar-dir/foo.txt
A bar-dir/bar-dir
A bar-dir/bar-dir/bar.txt
A bar-dir/bar.txt
A .bar.txt
A bar.txt
I .bar-dir/foo-dir
I .bar-dir/.foo.txt
I .bar-dir/foo.txt
I .bar-dir/.foo-dir
A .bar-dir
A .bar-dir/bar-dir
A .bar-dir/.bar.txt
A .bar-dir/bar.txt
A .bar-dir/.bar-dir
$ svn add ./ --force <= Nothing happens... exactly what I want...
$ svn add * --force <= Demo purpose... Explicit add...
A foo-dir
A foo-dir/bar-dir
A foo-dir/bar.txt
A foo-dir/ignore.txt
A foo.txt
A ignore.txt
## As expected, svn ignores filenames beginning with "." on "svn add *
--force"and doesn't apply global-ignores rules / svn:ignore property
because we explicitly told Subversion to add...
$ svn st --no-ignore
I .foo.txt
I .foo-dir
M .
I foo-dir/foo-dir
I foo-dir/foo.txt
A foo-dir
A foo-dir/bar-dir
A foo-dir/ignore.txt
A foo-dir/bar.txt
I bar-dir/foo-dir
I bar-dir/foo.txt
I bar-dir/ignore.txt
A bar-dir
I bar-dir/bar-dir/foo.txt
A bar-dir/bar-dir
A bar-dir/bar-dir/bar.txt
A bar-dir/bar.txt
A .bar.txt
A foo.txt
A ignore.txt
A bar.txt
I .bar-dir/foo-dir
I .bar-dir/.foo.txt
I .bar-dir/foo.txt
I .bar-dir/.foo-dir
A .bar-dir
A .bar-dir/bar-dir
A .bar-dir/.bar.txt
A .bar-dir/bar.txt
A .bar-dir/.bar-dir
$ svn revert ./ -R
Reverted '.'
Reverted 'foo-dir'
Reverted 'bar-dir'
Reverted '.bar.txt'
Reverted 'foo.txt'
Reverted 'ignore.txt'
Reverted 'bar.txt'
Reverted '.bar-dir'
$ svn add * --force --no-ignore <= OK... result as expected... (exclude
filenames beginning with ".")
A bar-dir
A bar-dir/bar-dir
A bar-dir/bar-dir/foo.txt
A bar-dir/bar-dir/bar.txt
A bar-dir/foo-dir
A bar-dir/foo-dir/foo.txt
A bar-dir/foo-dir/bar.txt
A bar-dir/foo.txt
A bar-dir/bar.txt
A bar-dir/ignore.txt
A bar.txt
A foo-dir
A foo-dir/bar-dir
A foo-dir/foo-dir
A foo-dir/bar.txt
A foo-dir/foo.txt
A foo-dir/ignore.txt
A foo.txt
A ignore.txt
$ svn st --no-ignore
I .foo.txt
? .bar.txt
I .foo-dir
? .bar-dir
A foo-dir
A foo-dir/foo-dir
A foo-dir/test
A foo-dir/bar-dir
A foo-dir/foo.txt
A foo-dir/ignore.txt
A foo-dir/bar.txt
A bar-dir
A bar-dir/foo-dir
A bar-dir/foo-dir/foo.txt
A bar-dir/foo-dir/bar.txt
A bar-dir/bar-dir
A bar-dir/bar-dir/foo.txt
A bar-dir/bar-dir/bar.txt
A bar-dir/foo.txt
A bar-dir/ignore.txt
A bar-dir/bar.txt
A foo.txt
A ignore.txt
A bar.txt
$ svn revert ./ -R
Reverted 'foo-dir'
Reverted 'bar-dir'
Reverted 'foo.txt'
Reverted 'ignore.txt'
Reverted 'bar.txt'
$ svn add .* --force --no-ignore
A .foo-dir
A .foo-dir/bar-dir
A .foo-dir/foo-dir
A .foo-dir/.bar-dir
A .foo-dir/.foo-dir
A .foo-dir/foo.txt
A .foo-dir/bar.txt
A .foo-dir/.foo.txt
A .foo-dir/.bar.txt
A .bar-dir
A .bar-dir/bar-dir
A .bar-dir/foo-dir
A .bar-dir/.bar-dir
A .bar-dir/.foo-dir
A .bar-dir/bar.txt
A .bar-dir/foo.txt
A .bar-dir/.bar.txt
A .bar-dir/.foo.txt
A bar-dir <= Oups! Only filenames
beginning with "." should be included... in my mind...
A bar-dir/bar-dir
A bar-dir/bar-dir/foo.txt
A bar-dir/bar-dir/bar.txt
A bar-dir/foo-dir
A bar-dir/foo-dir/foo.txt
A bar-dir/foo-dir/bar.txt
A bar-dir/foo.txt
A bar-dir/bar.txt
A bar-dir/ignore.txt
A foo-dir <= Oups!?
A foo-dir/bar-dir
A foo-dir/foo-dir
A foo-dir/bar.txt
A foo-dir/foo.txt
A foo-dir/ignore.txt
A .foo.txt
A .bar.txt
A foo.txt <= Oups!?
A bar.txt <= Oups!?
A ignore.txt <= Oups!?
svn: Path '..' ends in '..', which is unsupported for this operation
$ svn revert ./ -R
Reverted 'foo-dir'
Reverted '.foo.txt'
Reverted 'bar-dir'
Reverted '.bar.txt'
Reverted 'foo.txt'
Reverted 'ignore.txt'
Reverted 'bar.txt'
Reverted '.foo-dir'
Reverted '.bar-dir'
$ svn add .* --force
A .bar-dir
A .bar-dir/bar-dir
A .bar-dir/.bar-dir
A .bar-dir/bar.txt
A .bar-dir/.bar.txt
A .bar-dir/.foo.txt
A bar-dir <= Oups!? Same thing here...
only filenames beginning with "." should be included...
A bar-dir/bar-dir
A bar-dir/bar-dir/bar.txt
A bar-dir/bar.txt
A bar-dir/ignore.txt
A .bar.txt
A bar.txt <= Oups!?
A ignore.txt <= Oups!?
svn: Path '..' ends in '..', which is unsupported for this operation
$ svn st --no-ignore
I foo-dir
I .foo.txt
I foo.txt
I .foo-dir
I bar-dir/foo-dir
I bar-dir/foo.txt
A bar-dir
I bar-dir/bar-dir/foo.txt
A bar-dir/bar-dir
A bar-dir/bar-dir/bar.txt
A bar-dir/ignore.txt
A bar-dir/bar.txt
A .bar.txt
A ignore.txt
A bar.txt
I .bar-dir/foo-dir
I .bar-dir/.foo.txt
I .bar-dir/foo.txt
I .bar-dir/.foo-dir
A .bar-dir
A .bar-dir/bar-dir
A .bar-dir/.bar.txt
A .bar-dir/bar.txt
A .bar-dir/.bar-dir
svn revert .* --recursive
Reverted 'bar-dir' <= Oups!?
Reverted '.bar.txt'
Reverted 'ignore.txt' <= Oups!?
Reverted 'bar.txt' <= Oups!?
Reverted '.bar-dir'
svn: '..' is not a working copy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 3 06:46:39 2006