summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c965c02)
raw | patch | inline | side by side (parent: c965c02)
author | Matthieu Moy <Matthieu.Moy@imag.fr> | |
Fri, 10 Apr 2009 14:57:01 +0000 (16:57 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 16 Apr 2009 02:41:35 +0000 (19:41 -0700) |
There's already 'd' to stop staging hunks in a file, but no explicit
command to stop the interactive staging (for the current files and the
remaining ones). Of course you can do 'd' and then ^C, but it would be
more intuitive to allow 'quit' action.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
command to stop the interactive staging (for the current files and the
remaining ones). Of course you can do 'd' and then ^C, but it would be
more intuitive to allow 'quit' action.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-add.txt | patch | blob | history | |
git-add--interactive.perl | patch | blob | history |
index ce71838b9e17f3b68dcd19648da3a88dfe4f35bd..709e04b335005b8c4de03f1cc47a5cba1ceffcdf 100644 (file)
y - stage this hunk
n - do not stage this hunk
+ q - quite, do not stage this hunk nor any of the remaining ones
a - stage this and all the remaining hunks in the file
d - do not stage this hunk nor any of the remaining hunks in the file
j - leave this hunk undecided, see next undecided hunk
index def062a9e2cbc67b78522aa47151d47cd50f0f33..210d23022da389f4e8081158b9459fae16760ff2 100755 (executable)
print colored $help_color, <<\EOF ;
y - stage this hunk
n - do not stage this hunk
+q - quit, do not stage this hunk nor any of the remaining ones
a - stage this and all the remaining hunks in the file
d - do not stage this hunk nor any of the remaining hunks in the file
g - select a hunk to go to
@mods);
}
for (@them) {
- patch_update_file($_->{VALUE});
+ return 0 if patch_update_file($_->{VALUE});
}
}
}
sub patch_update_file {
+ my $quit = 0;
my ($ix, $num);
my $path = shift;
my ($head, @hunk) = parse_diff($path);
$_->{USE} = 0 foreach ($mode, @hunk);
last;
}
+ elsif ($line =~ /^q/i) {
+ $_->{USE} = 0 foreach ($mode, @hunk);
+ $quit = 1;
+ last;
+ }
else {
help_patch_cmd('');
next;
}
next;
}
+ elsif ($line =~ /^q/i) {
+ while ($ix < $num) {
+ if (!defined $hunk[$ix]{USE}) {
+ $hunk[$ix]{USE} = 0;
+ }
+ $ix++;
+ }
+ $quit = 1;
+ next;
+ }
elsif ($line =~ m|^/(.*)|) {
my $regex = $1;
if ($1 eq "") {
}
print "\n";
+ return $quit;
}
sub diff_cmd {