>From aef6df163b90b9485da1f97a14ffab6d8de9b047 Mon Sep 17 00:00:00 2001From: Suraj N. Kurapati <sunaku@xxxxxxxxx>Date: Tue, 4 Nov 2008 20:32:34 -0800Subject: [PATCH] git-add--interactive.perl: Answer questions with a single keypress Allows the user to answer 'Stage this hunk' questions with asingle keypress, just like in Darcs. Previously, the userwas forced to press the Return key after every choice, whichquickly becomes tiring and burdensome work for the fingers. Signed-off-by: Suraj N. Kurapati <sunaku@xxxxxxxxx>--- git-add--interactive.perl | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/git-add--interactive.perl b/git-add--interactive.perlindex b0223c3..1a22968 100755--- a/git-add--interactive.perl+++ b/git-add--interactive.perl@@ -877,6 +877,7 @@ sub patch_update_file { $num = scalar @hunk; $ix = 0; + require Term::ReadKey; while (1) { my ($prev, $next, $other, $undecided, $i); $other = '';@@ -920,7 +921,10 @@ sub patch_update_file { print; } print colored $prompt_color, "Stage this hunk [y/n/a/d$other/?]? ";- my $line = <STDIN>;++ Term::ReadKey::ReadMode('raw');+ my $line = Term::ReadKey::ReadKey(0);+ Term::ReadKey::ReadMode('restore'); if ($line) { if ($line =~ /^y/i) { $hunk[$ix]{USE} = 1;-- 1.6.0.3 ÿôèº{.nÇ+?·?®??+%?Ëÿ±éݶ¥?wÿº{.nÇ+?· ?ßâ?Ø^n?r¡ö¦zË?ëh?¨èÚ&£ûàz¿äz¹Þ?ú+?Ê+zf£¢·h??§~??Ûiÿÿï?êÿ?êçz_è®æj:+v?¨þ)ߣøm