darcs

Patch 630 Add a 'o' command to interactive selecti... (and 4 more)

Title Add a 'o' command to interactive selecti... (and 4 more)
Superseder Nosy List galbolle
Related Issues
Status accepted Assigned To
Milestone

Created on 2011-06-15.10:21:12 by galbolle, last changed 2012-03-24.16:17:28 by gh.

Files
File name Status Uploaded Type Edit Remove
add-a-_o_-command-to-interactive-selection-for-going-to-the-first-patch.dpatch galbolle, 2011-06-15.10:21:12 application/x-darcs-patch
change-o-key-to-g-in-select_changes-ui-for-consistency-with-vim-and-less.dpatch gh, 2012-03-22.17:31:15 application/x-darcs-patch
change-o-key-to-g-in-select_changes-ui-for-consistency-with-vim-and-less.dpatch gh, 2012-03-22.17:44:06 application/x-darcs-patch
document-_l_-option-at-the-last-regrets-prompt.dpatch mndrix, 2012-03-23.20:31:35 application/x-darcs-patch
patch-preview.txt ganesh, 2012-01-15.16:09:39 text/x-darcs-patch
patch-preview.txt gh, 2012-03-22.17:31:15 text/x-darcs-patch
patch-preview.txt gh, 2012-03-22.17:44:06 text/x-darcs-patch
patch-preview.txt mndrix, 2012-03-23.20:31:35 text/x-darcs-patch
unnamed galbolle, 2011-06-15.10:21:12 text/x-darcs-patch
unnamed galbolle, 2011-06-15.10:21:12
unnamed ganesh, 2012-01-15.16:09:39
unnamed gh, 2012-03-22.17:31:15
unnamed gh, 2012-03-22.17:44:06
unnamed mndrix, 2012-03-23.20:31:35
update-tests-to-work-with-last-regrets-prompt_.dpatch ganesh, 2012-01-15.16:09:39 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg14536 (view) Author: galbolle Date: 2011-06-15.10:21:12
These patches change the interactive UI of darcs as detailled in issue1920:
they add a last question after patches have been selected to confirm. This
means no more surprise after skipping a patch that just happened to be the last.
It also makes using 'w' in the interactive UI more comfortable, since you do get
a chance to review the patches you'll actually be acting on before launching
missiles.

It makes the interactive UI change, so it *will* break scripts that rely on
its stability, including our own tests. We can either:
-tell the users to live with that
-disable it with a specific flag
-disable it with --pipe <- this gets my vote
-disable it if we manage to notice we are not interacting with a console (how?)

I'm not screening yet, since it needs a rewrite of quite a few tests, and/or a
decision on the previous point.


5 patches for repository http://darcs.net:

Wed Jun 15 10:37:24 CEST 2011  Florent Becker <florent.becker@ens-lyon.org>
  * Add a 'o' command to interactive selection for going to the first patch

Tue Jun 14 17:45:36 CEST 2011  Florent Becker <florent.becker@ens-lyon.org>
  * Add Witnesses.WZipper.toStart

Wed Jun 15 10:42:41 CEST 2011  Florent Becker <florent.becker@ens-lyon.org>
  * Add a last question after all patches have been selected to confirm the whole selection

Wed Jun 15 11:00:03 CEST 2011  Florent Becker <florent.becker@ens-lyon.org>
  * remove double confirmation in revert

Wed Jun 15 11:16:07 CEST 2011  Florent Becker <florent.becker@ens-lyon.org>
  * Don't ask confirmation if there are no things to select in textSelect
Attachments
msg14641 (view) Author: kowey Date: 2011-08-13.15:53:37
I'm actually leaning towards giving ourselves permission to just break 
anything that relies on the interactive UI in this fashion, perhaps with 
a quick poll of darcs-users to see if anybody is actually using darcs in 
this way

