[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Regexp support for svn:ignore

From: Osku Salerma <osku_at_iki.fi>
Date: 2006-06-17 14:22:04 CEST

The attached patch adds support for regexps in svn:ignore patterns. Since
'/' is not a valid character in the current glob matching, any line in
svn:ignore starting with '/' can be interpreted as a regexp. The syntax
is:

/pattern/flags

The only flag currently supported is 'i', which means case-insensitive.

Before matching, the pattern is modified to start with '^' and end with
'$' so that filenames only match if they match completely, for consistency
with the glob matching.

An example use case for the feature: I have a directory on a www site that
I keep under svn that contains both manually edited files, auto-generated
files, and various generator programs. I want all auto-generated files (of
which there are an unbounded number) to be in svn:ignore, but I can't do
it with the current glob matching, since it's not powerful enough. With
regexps, it's easy.

The patch is more or less a proof-of-concept, with at least the following
issues to be decided/solved before it can be finished:

* Do we even want to add a new dependency for a regexp library?

* If so, which one? My patch uses PCRE (www.pcre.org), which seems to be
  the most popular one, e.g. Apache uses it.

* If we use PCRE, how do we handle
  http://issues.apache.org/bugzilla/show_bug.cgi?id=27550 ? Apache bundles
  its own version of PCRE, and if an Apache module links to an external
  PCRE, there are problems. I assume mod_dav_svn would be affected by
  this. The bug report claims it's fixed in Apache 2.1, but I suppose we
  must support Apache 2.0.

* My patch adds the PCRE library globally to all executables, even though
  only libsvn_wc (currently) needs it. Do we want to make it a global
  dependency or not?

* Windows buildsystem needs to be modified.

* Error handling. The attached patch dies on errors (invalid regexp,
  invalid UTF-8, etc). Do we want to silently ignore errors, modify
  svn_wc_match_ignore_list to return possible errors, or what?

* Do we need to test that PCRE was compiled with UTF-8 support enabled? If
  so, at configure time, at run-time, or both?

Opinions?

--
Osku Salerma - osku_at_iki.fi - http://www.oskusoft.com/osku/


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

Received on Sat Jun 17 14:22:43 2006

This is an archived mail posted to the Subversion Dev mailing list.