[darcs-devel] [issue1158] --match and --patch are silently mutually exclusive

Ben Franksen bugs at darcs.net
Tue Jun 23 22:52:41 UTC 2015


Ben Franksen <benjamin.franksen at helmholtz-berlin.de> added the comment:

> 1/ hash (singular) exists but not hashes (plural). Is it OK ?

For hashes the match must always be exact (that's why you would use a
hash in the first place), so yes, plural makes no sense IMO.

2/ tag and tags come to the same options OneTag in module 
Darcs.UI.Options.Matching. Is it OK ?

I don't like it but this is how it works ATM. It is inconsistent at best
and misleading at worst. If it were my decision I would demote --tags to
an undocumented compatibility alias for --tag.

The real problem with --tag is that it is not an exact match by default.
I still think that regular expression matching for --tag is useless and
error prone. I have previously proposed a change in the UI but it was
voted down (IIRC) with the argument that the UI is more consistent as it is.

(To debunk the consistency argument: whenever I explain to casual darcs
users that --tag 2.1 is not enough you should use --tag '^2.1$' if you
want *exactly* version 2.1 because it might match the tag '2.1.1', they
shake their heads and stare at me in disbelief.)

3/ Do we considere an implicit "and" between each group ?

The groups I mentioned are not yet well-defined enough to make any
definite proposal based on them. There is --last and --index and so on
which do not fit this picture. Anyway, I think the general idea /
direction should go towards making all matching options mutually
exclusive. If you want to combine matchers, you can use a single match
with an elaborate match expression. That's what the --match etc are made
for.

4/ if not, add --or --and --not flags. But after the next problem is 
how to manage precedence without parenthesis ?

Exactly. And --match already supports all this. No need to repeat this
on the command line where we don't have the parsing capabilities etc.

5/ Could we add a syntactic suggar for "tag" <=> match "tag XXX" ?

It already is (AFAIK), no need to add anything.

----------
assignedto: alain91 -> 

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1158>
__________________________________


More information about the darcs-devel mailing list