How to set svn:ignore to "*" literally

41 Views Asked by At

i'm trying to set * as value for the svn:ignore property of a directory.

Simply running svn propset svn:ignore * . doesn't work because the * expands to anything in the current directory. It literally adds every possible extension of the files in the current dir, like:

*.txt
*.log

or the command even breaks, if there are non-versioned files in the directory (as they should be, since i'm trying to set *).

In the question SVN: Cannot set svn ignore on a single file the problem was exactly this, but, i am not using a shell that expands *.
Both cmd.exe and pwsh.exe do not expand anything passed to executables. Even trying with quotes and quotes inside quotes doesn't make a difference or simply generates errors:

svn ps svn:ignore *         # the behaviour described
svn ps svn:ignore "*" .     # same as *
svn ps svn:ignore "'*'" .   # sets '*', with single quotes
svn ps svn:ignore '"*"' .   # error Explicit target required ('.' interpreted as prop value)

Also, invoking via some other means (like php -r "shell_exec('svn ps svn:ignore * .');") yields the exact same result.

So it's svn itself the one expand things. How do i stop this?

I tried with the --ignore-keywords, described in the svn docs, hoping * is considered a "keyword", but the parameter it's not supported by propset.


How can you do this?
How does TortoiseSVN do it, via its GUI?

1

There are 1 best solutions below

0
aetonsi On

Ok i found i dumb way to do it, but i'm starting to think that this might be the only way to do it...

echo * > star
svn ps svn:ignore --file star .
del star

This makes use of a support file containing just a star * (and possibly whitespace, but that doesn't make any difference).