summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a271b2a)
raw | patch | inline | side by side (parent: a271b2a)
author | Ciaran McCreesh <ciaran.mccreesh@googlemail.com> | |
Mon, 14 Jul 2008 18:29:37 +0000 (19:29 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Jul 2008 14:37:00 +0000 (07:37 -0700) |
git-add -i ranges expect number-number. But for the supremely lazy, typing in
that second number when selecting "from patch 7 to the end" is wasted effort.
So treat an empty second number in a range as "until the last item".
Signed-off-by: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
that second number when selecting "from patch 7 to the end" is wasted effort.
So treat an empty second number in a range as "until the last item".
Signed-off-by: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-add.txt | patch | blob | history | |
git-add--interactive.perl | patch | blob | history |
index 46dd56c12a8167c3861a304e820c664e3c92ca4f..3558905a92a20f1f615a48821638ce239ecb6232 100644 (file)
"Update>>". When the prompt ends with double '>>', you can
make more than one selection, concatenated with whitespace or
comma. Also you can say ranges. E.g. "2-5 7,9" to choose
- 2,3,4,5,7,9 from the list. You can say '*' to choose
- everything.
+ 2,3,4,5,7,9 from the list. If the second number in a range is
+ omitted, all remaining patches are taken. E.g. "7-" to choose
+ 7,8,9 from the list. You can say '*' to choose everything.
+
What you chose are then highlighted with '*',
like this:
index 801d7c02513be636ac682b503de7b9b4121acee9..a6a5c52b59b893d6f69fce483c82c762a089003d 100755 (executable)
if ($choice =~ s/^-//) {
$choose = 0;
}
- # A range can be specified like 5-7
- if ($choice =~ /^(\d+)-(\d+)$/) {
- ($bottom, $top) = ($1, $2);
+ # A range can be specified like 5-7 or 5-.
+ if ($choice =~ /^(\d+)-(\d*)$/) {
+ ($bottom, $top) = ($1, length($2) ? $2 : 1 + @stuff);
}
elsif ($choice =~ /^\d+$/) {
$bottom = $top = $choice;