add--interactive: ignore submodule changes except HEAD
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 13 Jan 2018 12:10:38 +0000 (19:10 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jan 2018 20:32:45 +0000 (12:32 -0800)
commit12434efc1d4a83d768e8b60bfdb711780677a308
tree7cb2212005c775450426360fb691e313ddfe0cab
parent6366dd9000a3f67e47a30d94375a88dabc18ec6f
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>
git-add--interactive.perl
t/t3701-add-interactive.sh