Re: path = not supporting *

Sebastian Schleussner <[email protected]> Fri, 19 Jul 2024 03:55:01 -0700 (PDT)
Newsgroups gmane.network.unison.general
Message-ID <[email protected]>
As far as I can see, all Unison settings accepting wildcards or regular 
expressions, require PathSpec-type arguments that start with "Name", 
"Path", "Regex", or "BelowPath".
"path" is in another class together with "root", "include", "force", and 
"prefer".

Changing the "path" setting to do the same as "ignore" and so on would 
break countless profiles in the wild.
Changing the "path" setting to support wildcards without a keyword like 
"Path" would introduce inconsistency into the syntax, and limit those who 
want to use full regular expressions.
Making the keyword optional would provoke strange behaviour/error messages 
if someone does want to sync a path such as "Name"...

One solution to avoid breaking backward compatibility would be to introduce 
a new setting such as "consider" that takes a PathSpec.
That would really only be syntactic sugar for the current solution, which 
is a pair of instructions like
    ignore = Path *
   # ^^ (an implementation would have to ensure that this is done only once 
and before any explicitly defined "ignorenot"s so as not to override them)
    ...
    ignorenot = Path <pattern>

Personally, I am quite happy with the 'reason-ability' of a list of 
"ignore"s and "ignorenot"s.
But I guess it wouldn't hurt to add an alternative that is more intuitive 
for some, iff it keeps the existing syntax working.


On Friday 19 July 2024 at 12:11:18 UTC+2 Tõivo Leedjärv wrote:

On Thu, 18 Jul 2024 at 14:42, Greg Troxel <[email protected]> wrote: 
> 
> The documentation says it should work, I think. This is something that 
> I think if it didn't in general, would have been reported, probably. 

I don't think it works. Though not mentioning anything about 
wildcards, this is what the documentation states: 
Note that path preferences are interpreted literally—they are not 
regular expressions. 

Interestingly, there _is_ code to expand path values in form of 
"dir/*" but not in form of "dir*". I don't know why that is and 
whether making the latter form work would cause any issues. 

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].