darcs

Issue 116 interactive mode could be more informative about forced selections

Title interactive mode could be more informative about forced selections
Priority wishlist Status duplicate
Milestone Resolved in
Superseder tell users when we skip patches in interactive mode
View: 125
Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur, tommy
Assigned To
Topics FauxBug

Created on 2006-01-28.11:52:26 by kowey, last changed 2009-08-27.13:51:09 by admin.

Messages
msg436 (view) Author: kowey Date: 2006-01-28.11:52:25
Darcs has code to make sure that the user does not violate patch dependencies,
for example, by unrecording a patch that some other patch depends on.  But using
the 'w' or 'k' options in the interactive sessions, you can accidentally sneak
your way around such dependencies:

# creating a repo with a simple dependency
darcs init
touch foo
darcs add foo
darcs record -m "added foo"
echo a > foo
darcs record -m "modified foo"

# the right behaviour (n)
darcs unrecord
# should ask you about 'modified foo' - select 'n'
# should be 'No patches selected!'

# the wrong behaviour? (w)
darcs unrecord
# should ask you about 'modified foo' - select 'w'
# now it asks you about 'add foo' <-- wrong?

Of course, I could be missing something here.  Perhaps this is a feature, and
not a bug? It appears to maintain consistency at least; unrecording 'add foo'
results in 'modify foo' being unrecorded.
msg437 (view) Author: kowey Date: 2006-01-28.12:02:00
Here is a similar example using 'k' 

# creating a repo with a less simple dependency
darcs init
touch bar
darcs add bar
darcs record -m "added bar"
touch foo
darcs add foo
darcs record -m "added foo"
echo a > foo
darcs record -m "modified foo"

# the wrong behaviour? (w)
darcs unrecord
# should ask you about 'modified foo (1/3)' - select 'n'
# now it skips to 'added bar (3/3)' - select 'k'
# it asks about 'added foo (2/3)' <-- wrong? should go back to 1/3, no?
msg438 (view) Author: tommy Date: 2006-01-28.13:11:42
You can not select an inconsistent set of patches with the
interactive patch dialogue.  Whenever a patch is selected or
deselected, no matter in what order, all dependent/depending
patches have their selection status forcefully updated.

You can move up and down with 'j' and 'k' to examine how
selection status changes.

The interactive dialogue could be improved to print a
list of all selected patches.  There's also a proposal to
change the meaning of the 'w' state from "change my state
if needed" to a 'm'(aybe) state "only select me if needed".
The difference is noticeable if you change your mind about
an explicit selection: at present, dependency-forced changes
made to 'w'-patches are not undone to make them 'w'-patches
again, wheres with the proposal, the 'm'-patches would stay
'm' but continuously adjust themselves as "needed" ('My') or
"unneeded" ('Mn'), which should be shown in the dialogue prompt
(and optional listing of selected patches).
msg439 (view) Author: kowey Date: 2006-01-28.13:32:05
> Whenever a patch is selected or deselected, no matter in what order, 
> all dependent/depending patches have their selection status forcefully
> updated.

False alarm, then.  I just had an initial shock when I found myself staring at a
patch which I thought should be available to me.  

> The interactive dialogue could be improved to print a
> list of all selected patches.

Perhaps something contextual like this might be useful

Should I unrecord this patch? [ynWvpxqadjk]
Warning: this will also unrecord the following patches and their dependencies:
 X
 Y
 Z
msg440 (view) Author: droundy Date: 2006-01-28.13:38:28
On Sat, Jan 28, 2006 at 01:32:08PM +0000, Eric Kow wrote:
> > Whenever a patch is selected or deselected, no matter in what order,
> > all dependent/depending patches have their selection status forcefully
> > updated.
> 
> False alarm, then.  I just had an initial shock when I found myself
> staring at a patch which I thought should be available to me.

This is the primary advantage of a gui interface (be it true gui or a
curses tui), that it make the effect of what you want to do clear.

> > The interactive dialogue could be improved to print a list of all
> > selected patches.
> 
> Perhaps something contextual like this might be useful
> 
> Should I unrecord this patch? [ynWvpxqadjk]
> Warning: this will also unrecord the following patches and their dependencies:
>  X
>  Y
>  Z

The trouble with a feature like this would be that would be likely to be
expensive to compute in large repositories, and might also make things less
clear when there are many patches involved (i.e. when the XYZ list has
hundreds of elements).  We could probably introduce heuristics to deal with
both issues (refuse to print more than a certain number, for example), but
it could be tricky.
-- 
David Roundy
http://www.darcs.net
History
Date User Action Args
2006-01-28 11:52:26koweycreate
2006-01-28 12:02:00koweysetstatus: unread -> unknown
nosy: droundy, tommy, kowey
messages: + msg437
2006-01-28 13:11:43tommysetnosy: droundy, tommy, kowey
messages: + msg438
2006-01-28 13:32:08koweysetpriority: bug -> wishlist
nosy: droundy, tommy, kowey
messages: + msg439
title: interactive mode allows patch dependencies to be violated -> interactive mode could be more informative about forced selections
2006-01-28 13:38:29droundysetnosy: droundy, tommy, kowey
messages: + msg440
2007-08-05 20:23:43koweysettopic: + FauxBug
nosy: + beschmi
2007-08-08 07:54:41koweysetstatus: unknown -> duplicate
superseder: + tell users when we skip patches in interactive mode
2009-08-06 17:44:59adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy
2009-08-06 20:41:12adminsetnosy: - beschmi
2009-08-10 21:43:17adminsetnosy: - markstos, darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 17:57:20adminsetnosy: + darcs-devel, - simon
2009-08-27 13:51:09adminsetnosy: tommy, kowey, darcs-devel, thorkilnaur, dmitry.kurochkin