Re: (SVN-4784) auto-props cannot match filename patterns starting with [

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: (SVN-4784) auto-props cannot match filename patterns starting with [

Julian Foad-5
https://issues.apache.org/jira/browse/SVN-4784

Branko Čibej wrote:
> 2. Introduce an anchor character for auto-props patterns:
> * if the pattern begins with a single caret "{{\^}}", remove that caret from the pattern;
> * if the pattern begins with a double caret "{{\^\^}}", replace it with a single caret "{{\^}}".

Before we consider that, what about the following part of stsp's report?

>> Indenting "[Dd]ockerfile" by one space...

>> [auto-props]
>> *.[Yy][Aa][Mm][Ll] = svn:needs-lock[...]
>>  [Dd]ockerfile = svn:keywords=Date[...]

>> The above makes the dockerfile entry a continuation line for the previous line,
>> and this continuation line seems to be ignored.

So what's up here? At what level is it ignored? Could we use indentation to solve the problem, and could it work even for the first line after the section header?

--
- Julian
Reply | Threaded
Open this post in threaded view
|

Re: (SVN-4784) auto-props cannot match filename patterns starting with [

Branko Čibej
On 06.12.2018 11:15, Julian Foad wrote:

> https://issues.apache.org/jira/browse/SVN-4784
>
> Branko Čibej wrote:
>> 2. Introduce an anchor character for auto-props patterns:
>> * if the pattern begins with a single caret "{{\^}}", remove that caret from the pattern;
>> * if the pattern begins with a double caret "{{\^\^}}", replace it with a single caret "{{\^}}".
> Before we consider that, what about the following part of stsp's report?
>
>>> Indenting "[Dd]ockerfile" by one space...
>>> [auto-props]
>>> *.[Yy][Aa][Mm][Ll] = svn:needs-lock[...]
>>>  [Dd]ockerfile = svn:keywords=Date[...]
>>> The above makes the dockerfile entry a continuation line for the previous line,
>>> and this continuation line seems to be ignored.
> So what's up here? At what level is it ignored?

That's for the OP to figure out, but I predict that the auto-props code
is responsible for whatever is happening.

> Could we use indentation to solve the problem, and could it work even for the first line after the section header?

No! Trying to retrofit exceptions for indentation would a) terminally
mess up the parser and b) make the files incompatible with 3rd-party
parsers.

FWIW, Adding an anchor mechanism for the auto-props definitions in
~/.subversion/config is no more disruptive than making rules in authz
files case-sensitive (see 1.7 release notes).

-- Brane

P.S.: I instrumented the code and the result pretty much confirms that
whatever is happening is happening in the auto-props parser.

In ~/.subversion/config:

[auto-props]
*.[Yy][Aa][Mm][Ll] = svn:needs-lock=true
 [Dd]ockerfile=svn:keywords=Date[...]


Then, with the instrumented client:

$ /Volumes/svn-test/trunk/subversion/svn/svn add wc/foo.yaml
[auto-props]*.[Yy][Aa][Mm][Ll] = svn:needs-lock=true [Dd]ockerfile=svn:keywords=Date[...]
auto-props for foo.yaml: svn:needs-lock=*
A         wc/foo.yaml


The first line comes from libsvn_subr/config_file.c:add_value(), the
second from libsvn_client/add.c:get_auto_props_for_pattern().

In other words, the config parser is working as expected and whatever
the auto-props parser is doing is a mystery to me, but note that
auto-props entries should be delimited with ';'.