[darcs-devel] [issue2063] Inconsistent UI for patch selection

Alexey Levan bugs at darcs.net
Fri Apr 15 00:13:51 UTC 2011


New submission from Alexey Levan <exlevan at gmail.com>:

(The description below is my speculation on how darcs is intended to
work, so If I'm wrong, I'd like to be corrected.)

To select a subset of patches from the history, the darcs commands
have 3 groups of command-line flags, with the following meanings:

  * select one patch
    --patch
    --match
    --tag
    --index=N (used in dist, annotate, show contents, show files)

  * select several patches
    --patches
    --matches
    --tags

  * specify range limit
    --from-{patch,match,tag} (from-flags)
    --to-{patch,match,tag} (to-flags)
    --index=N-M (used in diff, changes)
    --last=N (with the meaning of --index=1-N)

The default values for the from- and to-options are the beginning and
the end of patch history, respectively.  When only a to-flag is set,
it means "from the beginning to a patch", while with the only
from-flag, the meaning is "from a patch to the end (current state)".

Of several patches that match the given condition, the last is taken,
because the patch history is processed in the reverse order.

The things I've found out to be wrong:

1. diff incorrectly interprets to-flags, giving the reverse of the
diff with the identical from-flag.  If the flags are interpreted as
specified above, the resulting diff should be between the state after
the matching patch and initial (empty) state.  While this still
doesn't make much sence, at least it will make for more consistent
behaviour.

2. --index and --last don't play well together, when given both flags,
--index=N-M and --last=L, darcs interprets them as --index=N-L no
matter what order the flags were in, which isn't the most expected
thing to do.  It would be more expected that of the both flags only
the last was taken (not to confuse with the --last flag).

3. --index and --last don't play well together with the from- and
to-flags.  There's no simple intuitive way to interpret the combined
meaning if the flags of both groups are given.  This can be solved by
introducing --to-index and --from-index flags, which will not only
blend nicely with the rest of flags, but also are more flexible than
--index and --last.

4. The --index flag is overloaded to fall into two groups of patches,
'select one patch' and 'select range of patches'.  From the UI
perspective, it's better to have only one meaning for each flag.
This, again, can be solved by deprecating a range form of --index in
favour of better alternatives.

5. get and put have --to-match and --to-patch, but no --to-tag.
Instead, --tag is used, which doesn't belong there.

6. dist has one patch selection flags (--match, --patch and --tag),
which doesn't make sense for me.  How does one distribute a single
patch? Perhaps the to-flags were meant?

----------
messages: 13925
nosy: exlevan
status: unknown
title: Inconsistent UI for patch selection

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


More information about the darcs-devel mailing list