summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-22 09:47:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-23 02:23:55 (GMT)
commit12db334e75ae291aa69987cbe0feda2b6a64af38 (patch)
treee4e83963f560b7cd7a843daaf2dcc8cded07ed47
parent4c8416847aa48e2bd60fa26585e32940a1a9c61c (diff)
downloadgit-12db334e75ae291aa69987cbe0feda2b6a64af38.zip
git-12db334e75ae291aa69987cbe0feda2b6a64af38.tar.gz
git-12db334e75ae291aa69987cbe0feda2b6a64af38.tar.bz2
git-add -i: allow multiple selection in patch subcommand
This allows more than one files from the list to be chosen from the patch subcommand instead of going through the file one by one. This also updates the "list-and-choose" UI for usability. When the prompt ends with ">>", if you type '*' to choose all choices, the prompt immediately returns the choice without requiring an extra empty line to confirm the selection. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-add--interactive.perl14
1 files changed, 7 insertions, 7 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index a0e480e..e347216 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -260,7 +260,7 @@ sub list_and_choose {
$chosen[$i] = $choose;
}
}
- last if ($opts->{IMMEDIATE});
+ last if ($opts->{IMMEDIATE} || $line eq '*');
}
for ($i = 0; $i < @stuff; $i++) {
if ($chosen[$i]) {
@@ -567,12 +567,12 @@ sub patch_update_cmd {
@mods = grep { !($_->{BINARY}) } @mods;
return if (!@mods);
- my ($it) = list_and_choose({ PROMPT => 'Patch update',
- SINGLETON => 1,
- IMMEDIATE => 1,
- HEADER => $status_head, },
- @mods);
- patch_update_file($it->{VALUE}) if ($it);
+ my (@them) = list_and_choose({ PROMPT => 'Patch update',
+ HEADER => $status_head, },
+ @mods);
+ for (@them) {
+ patch_update_file($_->{VALUE});
+ }
}
sub patch_update_file {