darcs

Issue 1158 --match and --patch are silently mutually exclusive

Title --match and --patch are silently mutually exclusive
Priority bug Status needs-implementation
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, galbolle, jaredj, kowey
Assigned To
Topics Matchers, ProbablyEasy, UI

Created on 2008-10-23.13:17:24 by galbolle, last changed 2010-03-31.13:12:02 by kowey.

Messages
msg6396 (view) Author: galbolle Date: 2008-10-23.13:17:22
When using darcs pull --match xx --patch yy, darcs behaves like
darcs pull --match xx.

On the other hand, darcs pull --patch yy --match xx behaves like 
darcs pull --patch yy.

I would expect both commands to have the same result, that is 'and' the two
matches, or at least give a warning.
msg6397 (view) Author: dagit Date: 2008-10-23.13:31:28
On Thu, Oct 23, 2008 at 6:17 AM, Florent Becker <bugs@darcs.net> wrote:
>
> New submission from Florent Becker <florent.becker@ens-lyon.org>:
>
> When using darcs pull --match xx --patch yy, darcs behaves like
> darcs pull --match xx.
>
> On the other hand, darcs pull --patch yy --match xx behaves like
> darcs pull --patch yy.
>
> I would expect both commands to have the same result, that is 'and' the two
> matches, or at least give a warning.

Additionally I could see the user meaning 'or'.  This is a case where
what we probably want is to have a little query language.  Like how
the find command has switches like -o.

Hmm...This requires more thought that I want to put towards it at the moment.

Thanks for the bug report!

Jason
msg8083 (view) Author: kowey Date: 2009-08-11.00:16:24
I'll bet --match xx --match yy suffers the same way.

I think it's reasonable to change the behaviour so that --match xx --match yy is
equivalent to --match "X && Y"
(which generalises to the --match --patch case)

This sounds easy to fix.  I'd recommend starting by writing tests for --match xx
--match yy, --patch xx --match yy and --match xx --match yy, as well as three
matches.

Please shout if you disagree with the proposed UI
History
Date User Action Args
2008-10-23 13:17:24galbollecreate
2008-10-23 13:31:30dagitsetstatus: unread -> unknown
nosy: kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, galbolle
messages: + msg6397
2009-08-10 23:48:51adminsetnosy: - dagit
2009-08-11 00:10:35koweysettopic: + UI
nosy: kowey, simon, thorkilnaur, dmitry.kurochkin, galbolle
2009-08-11 00:16:32koweysetstatus: unknown -> needs-implementation
nosy: + jaredj
topic: + ProbablyEasy
messages: + msg8083
2009-08-18 00:25:38koweysettopic: + Matchers
nosy: kowey, simon, thorkilnaur, jaredj, dmitry.kurochkin, galbolle
2009-08-25 17:31:48adminsetnosy: + darcs-devel, - simon
2009-08-27 09:01:22koweysetnosy: kowey, darcs-devel, thorkilnaur, jaredj, dmitry.kurochkin, galbolle
2009-08-27 14:25:54adminsetnosy: kowey, darcs-devel, thorkilnaur, jaredj, dmitry.kurochkin, galbolle
2010-03-31 13:12:02koweysetnosy: - thorkilnaur