darcs

Issue 1116 reject multiple --from- matchers on command line

Title reject multiple --from- matchers on command line
Priority bug Status given-up
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur
Assigned To
Topics Matchers, UI

Created on 2008-10-02.10:13:54 by kowey, last changed 2017-07-30.23:02:47 by gh.

Messages
msg6198 (view) Author: kowey Date: 2008-10-02.10:13:53
In the darcs darcs repository

darcs unpull  --from-match='author mornfall' --from-tag=2.0.2
darcs: bug in darcs!
Failure commuting patches in commute_by called by gpit!

We need to determine if this is a regression, first of all..
msg6201 (view) Author: dmitry.kurochkin Date: 2008-10-02.15:25:24
I tried with 2.0.2 and it fails too. Did not try with older versions.

The problem seems to be that darcs expects to have only one of from-match,
from-patch or from-tag flags. If we have both and from-tag goes after
from-match, in match_first_patchset function (called from get_last_patches) we
get the following:

- first_matcher is called, and returns matcher for from-match option.
- but first_matcher_is_tag - returns true because we have from-tag in options.
- so get_matching_tag is called with matcher for from-match and not for from-tag.

I hope you are able to understand my explanation :)

Unfortunately I do not know darcs internals enough to understand why exactly
failure happens. But if I replace first_matcher_tag call with False in
match_first_patchset darcs does not fail. And just ignores from-tag.

I see several ways to fix this:
- make first_matcher_is_tag work correctly when several from- options given
- complain and exit if more than one from- options are given

My understanding is that latter is the correct solution - several from- options
do not make sense.

In Darcs.Arguments match_from is defined as multiple choice option. AFAIK this
means that only one option from it should be specified. So maybe we should make
options parser to exit when there are several options from a single multiple
choice group given?

Regards,
  Dmitry
msg8222 (view) Author: kowey Date: 2009-08-17.23:55:42
For what it's worth, I think I was trying to unpull patches by mornfall but only
up to the 2.0.2 tag. So one possible interpretation might be to think of tags as
somehow being special or wider matchers.  But maybe that's just my intuition and
not actually how things should work.

Rejecting multiple --from- matchers in the UI sounds like a plan, so I'm marking
this need-implementation.  Thanks for the analysis, Dmitry!
History
Date User Action Args
2008-10-02 10:13:54koweycreate
2008-10-02 15:25:26dmitry.kurochkinsetstatus: unread -> unknown
nosy: + dmitry.kurochkin
messages: + msg6201
2009-08-10 23:47:06adminsetnosy: - dagit
2009-08-17 23:55:48koweysetstatus: unknown -> needs-implementation
nosy: kowey, simon, thorkilnaur, dmitry.kurochkin
topic: + UI, Matchers
messages: + msg8222
2009-08-25 17:29:59adminsetnosy: + darcs-devel, - simon
2009-08-26 15:20:21koweysetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin
2009-08-26 15:20:48koweysetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin
title: obliterate => Failure commuting patches in commute_by called by gpit! (2.1.0pre2) -> reject multiple --from- matchers on command line
2009-08-27 14:33:26adminsetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin
2017-07-30 23:02:47ghsetstatus: needs-implementation -> given-up