You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Doug Gorley <do...@shaw.ca> on 2003/07/18 00:02:56 UTC

svn:ignore Question

G'day list,

Possibly newbie question: Can someone tell me why this file is not being
ignored?

(/home/www/temp/irmconference_website) $ svn proplist --verbose .
Properties on '':
  svn:ignore : .*.swp


(/home/www/temp/irmconference_website) $ svn status
?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp

Thanks,

-- 
Doug Gorley | douggorley@shaw.ca     OpenPGP Key ID: 0xA221559B
Fingerprint: D707 DB92 E64B 69DA B8C7  2F65 C5A9 5415 A221 559B
Interested in public-key cryptography?    http://www.gnupg.org/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Max Bowsher <ma...@ukf.net>.
Doug Gorley wrote:
> G'day list,
>
> Possibly newbie question: Can someone tell me why this file is not being
> ignored?
>
> (/home/www/temp/irmconference_website) $ svn proplist --verbose .
> Properties on '':
>   svn:ignore : .*.swp
>
>
> (/home/www/temp/irmconference_website) $ svn status
> ?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp

svn:ignore properties are NOT recursive. Examine the property value on
"branches/page_header_redesign/cgi-bin", not on ".".

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Russell Yanofsky <re...@columbia.edu>.
Jack Repenning wrote:
> ...
> But no way, Dr. Noam not withstanding, should we call this a "regular
> expression!"

Amen, Brother!

- Russ


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Jack Repenning <jr...@collab.net>.
At 9:33 AM +0200 7/22/03, Michael Wood wrote:
>On Mon, Jul 21, 2003 at 10:31:44AM -0400, Paul Lussier wrote:
>>  In a message dated: Fri, 18 Jul 2003 16:23:22 PDT
>>  Justin Erenkrantz said:
>>
>>  >Namely, I believe fnmatch doesn't support [xyz]* expressions.  I could be
>>  >wrong, but that's what the Solaris man page on fnmatch(5) leads me to
>  > >believe.
>  >

Whoah, there, hold on a bit.  Are these things actually patterns, not 
regular expressions?  The Book says "regular expressions' widely, if 
that's incorrect, we need to fix it.

I dunno about *your* man page, by *my* fnmatch(3) page begins "The 
fnmatch() function matches patterns according to the rules used by 
the shell," a two-part attempt to clearly distinguish which sorts of 
expressions it matches: "patterns" and "like the shell."  Indeed, I 
daresay the 'fn" there is meant to imply "file name," making three 
separate claims.  (Never mind that there are many shells, with some 
variation in what they actually match....)  If SVN uses fnmatch(), 
then it appears to be matching _patterns_, not _regular_expressions_.

More detail than you ever wanted to know: a language theorist will 
tell you that both these things are "regular expressions," or more 
precisely "expressions from a regular language."  Ultimately, this is 
grounded in something called "The Chomsky Hierarchy," a way of 
classifying the complexity of languages, defined by the noted 
linguist and anti-war demonstrator Noam Chomsky. Somehow, Unix got 
into the very  messy state that editors (and other programs based on 
editors, like grep) were using one kind of regular expressions, while 
shells (indeed, "the shell" back then) were using another.  POSIX, in 
trying to unravel this skein of confusion, invented the term 
"pattern" for the sort of regular expression the shells use, and 
reserves the phrase "regular expression" for the sort of regular 
expression that editors use.  As has elsewhere been mentioned, the 
convention is that "patterns" are used on file names, while "regular 
expressions" are used on (any other kind of) strings. About the same 
time, someone (might have been Bill Joy, in writing the csh, one of 
the first widely popular "other" shells) invented the term "glob" for 
what POSIX called "pattern," again leaving the language-theoretical 
term "regular expression" for "that thing the editors do."  So now, 
instead of one term for two things, we have three, which may not be 
entirely an improvement.

The POSIX terms don't seem entirely to have caught on (for example, 
Perl also has "globbing" and "regular expressions," but also has 
"patterns" which--oh, dear!--are regular expressions, not globs).  I 
don't know of anyone who uses "glob" to mean "that thing editors do." 
So I suppose we can choose to bow to docmented standards (POSIX 
patterns and regular expressions), or to bow to the closest approach 
to consensus (globs and regular expressions).

