[darcs-users] darcs patch: refactor of SelectChanges (and 1 more)
Trent W. Buck
trentbuck at gmail.com
Sun Oct 12 03:02:32 UTC 2008
Florent Becker <florent.becker at ens-lyon.org> writes:
> trentbuck at gmail.com (Trent W. Buck) writes:
> [About --dont-prompt-for-dependencies]
>> Is it the opposite of --ask-deps? If so, I suggest --no-ask-deps.
>
> It's not at all related to ask-deps (note that --no-ask-deps already
> exists). Let me explain what it does in more details.
>
> Suppose you issue the following commands in a repository:
>
> touch toto
> darcs record -am 'depended patch i dont care about'
> echo titi > toto
> darcs record -am 'patch i want'
> touch tutu
> darcs record -am 'patch i do not want'
>
> Suppose you try to darcs pull from this repository, in order to get the
> 'patch i want', and want to use -p 'want' to choose interactively
> between the last two patches. This could be realistic for instance if
> there are many other unrelated patches in the repo, and maybe also
> 'patch i want' in fact depends on many patches you don't care about.
>
> You have three possibilities
>
> 1/ With --prompt-for-dependencies (the default behaviour, which now has
> its own flag). You get asked about all three patches: the last two
> ones, because they match the -p, and the first one because the second
> depends on it. If the two matching patches depend on many patches, this
> can get impratical, and counter-intuitive (why is darcs coming up with a
> patch that does not patch the -p i gave?)
>
> 2/ With --no-deps: you only get to pull the last patch, because the
> second one has a dependency that does not match the -p. This does not work
> this case :-(
>
> 3/ The new --dont-prompt-for-deps. You get asked about only the last two
> patches. If you answer 'y' to 'patch i want', then 'depended patch i
> dont care about' gets silently pulled.
Hmm, as a user, I'm not happy about any of these situations. I see two
problems:
- it's not clear why darcs is asking to pull a non-matching patch; and
- it's not clear which matching patch relates to the non-matching patch.
Immediately, I'd like (1) to be tweaked to point out that the
non-matching patches are a dependency of some kind, which addresses the
my first issue. Here's a mockup:
$ darcs pull -p fred
* A matching patch requires this non-matching patch.
Wed Oct 1 23:41:24 EST 2008 David Roundy <droundy at darcs.net>
* only show 'diffing dir' when debugging.
Shall I pull this patch? (1/93) [ynWsfvpxdaqjk], or ? for help:
However I think what would be best from a user perspective is to ask
questions in the opposite order. For example, suppose we have three
incoming patches A, B and C such that C depends on both A and B:
$ touch A B
$ darcs rec -lam A A
$ darcs rec -lam B B
$ rm A B
$ darcs rec -am C
Then the user does "darcs pull -p C". Here's a mockup of the
interactions that I'd expect:
Pull C? n
Done. (No change.)
Pull C? y
That patch has dependencies that you haven't pulled!
Pull them, too? yes to all
Done. (Pull A, B and C.)
Pull C? y
That patch has dependencies that you haven't pulled!
Pull them, too? abort
Done. (No change.)
Pull C? y
That patch has dependencies that you haven't pulled!
Pull them, too? ask
Pull A? y
Pull B? y
Done asking about dependencies.
(Here it would ask about other matching patches, e.g. C1).
Done. (No change.)
In my mockup, the new --dont-prompt-for-deps corresponds to a "yes to
all" response to the "Pull them, too?" question.
More information about the darcs-users
mailing list