Quirk with svn:ignore
I ran into an unexpected behavior with svn:ignore today and wanted to see if someone can verify whether this is a bug (in the current version) or just an aspect of how Subversion works. We're still on 1.6x. Given a tree with trunk + cache + htdocs + logs + system I have tried putting cd trunk svn propset svn:ignore logs/* . ...ignore everything in the *logs* directory, but the svn:ignore propset is on *trunk*. This doesn't work -- that is, log files are not ignored as expected, but shown as new files when running the project and svn status However, cd logs svn propset svn:ignore * . ...setting svn:ignore * on logs, works. For what it's worth, externals works fine this way, e.g. cd trunk svn propset svn:externals some/arbitrary/directory http://svn-server/repo/folder . // some/arbitrary/directory is created from the externally referenced svn-server/repo/folder as expected We were hoping to set all our externals and ignores on the trunk level rather than sprinkling them throughout our project, but it doesn't seem possible. -- This email, including any attachments, is for the sole use of the intended recipient and may contain confidential information. If you are not the intended recipient, please immediately notify us by reply email or by telephone, delete this email and destroy any copies. Thank you.
Re: Quirk with svn:ignore
On 19/03/12 16:26, Geoff Hoffman wrote: I ran into an unexpected behavior with svn:ignore today and wanted to see if someone can verify whether this is a bug (in the current version) or just an aspect of how Subversion works. We're still on 1.6x. Given a tree with trunk + cache + htdocs + logs + system I have tried putting cd trunk svn propset svn:ignore logs/* . ...ignore everything in the /logs/ directory, but the svn:ignore propset is on /trunk/. This doesn't work -- that is, log files are not ignored as expected, but shown as new files when running the project and svn status Do you mean that the files are shown with an A in the first column? If so, I don't think Subversion should ignore something that has been specifically added. Try to revert the addition, svn revert --depth infinity logs, and then set the svn:ignore property again. Giulio
Re: Quirk with svn:ignore
On Mon, Mar 19, 2012 at 12:26, Geoff Hoffman ghoff...@cardinalpath.com wrote: I ran into an unexpected behavior with svn:ignore today and wanted to see if someone can verify whether this is a bug (in the current version) or just an aspect of how Subversion works. We're still on 1.6x. Given a tree with trunk + cache + htdocs + logs + system I have tried putting cd trunk svn propset svn:ignore logs/* . ...ignore everything in the logs directory, but the svn:ignore propset is on trunk. This doesn't work -- that is, log files are not ignored as expected, but shown as new files when running the project and svn status However, cd logs svn propset svn:ignore * . ...setting svn:ignore * on logs, works. In the first example, your shell is expanding logs/* to a list of all the items in that directory, and svn dutifully sets the property on the current directory (.) to that (very long) value.
Re: Quirk with svn:ignore
On Mon, Mar 19, 2012 at 12:26 PM, Geoff Hoffman ghoff...@cardinalpath.com wrote: I ran into an unexpected behavior with svn:ignore today and wanted to see if someone can verify whether this is a bug (in the current version) or just an aspect of how Subversion works. We're still on 1.6x. Given a tree with trunk + cache + htdocs + logs + system I have tried putting cd trunk svn propset svn:ignore logs/* . ...ignore everything in the logs directory, but the svn:ignore propset is on trunk. This doesn't work -- that is, log files are not ignored as expected, but shown as new files when running the project and svn status However, cd logs svn propset svn:ignore * . ...setting svn:ignore * on logs, works. That is exactly how the feature is supposed to work. Described in book here: http://svnbook.red-bean.com/en/1.7/svn.advanced.props.special.ignore.html -- Thanks Mark Phippard http://markphip.blogspot.com/
Re: Quirk with svn:ignore
On Mon, Mar 19, 2012 at 9:32 AM, Giulio Troccoli giulio.trocc...@mediatelgroup.co.uk wrote: Do you mean that the files are shown with an A in the first column? No, they're shown as ? logs/error.log ? logs/access.log But they're not automagically ignored, even though they match logs/* which successfully is applied as an svn:ignore pattern on trunk. On Mon, Mar 19, 2012 at 9:35 AM, Mark Phippard markp...@gmail.com wrote: That is exactly how the feature is supposed to work. Described in book here: http://svnbook.red-bean.com/en/1.7/svn.advanced.props.special.ignore.html Mark, I believe you, however I don't see which part of the docs you link to addresses this case... This part: * Matches any string of characters, including the empty string indicates it should work regardless where it's used. And this part: [image: [Tip]] Even if svn:ignore is set, you may run into problems if you use shell wildcards in a command. Shell wildcards are expanded into an explicit list of targets before Subversion operates on them, so running *svn SUBCOMMAND ** is just like running *svn SUBCOMMAND file1 file2 file3* indicates that even cd logs svn propset svn:ignore * . should fail if there are no files inside of logs, correct? But it doesn't fail it works in that case. It seems to me that if my shell is indeed expanding asterisk character to a list of files to ignore, then ignore * on logs should fail similarly until explicit files are there to pass to svn:ignore command. I'm attempting to ignore all future files folders, *, inside a folder that is empty, before any files exist inside it. It's always worked for me just putting ignore * on logs folder directly, I just never tried putting it one level up before and was kind of confused as to why it didn't work. -- This email, including any attachments, is for the sole use of the intended recipient and may contain confidential information. If you are not the intended recipient, please immediately notify us by reply email or by telephone, delete this email and destroy any copies. Thank you.
Re: Quirk with svn:ignore
On Mon, Mar 19, 2012 at 1:11 PM, Geoff Hoffman ghoff...@cardinalpath.comwrote: Mark, I believe you, however I don't see which part of the docs you link to addresses this case... This part: When found on a versioned directory, the svn:ignore property is expected to contain a list of newline-delimited file patterns that Subversion should use to determine ignorable objects in that same directory. -- Thanks Mark Phippard http://markphip.blogspot.com/
Re: Quirk with svn:ignore
Ahhh Rats. Thanks I missed that. On Mon, Mar 19, 2012 at 10:13 AM, Mark Phippard markp...@gmail.com wrote: in that same directory. -- This email, including any attachments, is for the sole use of the intended recipient and may contain confidential information. If you are not the intended recipient, please immediately notify us by reply email or by telephone, delete this email and destroy any copies. Thank you.
Re: Quirk with svn:ignore
On 19/03/12 17:11, Geoff Hoffman wrote: On Mon, Mar 19, 2012 at 9:32 AM, Giulio Troccoli giulio.trocc...@mediatelgroup.co.uk mailto:giulio.trocc...@mediatelgroup.co.uk wrote: Do you mean that the files are shown with an A in the first column? No, they're shown as ? logs/error.log ? logs/access.log But they're not automagically ignored, even though they match logs/* which successfully is applied as an svn:ignore pattern on trunk. Ok, have you tried ignoring just logs rather than all files, I mean svn ps svn:ignore logs ? As Andy said, the * is expanded by your shell, so basically you won't ignore future logs. G
Re: Quirk with svn:ignore
On Mon, Mar 19, 2012 at 10:16 AM, Giulio Troccoli giulio.trocc...@mediatelgroup.co.uk wrote: On 19/03/12 17:11, Geoff Hoffman wrote: On Mon, Mar 19, 2012 at 9:32 AM, Giulio Troccoli giulio.trocc...@mediatelgroup.co.uk wrote: Do you mean that the files are shown with an A in the first column? No, they're shown as ? logs/error.log ? logs/access.log But they're not automagically ignored, even though they match logs/* which successfully is applied as an svn:ignore pattern on trunk. Ok, have you tried ignoring just logs rather than all files, I mean svn ps svn:ignore logs ? As Andy said, the * is expanded by your shell, so basically you won't ignore future logs. G Yeah, Mark's right. svn:ignore is not designed to work anywhere other than the current directory. :-/ -- This email, including any attachments, is for the sole use of the intended recipient and may contain confidential information. If you are not the intended recipient, please immediately notify us by reply email or by telephone, delete this email and destroy any copies. Thank you.
Re: Quirk with svn:ignore
On Mar 19, 2012, at 12:16, Giulio Troccoli wrote: Ok, have you tried ignoring just logs rather than all files, I mean svn ps svn:ignore logs ? The logs directory has already been added and committed; telling Subversion to now ignore it will do nothing useful.
Re: Quirk with svn:ignore
On Mon, Mar 19, 2012 at 10:50 AM, Ryan Schmidt subversion-20...@ryandesign.com wrote: On Mar 19, 2012, at 12:16, Giulio Troccoli wrote: Ok, have you tried ignoring just logs rather than all files, I mean svn ps svn:ignore logs ? The logs directory has already been added and committed; telling Subversion to now ignore it will do nothing useful. Correct, Ryan. Mark nailed it. Subversion can only ignore patterns set on the current directory. Or, it doesn't traverse into subdirectories looking for files to ignore, even if you specify a pattern with a directory separator in it... even if it seems totally logical that it should, and even though it accepts an ignore pattern with a directory separator in it. -- This email, including any attachments, is for the sole use of the intended recipient and may contain confidential information. If you are not the intended recipient, please immediately notify us by reply email or by telephone, delete this email and destroy any copies. Thank you.