But no way, Dr. Noam not withstanding, should we call this a "regular 
expression!"
-- 
-==-
Jack Repenning
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
o: 650.228.2562
c: 408.835-8090

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Philip Martin <ph...@codematters.co.uk>.
Paul Lussier <pl...@lanminds.com> writes:

> Great.  So, APR supports character classes.  Does it also support 
> ranges?  My cursory look at that file seems to indicate that it does.
> If so, then why doesn't '[0-9]*' work in my svn:ignore ?

$ svnadmin create repo
$ svn co file://`pwd`/repo wc
$ touch wc/1 wc/2foo wc/bar wc/zig3zag
$ svn st wc
?      wc/1
?      wc/2foo
?      wc/bar
?      wc/zig3zag
$ svn ps svn:ignore '[0-9]*' wc
$ svn st wc
 M     wc
?      wc/bar
?      wc/zig3zag

That appears to work.  Do you get different behaviour?  What do you
expect '[0-9]*' to match?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Tue, 22 Jul 2003 09:33:21 +0200
Michael Wood said:

>Paul, you are confusing shell globbing with regular expressions.  They
>are not the same thing (although shell globbing is sometimes incorrectly
>referred to as regular expression matching.)

No, I wasn't.  I know the difference :)

>I agree that glob(7) does imply that character classes are part of POSIX,
>in which case, I would expect APR to support them.

That was exactly my point.  Reading the fnmatch man page lead to the 
glob man page, which pointed out that globbing != regex, but that 
chatacter classes/ranges are part of POSIX.

>A brief look at src/apr/strings/apr_fnmatch.c implies that APR does
>indeed support them.

Great.  So, APR supports character classes.  Does it also support 
ranges?  My cursory look at that file seems to indicate that it does.
If so, then why doesn't '[0-9]*' work in my svn:ignore ?


-- 

Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE

	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Michael Wood <mw...@its.uct.ac.za>.
On Mon, Jul 21, 2003 at 10:31:44AM -0400, Paul Lussier wrote:
> In a message dated: Fri, 18 Jul 2003 16:23:22 PDT
> Justin Erenkrantz said:
> 
> >Namely, I believe fnmatch doesn't support [xyz]* expressions.  I could be 
> >wrong, but that's what the Solaris man page on fnmatch(5) leads me to 
> >believe.
> 
> Prior to your explanation, I had no knowledge of how svn dealt with 
> regexes.  However, after reading the man page for fnmatch(3) for 
> Linux, I find that it simply states:
[snip]
> NOTES
>    Regular expressions
>        Note  that  wildcard patterns are not regular expressions,
>        although they are a bit similar. First of all, they  match
>        filenames, rather than text, and secondly, the conventions
>        are not the same: e.g., in a regular expression `*'  means
>        zero or more copies of the preceding thing.
> 
>        Now  that  regular  expressions  have  bracket expressions
>        where the negation  is  indicated  by  a  `^',  POSIX  has
>        declared  the  effect of a wildcard pattern `[^...]' to be
>        undefined.
> 
> So, IMO, [m-n]* _should_ work, but the above leads me to believe that 
> it might not :)

Paul, you are confusing shell globbing with regular expressions.  They
are not the same thing (although shell globbing is sometimes incorrectly
referred to as regular expression matching.)

e.g., The wildcard pattern, *.* would match any filename containing at
least one dot (except for a filename beginning with a dot) but it is NOT
a valid regular expression.  DOS filename wildcard patterns are similar,
but different.  An equivalent perl compatible regular expression would
be:
^[^.]+\..*$ (but this is not the only way to write it.)

Written using regular expressions you might find in a Computer Science
theory text book the above would look horrendously long, since it would
have explicitly to mention every character that it is possible to
include in a filename.  Assuming only the characters "a", "b" and "."
can appear in a filename, it might look like this:
(a + b)(a + b)* . (a + b + .)*
(where the asterisks are superscripted.)

> Anyone know for certain either way?

You're talking about two separate, but vaguely similar things :)  I
agree that glob(7) does imply that character classes are part of POSIX,
in which case, I would expect APR to support them.

A brief look at src/apr/strings/apr_fnmatch.c implies that APR does
indeed support them.

-- 
Michael Wood <mw...@its.uct.ac.za>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Fri, 18 Jul 2003 16:23:22 PDT
Justin Erenkrantz said:

>Namely, I believe fnmatch doesn't support [xyz]* expressions.  I could be 
>wrong, but that's what the Solaris man page on fnmatch(5) leads me to 
>believe.

Prior to your explanation, I had no knowledge of how svn dealt with 
regexes.  However, after reading the man page for fnmatch(3) for 
Linux, I find that it simply states:

    The  fnmatch() function checks whether the string argument
    matches the pattern argument, which is  a  shell  wildcard
    pattern.

So, if it's a 'shell wildcard pattern' then it *should* support 
character class ( [n-m]* ) expressions.  Since (on linux) fnmatch(3) 
refers to glob(7), I reviewed that man page, which says:

   The rules are as follows (POSIX 1003.2, 3.13).       

  WILDCARD MATCHING
   Character classes
     An  expression `[...]' where the first character after the
     leading `[' is not an  `!'  matches  a  single  character,
     namely  any  of  the  characters enclosed by the brackets.
     ...
	
   Ranges
     There  is one special convention: two characters separated
     by `-' denote a range.
     ...

Which seems to indicate it *should* handle character classes and 
ranges.  However, glob(3) also goes on to say:

NOTES
   Regular expressions
       Note  that  wildcard patterns are not regular expressions,
       although they are a bit similar. First of all, they  match
       filenames, rather than text, and secondly, the conventions
       are not the same: e.g., in a regular expression `*'  means
       zero or more copies of the preceding thing.

       Now  that  regular  expressions  have  bracket expressions
       where the negation  is  indicated  by  a  `^',  POSIX  has
       declared  the  effect of a wildcard pattern `[^...]' to be
       undefined.

