]> git.ipfire.org Git - thirdparty/git.git/commit - wt-status.c
diff: do not show submodule with untracked files as "-dirty"
authorSangeeta Jain <sangunb09@gmail.com>
Tue, 10 Nov 2020 08:39:00 +0000 (14:09 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Dec 2020 22:27:35 +0000 (14:27 -0800)
commit8ef93124645f89c45c9ec3edd3b268b38154061a
tree6b5f8460317e3fa87f4b3ddd68541ff8f1ef656b
parent2e673356aefa8ed19be3c878f966ad6189ecb510
diff: do not show submodule with untracked files as "-dirty"

Git diff reports a submodule directory as -dirty even when there are
only untracked files in the submodule directory. This is inconsistent
with what `git describe --dirty` says when run in the submodule
directory in that state.

Make `--ignore-submodules=untracked` the default for `git diff` when
there is no configuration variable or command line option, so that the
command would not give '-dirty' suffix to a submodule whose working
tree has untracked files, to make it consistent with `git
describe --dirty` that is run in the submodule working tree.

And also make `--ignore-submodules=none` the default for `git status`
so that the user doesn't end up deleting a submodule that has
uncommitted (untracked) files.

Signed-off-by: Sangeeta Jain <sangunb09@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/diff.txt
diff.c
diff.h
submodule.c
t/t3701-add-interactive.sh
t/t4027-diff-submodule.sh
t/t4041-diff-submodule-option.sh
t/t4060-diff-submodule-option-diff-format.sh
wt-status.c