summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-01-13 12:10:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-16 20:32:45 (GMT)
commit12434efc1d4a83d768e8b60bfdb711780677a308 (patch)
tree7cb2212005c775450426360fb691e313ddfe0cab /git-add--interactive.perl
parent6366dd9000a3f67e47a30d94375a88dabc18ec6f (diff)
downloadgit-12434efc1d4a83d768e8b60bfdb711780677a308.zip
git-12434efc1d4a83d768e8b60bfdb711780677a308.tar.gz
git-12434efc1d4a83d768e8b60bfdb711780677a308.tar.bz2
add--interactive: ignore submodule changes except HEAD
For 'add -i' and 'add -p', the only action we can take on a dirty submodule entry is update the index with a new value from its HEAD. The content changes inside (from its own index, untracked files...) do not matter, at least until 'git add -i' learns about launching a new interactive add session inside a submodule. Ignore all other submodules changes except HEAD. This reduces the number of entries the user has to check through in 'git add -i', and the number of 'no' they have to answer to 'git add -p' when dirty submodules are present. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 28b325d..964c3a7 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -262,7 +262,7 @@ sub list_modified {
}
}
- for (run_cmd_pipe(qw(git diff-files --numstat --summary --raw --), @ARGV)) {
+ for (run_cmd_pipe(qw(git diff-files --ignore-submodules=dirty --numstat --summary --raw --), @ARGV)) {
if (($add, $del, $file) =
/^([-\d]+) ([-\d]+) (.*)/) {
$file = unquote_path($file);