So, IMO, [m-n]* _should_ work, but the above leads me to believe that 
it might not :)

Anyone know for certain either way?
-- 

Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE

	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Friday, July 18, 2003 12:41:25 -0400 Paul Lussier <pl...@lanminds.com> 
wrote:

> It wouldn't surprise me if APR's regex matcher were buggy.  This
> discussion just reminded me of a problem I ran into a while back but
> then found a work-around for.

I meant to reply to this earlier, but APR doesn't have a regex matcher. 
httpd uses PCRE for its regular expressions.

You are probably confusing it with apr_fnmatch (which is, indeed, what 
libsvn_subr uses), but that doesn't interpret regular expressions.  It's a 
follows the POSIX fnmatch characteristics not POSIX regular expressions.

Namely, I believe fnmatch doesn't support [xyz]* expressions.  I could be 
wrong, but that's what the Solaris man page on fnmatch(5) leads me to 
believe.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: 17 Jul 2003 19:11:17 CDT
Ben Collins-Sussman said:

>> (/home/www/temp/irmconference_website) $ svn status
>> ?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp
>
>Try '*.swp' instead?   Maybe you've found a bug in APR's regex matcher...

It wouldn't surprise me if APR's regex matcher were buggy.  This 
discussion just reminded me of a problem I ran into a while back but 
then found a work-around for.

I have my homedir under svn.  Since I use exmh for my mail, I don't 
want to version all the mail, just the config files maintained for 
each folder (in mh, folder==directory, mail==file).

As a result, I *thought* I could get away with svn:ignore set to 
something like:

    ,*
    [0-9]*

No such luck.  I had to resort to:

    ,*
    [0-9]*
    0*
    1*
    2*
    3*
    4*
    5*
    6*
    7*
    8*
    9*
    */0*
    */1*
    */2*
    */3*
    */4*
    */5*
    */6*
    */7*
    */8*
    */9*

set recursively on my Mail dir. 

Where can I find docs on APR's regex engine?
-- 

Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE

	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Philip Martin <ph...@codematters.co.uk>.
Doug Gorley <do...@shaw.ca> writes:

> On Thu, 2003-07-17 at 17:40, Philip Martin wrote:
>> Ben Collins-Sussman <su...@collab.net> writes:
>> 
>> > Doug Gorley <do...@shaw.ca> writes:
>> >> 
>> >> (/home/www/temp/irmconference_website) $ svn proplist --verbose .
>> >> Properties on '':
>> >>   svn:ignore : .*.swp
>> >> 
>> >> (/home/www/temp/irmconference_website) $ svn status
>> >> ?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp
>> 
>> Huh?  Did you really type 'svn status' with no path and get a path
>> with several directories in the output?  Perhaps you really ran
>> 'svn status branches/page_header_redesign/cgi-bin', in which case you
>> need to set svn:ignore on that directory.

