How do I ignore a file/directory with a space in it with a (tortoise) SVN ignore pattern?
Asked Answered
E

3

7

I'm trying to add the directory with a space in it:

Static Debug

to my SVN ignore pattern.

However, spaces are used to separate different directories (so the above ignore pattern would be interpreted as two files to ignore -- Static and Debug)

I've tried adding

Static%20Debug

and

"Static Debug"

and

Static\ Debug

with no luck

And apparently I can't ignore by regular expression.

Anyone have any idea?

Exciter answered 27/7, 2011 at 15:30 Comment(0)
T
4

Related to Doug T.'s Answer, I played around with this a bit.

Instead of using ?, you can specify an exclusion range with [] by putting a ^ at the front.

ignore[^A-Za-z0-9]this

If I have an "ignore this" and a "ignore0this", the one with the space will be ignored, but not the one with the 0.

Toon answered 27/7, 2011 at 16:5 Comment(1)
Shouldn't that be A-Za-z in the pattern?Promethean
E
3

I found this documentation in the tortoise manual. According to it

[...]

Matches any one of the characters enclosed in the square brackets. Within the brackets, a pair of characters separated by “-” matches any character lexically between the two. For example [AGm-p] matches any one of A, G, m, n, o or p.

So I can simply do

Static[ ]Debug 

which works

Ok that actually DOESN'T WORK for whitespace in my version of Tortoise

What works is using

?

Matches any single character.

which lets me do

Static?Debug

which unfortunately also matches stuff like StaticADebug. But this is good enough to do the trick.

Exciter answered 27/7, 2011 at 15:41 Comment(4)
Nice way to leverage the pattern matching brackets to do the job effectively.Fridlund
@Edwin, I was wrong. [ ] didn't work. I must have confused my results with the ? test I did. I wish it DID work. Tortoise doesn't seem to provide anyway of escaping a space character and always sees it as a separator.Exciter
too bad. It would have been an elegant hack. Have you tried double and triple escaping the space? Sometimes the name gets evaluated in a shell, which strips the first backslash. I've had success in other tasks with items similar to Static\\\ Debug, etc.Fridlund
Another item to consider is that maybe the double quotes need backslashes. Not that they should require them; but, perhaps the processing around the name isn't very careful in preserving them, and they get stripped along the way.Fridlund
A
0

As far as I know, it's a newline separated list. It even says so when you hover the mouse on the text box. I've just tried the name as-is and it works as expected:

Static Debug

Edit:

enter image description here

Actual answered 27/7, 2011 at 16:17 Comment(4)
mine says "Separate the patters with a space." (if you do global ignore pattern)Toon
@Toon - Weird... See my screen-shot.Jigsaw
yes, you are in the property for something. That does indicate newline delimited. Not sure, but I think the original post is for global ignore patterns, and those are space delimited.Toon
@Toon - You are right, I thought it was about editing the svn:ignore property of the parent directory, but the question clearly said global ignore patterns for all working copies. I misread it.Jigsaw

© 2022 - 2024 — McMap. All rights reserved.