You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Daniel Sahlberg <da...@gmail.com> on 2022/08/26 07:58:23 UTC

Windows, svn propset svn:ignore *

Hi,

Using Subversion "trunk" on Windows built from TortoiseSVN.

I would like to set the svn:ignore property to * on a certain directory.
(I'm trying to ignore everything since I'd only want to explicitly add a
few subdirectories).

I thought this would do the trick
C:\wc>svn propset svn:ignore * directoryname

But alas it expands the * to all files in the current directory. I'd like
to quote the * so the property is set to exactly *. I've found ways to
quote the * (for example '*') but in those cases the property is set to
also include the quotes.

I've digged around and found a few messages in the archive indicating that
Subversion on Windows is using setargv.obj and then the following thread on
Stackoverflow [1] indicating that setargv.obj doesn't have a way to avoid
wildcard expansion.

Does anyone have a trick up the sleve?

The following seems to work but it feels a bit unintuitive:
echo * | svn propset -F - svn:ignore directoryname

Kind regards,
Daniel

[1]
https://stackoverflow.com/questions/47512829/is-it-possible-to-quote-escape-command-line-arguments-on-windows-while-linking-s

Re: Windows, svn propset svn:ignore *

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Jon Daley via users wrote on Fri, 26 Aug 2022 13:13 +00:00:
> I don't use Windows, so I can't help you on the escaping of the *, but I 
> often use propedit, rather than propset (partly because I can never 
> remember the order of the directory and the property value),

Usually (not just in svn) the directory / local file target is last.
This makes it easy to pass multiple targets, or to invoke the command
via xargs(1), etc..

Also, it plays well with various shells' M-. keybinding to insert the
last command's last word again.

Re: Windows, svn propset svn:ignore *

Posted by Branko Čibej <br...@apache.org>.
On 28.08.2022 14:39, Daniel Sahlberg wrote:
> Den fre 26 aug. 2022 kl 15:13 skrev Jon Daley 
> <su...@jon.limedaley.com>:
>
>     I don't use Windows, so I can't help you on the escaping of the *,
>     but I
>     often use propedit, rather than propset (partly because I can never
>     remember the order of the directory and the property value), so
>     that would
>     be easy enough for a one-off solution.
>
>     Also, if you are using TortoiseSVN, can't you just right-click the
>     directory and set the property that way and avoid the command-line
>     usage
>     entirely?
>
>
> I missed a critical point: This is run as part of an automated script 
> (a BAT file). Both the suggestions above work fine, except they 
> require manual input in the middle of the script which I'm trying to 
> avoid.
>
> Thanks for bringing up these options!
>
> /Daniel
>

Write the * to a temporary file and use 'svn propset -F'.

-- Brane

Re: Windows, svn propset svn:ignore *

Posted by Daniel Sahlberg <da...@gmail.com>.
Den fre 26 aug. 2022 kl 15:13 skrev Jon Daley <subversion@jon.limedaley.com
>:

> I don't use Windows, so I can't help you on the escaping of the *, but I
> often use propedit, rather than propset (partly because I can never
> remember the order of the directory and the property value), so that would
> be easy enough for a one-off solution.
>
> Also, if you are using TortoiseSVN, can't you just right-click the
> directory and set the property that way and avoid the command-line usage
> entirely?
>

I missed a critical point: This is run as part of an automated script (a
BAT file). Both the suggestions above work fine, except they require manual
input in the middle of the script which I'm trying to avoid.

Thanks for bringing up these options!

/Daniel

Re: Windows, svn propset svn:ignore *

Posted by Jon Daley via users <us...@subversion.apache.org>.
I don't use Windows, so I can't help you on the escaping of the *, but I 
often use propedit, rather than propset (partly because I can never 
remember the order of the directory and the property value), so that would 
be easy enough for a one-off solution.

Also, if you are using TortoiseSVN, can't you just right-click the 
directory and set the property that way and avoid the command-line usage 
entirely?

On Fri, 26 Aug 2022, Daniel Sahlberg wrote:

> Hi,
>
> Using Subversion "trunk" on Windows built from TortoiseSVN.
>
> I would like to set the svn:ignore property to * on a certain directory.
> (I'm trying to ignore everything since I'd only want to explicitly add a
> few subdirectories).
>
> I thought this would do the trick
> C:\wc>svn propset svn:ignore * directoryname
>
> But alas it expands the * to all files in the current directory. I'd like
> to quote the * so the property is set to exactly *. I've found ways to
> quote the * (for example '*') but in those cases the property is set to
> also include the quotes.
>
> I've digged around and found a few messages in the archive indicating that
> Subversion on Windows is using setargv.obj and then the following thread on
> Stackoverflow [1] indicating that setargv.obj doesn't have a way to avoid
> wildcard expansion.
>
> Does anyone have a trick up the sleve?
>
> The following seems to work but it feels a bit unintuitive:
> echo * | svn propset -F - svn:ignore directoryname
>
> Kind regards,
> Daniel
>
> [1]
> https://stackoverflow.com/questions/47512829/is-it-possible-to-quote-escape-command-line-arguments-on-windows-while-linking-s
>

-- 
Jon Daley
https://jon.limedaley.com
~~
You're just jealous because the voices are talking to me.