Ignore that, I don't know what I was thinking last night!

> Sure did; I ran 'svn status' from the root of my working directory; the
> only file that had been updated was buried 3 subdirs below.

Setting svn:ignore on a directory only affects items in that
directory, not items in sub-directories.  You have shown that
svn:ignore is set on '.', but I suspect it is not set on the
sub-directory 'branches/page_header_redesign/cgi-bin'?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Doug Gorley <do...@shaw.ca>.
On Thu, 2003-07-17 at 17:40, Philip Martin wrote:
> Ben Collins-Sussman <su...@collab.net> writes:
> 
> > Doug Gorley <do...@shaw.ca> writes:
> >> 
> >> (/home/www/temp/irmconference_website) $ svn proplist --verbose .
> >> Properties on '':
> >>   svn:ignore : .*.swp
> >> 
> >> (/home/www/temp/irmconference_website) $ svn status
> >> ?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp
> 
> Huh?  Did you really type 'svn status' with no path and get a path
> with several directories in the output?  Perhaps you really ran
> 'svn status branches/page_header_redesign/cgi-bin', in which case you
> need to set svn:ignore on that directory.

Sure did; I ran 'svn status' from the root of my working directory; the
only file that had been updated was buried 3 subdirs below.

> > Try '*.swp' instead?   Maybe you've found a bug in APR's regex matcher...
> 
> '.*.swp' works as expected on my system.  Doug, if the answer is not
> the path issue above, then perhaps you have trailing white-space in
> the property.  Try
> 
> $ svn pg svn:ignore | od -c

Here's what I get:

0000000   .   *   .   s   w   p  \n  \n
0000010

BTW, I'm using v0.23, so I suppose I should upgrade and try again, but
it still seems odd to me.  :-(

-- 
Doug Gorley | douggorley@shaw.ca     OpenPGP Key ID: 0xA221559B
Fingerprint: D707 DB92 E64B 69DA B8C7  2F65 C5A9 5415 A221 559B
Interested in public-key cryptography?    http://www.gnupg.org/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Philip Martin <ph...@codematters.co.uk>.
Ben Collins-Sussman <su...@collab.net> writes:

> Doug Gorley <do...@shaw.ca> writes:
>> 
>> (/home/www/temp/irmconference_website) $ svn proplist --verbose .
>> Properties on '':
>>   svn:ignore : .*.swp
>> 
>> (/home/www/temp/irmconference_website) $ svn status
>> ?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp

Huh?  Did you really type 'svn status' with no path and get a path
with several directories in the output?  Perhaps you really ran
'svn status branches/page_header_redesign/cgi-bin', in which case you
need to set svn:ignore on that directory.

> Try '*.swp' instead?   Maybe you've found a bug in APR's regex matcher...

'.*.swp' works as expected on my system.  Doug, if the answer is not
the path issue above, then perhaps you have trailing white-space in
the property.  Try

$ svn pg svn:ignore | od -c

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Ben Collins-Sussman <su...@collab.net>.
Doug Gorley <do...@shaw.ca> writes:

> G'day list,
> 
> Possibly newbie question: Can someone tell me why this file is not being
> ignored?
> 
> (/home/www/temp/irmconference_website) $ svn proplist --verbose .
> Properties on '':
>   svn:ignore : .*.swp
> 
> 
> (/home/www/temp/irmconference_website) $ svn status
> ?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp

Try '*.swp' instead?   Maybe you've found a bug in APR's regex matcher...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:ignore Question

Posted by Thomas Lohmueller <th...@lohmueller.ch>.
Hi

I think what you are looking for is a global ignore.

Just add the following lines to (or uncomment them in) ~/.subversion/config. 
This will ignore every .*.swp in every subversion-directory.

[miscellany]
global-ignores =.*.swp

There are examples in this file.

Thomas

On Friday 18 July 2003 02:02, Doug Gorley wrote:
> G'day list,
>
> Possibly newbie question: Can someone tell me why this file is not being
> ignored?
>
> (/home/www/temp/irmconference_website) $ svn proplist --verbose .
> Properties on '':
>   svn:ignore : .*.swp
>
>
> (/home/www/temp/irmconference_website) $ svn status
> ?  branches/page_header_redesign/cgi-bin/.process_registration.cgi.swp
>
> Thanks,


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org