Martin Furter <mf@rola.ch> writes:
> I made a little patch which adds a new feature: automatic adding of
> properties when adding files.
I like this idea in general, but I think it has some problems.
> Attached is a patch for subversion/libsvn_client/add.c
Please include a log message when you send a patch, see the HACKING
file.
> After adding the patch you can define a new section in
> ~/.subversion/config and add entries describing the properties.
>
> There are 3 types of entries: exact matches, suffix matches and the
> default.
> Exact matches have the highest priority, the default match the lowest. The
> longer a suffix match is the higher it's priority.
I see you are implementing the pattern matching manually. Did you
choose the above rules because they were simple to implement? Are you
aware of apr_fnmatch, as used in svn_string.c? I think I'd prefer an
ordered list, with full apr_fnmatch pattern matching, where the first
list element to match is used. However, I'm not sure if the current
config file mechanism supports such an ordered list.
> Here is an example config:
>
> [auto-props]
> * = svn:executable
> *.txt = svn:eol-style=native
> *.old.txt =
> *.sh = svn:eol-style=LF;svn:executable
> README.old.txt = svn:eol-style=CRLF
> Makefile = svn:eol-style=LF
Users are going to want to use this feature to set svn:ignore, but it
doesn't look like that will work since svn:ignore generally has a
multi-line value. I suppose a space separated list could be used
above (like global-ignores), but then the code is going to have to
convert spaces into newlines for this particular "magic" property.
I wonder if separate lists for files and directories are required?
Taking your example above, if you try to set svn:executable on a
directory using the current command line client you will get an
"Illegal target" error. I suspect users may also want to set
svn:keywords, and again that property doesn't apply to directories, so
putting it in your '*' rule will cause problems.
> The format of the properties is name=value;name=value;...
> For boolean properties only the name is specified.
>
> I think this simple feature is enough for 99% of the use cases, making it
> more complex would also make the config more complex and less human
> readable.
I'd like this feature to provide better support for svn:ignore and
svn:keywords.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 18 00:38:04 2003