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

Re: "svn add * --force" and global-ignores / svn:ignore property

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-01-03 12:52:23 CET

On Jan 3, 2006, at 06:44, mailinglist@perspectives.qc.ca wrote:

> 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?

> $ 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...

No, svn isn't what's ignoring items beginning with "."; rather, it's
your shell. Your shell expands "*" into "all items whose names do not
begin with '.'" and sends that expanded list of files to svn, exactly
as if you had typed them yourself. Subversion never sees that you
typed "*".

> $ 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
[snip]
> A bar-dir <= Oups! Only
> filenames beginning with "." should be included... in my mind...
[snip]
> svn: Path '..' ends in '..', which is unsupported for this operation

Try "ls -ld .*" and you'll see that your shell expands ".*" into a
list that also includes "." and "..". Adding "." means adding all of
the current directory, and adding ".." means adding the parent
directory, which as you see Subversion doesn't support.

I was going to say that you might be able to use "find" instead of
shell expansion, except that I can't figure out how to make find work
non-recursively. Maybe if you can generate the proper listing of
files using ls you can send it to svn's argument list using xargs.
Something like "ls -A" would give you all files, including dot files,
but excluding "." and "..", but you can't feed that directly to svn
with xargs because it's not escaped properly. (Filenames containing
spaces or other special chars would break it.)

Why are we doing all this again? Oh right, you said something about
using Subversion as a backup solution. I'm not sure if this is really
the best way to go about that. Have you considered something like
FSVS instead? It's designed with backups in mind.

http://fsvs.tigris.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 3 12:54:13 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.