From 01a6966021a50dc7aff76c0f951bbdd6e1bdd444 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Tue, 13 Feb 2018 10:32:39 +0000 Subject: add -p: only display help for active keys If the user presses a key that add -p wasn't expecting then it prints a list of key bindings. Although the prompt only lists the active bindings the help was printed for all bindings. Fix this by using the list of keys in the prompt to filter the help. Note that the list of keys was already passed to help_patch_cmd() by the caller so there is no change needed to the call site. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- git-add--interactive.perl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 964c3a7542..76b941f8f0 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1184,7 +1184,13 @@ d - do not apply this hunk or any of the later hunks in the file"), ); sub help_patch_cmd { - print colored $help_color, __($help_patch_modes{$patch_mode}), "\n", __ <