The output from "git status --short" has been extended to show
various kinds of dirtyness in submodules differently; instead of to
"M" for modified, 'm' and '?' can be shown to signal changes only
to the working tree of the submodule but not the commit that is
checked out.
* sb/submodule-short-status:
submodule.c: correctly handle nested submodules in is_submodule_modified
short status: improve reporting for submodule changes
submodule.c: stricter checking for submodules in is_submodule_modified
submodule.c: port is_submodule_modified to use porcelain 2
submodule.c: convert is_submodule_modified to use strbuf_getwholeline
submodule.c: factor out early loop termination in is_submodule_modified
submodule.c: use argv_array in is_submodule_modified
@ -181,6 +181,17 @@ in which case `XY` are `!!`.
@@ -181,6 +181,17 @@ in which case `XY` are `!!`.
! ! ignored
-------------------------------------------------
Submodules have more state and instead report
M the submodule has a different HEAD than
recorded in the index
m the submodule has modified content
? the submodule has untracked files
since modified content or untracked files in a submodule cannot be added
via `git add` in the superproject to prepare a commit.
'm' and '?' are applied recursively. For example if a nested submodule
in a submodule contains an untracked file, this is reported as '?' as well.
If -b is used the short-format status is preceded by a line
## branchname tracking info
@ -210,6 +221,8 @@ field from the first filename). Third, filenames containing special
@@ -210,6 +221,8 @@ field from the first filename). Third, filenames containing special
characters are not specially formatted; no quoting or
backslash-escaping is performed.
Any submodule changes are reported as modified `M` instead of `m` or single `?`.
@ -421,7 +429,7 @@ test_expect_success 'rm of a populated submodule with modifications fails unless
@@ -421,7 +429,7 @@ test_expect_success 'rm of a populated submodule with modifications fails unless
test -d submod &&
test -f submod/.git &&
git status -s -uno --ignore-submodules=none >actual &&
test_cmp expect.modified actual &&
test_cmp expect.modified_inside actual &&
git rm -f submod &&
test ! -d submod &&
git status -s -uno --ignore-submodules=none >actual &&
@ -436,7 +444,7 @@ test_expect_success 'rm of a populated submodule with untracked files fails unle
@@ -436,7 +444,7 @@ test_expect_success 'rm of a populated submodule with untracked files fails unle
test -d submod &&
test -f submod/.git &&
git status -s -uno --ignore-submodules=none >actual &&
test_cmp expect.modified actual &&
test_cmp expect.modified_untracked actual &&
git rm -f submod &&
test ! -d submod &&
git status -s -uno --ignore-submodules=none >actual &&
@ -621,7 +629,7 @@ test_expect_success 'rm of a populated nested submodule with different nested HE
@@ -621,7 +629,7 @@ test_expect_success 'rm of a populated nested submodule with different nested HE
test -d submod &&
test -f submod/.git &&
git status -s -uno --ignore-submodules=none >actual &&
test_cmp expect.modified actual &&
test_cmp expect.modified_inside actual &&
git rm -f submod &&
test ! -d submod &&
git status -s -uno --ignore-submodules=none >actual &&
@ -636,7 +644,7 @@ test_expect_success 'rm of a populated nested submodule with nested modification
@@ -636,7 +644,7 @@ test_expect_success 'rm of a populated nested submodule with nested modification
test -d submod &&
test -f submod/.git &&
git status -s -uno --ignore-submodules=none >actual &&
test_cmp expect.modified actual &&
test_cmp expect.modified_inside actual &&
git rm -f submod &&
test ! -d submod &&
git status -s -uno --ignore-submodules=none >actual &&
@ -651,7 +659,7 @@ test_expect_success 'rm of a populated nested submodule with nested untracked fi
@@ -651,7 +659,7 @@ test_expect_success 'rm of a populated nested submodule with nested untracked fi
test -d submod &&
test -f submod/.git &&
git status -s -uno --ignore-submodules=none >actual &&
test_cmp expect.modified actual &&
test_cmp expect.modified_untracked actual &&
git rm -f submod &&
test ! -d submod &&
git status -s -uno --ignore-submodules=none >actual &&
@ -177,8 +207,24 @@ test_expect_success 'status with added file in modified submodule with .git file
@@ -177,8 +207,24 @@ test_expect_success 'status with added file in modified submodule with .git file
test_i18ngrep "modified: sub (new commits, modified content)" output
'
test_expect_success 'status with a lot of untracked files in the submodule' '