Disabling with --pipe sounds fine too
msg14878 (view) Author: gh Date: 2011-12-28.11:59:34
I tested the patches and I think I like the interface.
The message "do you want to pull these patches?" can be improved
later, and maybe in place of the "o" key we could use "g" which is
more consistent with less or vim (well in vim it's gg), since we
already use "j" and "k".

Another possible change is to display the "do you want...?" question
only if there is more than one patch.

g.
msg14897 (view) Author: kowey Date: 2011-12-29.12:45:51
The code seems right at a cursory glance.  There are some follow-ups 
which could be worth working on:

- Guillaume's 'g' key to replace 'o' (using vi familiarity)
- Think about the case where there is nothing selected
- Rephrase the last regrets prompt a bit
- Consider removing 'y' as an answer and going for 'd' instead
- Fuse the 'unrevert impossible; proceed?' prompt with this (ie. if we 
detect unrevert will be impossible, print it as a hint)

Not sure I'm the right person to review it as I have a kind of special 
loathing for confirmation prompts which makes it hard for me to see this 
patch objectively.
msg14898 (view) Author: kowey Date: 2011-12-29.12:46:43
Oh, I forget: we're going with option (a) "tell the users to live with it"
See http://lists.osuosl.org/pipermail/darcs-users/2011-
December/026331.html
msg14899 (view) Author: kowey Date: 2011-12-29.12:47:34
Argh, and I forget again: I went ahead and screened a couple of follow-ups 
of my own, updating the test suite and fixing some typo-level issues.
msg15023 (view) Author: ganesh Date: 2012-01-15.16:09:39
Just updating the patch tracker with these.

2 patches for repository /home/ganesh/darcs/darcs-temp:

Thu Dec 29 12:36:57 GMT 2011  Eric Kow <kowey@darcs.net>
  * Update tests to work with last regrets prompt.
  
  Along the way:
  - Dump inconsistently used and thus not needed 'newline after prompt' behaviour
  - Use convention of capital letters to mark last regrets prompt when we have
    multi-phase UI (eg. ask-deps, rollback)

Thu Dec 29 12:40:45 GMT 2011  Eric Kow <kowey@darcs.net>
  * Last regrets spelling and capitalisation tweak.
Attachments
msg15378 (view) Author: gh Date: 2012-03-22.17:31:15
I'm going ahead and changing the o key into g, for consistency sake
with less (going to the top of the file) and vim (in fact in vim it's gg).

1 patch for repository http://darcs.net:

Thu Mar 22 14:11:30 ART 2012  Guillaume Hoffmann <guillaumh@gmail.com>
  * change o key to g in select-changes UI for consistency with vim and less
Attachments
msg15379 (view) Author: gh Date: 2012-03-22.17:44:06
Forgot to change one 'o' in the previous version.

1 patch for repository http://darcs.net:

Thu Mar 22 14:31:12 ART 2012  Guillaume Hoffmann <guillaumh@gmail.com>
  * change o key to g in select-changes UI for consistency with vim and less
Attachments
msg15383 (view) Author: mndrix Date: 2012-03-23.20:31:36
Minor cleanups found during code review

2 patches for repository http://darcs.net/screened:

Fri Mar 23 14:27:57 MDT 2012  Michael Hendricks <michael@ndrix.org>
  * Document 'l' option at the last regrets prompt
  
  The option is already implemented.  It just wasn't listed in the
  prompt's help text.
  

Fri Mar 23 14:28:57 MDT 2012  Michael Hendricks <michael@ndrix.org>
  * Remove comment addressed in patch/issue discussion
  
  I think there's been enough discussion about 'a' and 'd' options
  in issue1920 and patch630, to settle the question.
Attachments
msg15384 (view) Author: mndrix Date: 2012-03-23.20:34:37
I think this is ready to push.  I'm leaving status as needs-review since 
I just sent two clean up patches that someone else needs to screen and 
review.

Some minor comments are below:

> hunk ./src/Darcs/SelectChanges.hs 461
> -    , KeyPress 'k' ("back up to previous "++ aThing) ]
> +    , KeyPress 'k' ("back up to previous "++ aThing)
> +    , KeyPress 'o' ("start over from first " ++ aThing)]

Not specific to this patch, but a good example of why the new style 
guide is helpful.  Had ']' been on a line by itself, this change would 
be one line, instead of 3.  Additionally, future annotate output would 
more accurately pinpoint the origin of the 'k' line.


> hunk ./src/Darcs/SelectChanges.hs
> +optionsLast :: String -> String -> ([[KeyPress]], [[KeyPress]])
> +optionsLast jn aThing =
> +  (optionsNav aThing True:
> +   [[ KeyPress 'y' ("confirm this opration")
> +    , KeyPress 'q' ("cancel " ++ jn) ]]
> +  ,[[KeyPress 'a' "confirm this operation"
> +    , KeyPress 'd' "confirm this operation"]])

The option 'l' ("list all selected") is available but isn't documented.  
I've sent a patch to update the docs.

> +--should we hide 'a' and 'd'?

I often press 'd' at the last regret prompt. Eric even proposed 'a' and 
'd' being all that's allowed, so I think it's fair to show them, as you 
have.  I've sent a patch to remove the comment.

> hunk ./src/Darcs/SelectChanges.hs
> +lastQuestion whichch = do

It would be nice to support 'v' and 'p' here too.  Of course, that can 
wait until someone else wants to scratch that particular itch.
msg15395 (view) Author: gh Date: 2012-03-24.16:17:28
Good to go.
History
Date User Action Args
2011-06-15 10:21:12galbollecreate
2011-08-13 15:53:37koweysetmessages: + msg14641
2011-12-28 11:59:34ghsetmessages: + msg14878
2011-12-29 12:45:52koweysetstatus: needs-screening -> needs-review
messages: + msg14897
2011-12-29 12:46:44koweysetmessages: + msg14898
2011-12-29 12:47:34koweysetmessages: + msg14899
2012-01-15 16:09:39ganeshsetfiles: + patch-preview.txt, update-tests-to-work-with-last-regrets-prompt_.dpatch, unnamed
messages: + msg15023
2012-03-22 17:31:15ghsetfiles: + patch-preview.txt, change-o-key-to-g-in-select_changes-ui-for-consistency-with-vim-and-less.dpatch, unnamed
messages: + msg15378
2012-03-22 17:44:06ghsetfiles: + patch-preview.txt, change-o-key-to-g-in-select_changes-ui-for-consistency-with-vim-and-less.dpatch, unnamed
messages: + msg15379
2012-03-23 20:31:36mndrixsetfiles: + patch-preview.txt, document-_l_-option-at-the-last-regrets-prompt.dpatch, unnamed
messages: + msg15383
2012-03-23 20:34:37mndrixsetmessages: + msg15384
2012-03-24 16:17:28ghsetstatus: needs-review -> accepted
messages: + msg15395