Re: [PATCH/RFC v2] git-add--interactive.perl: Answer questions with a single keypress

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux