summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8e08b41)
raw | patch | inline | side by side (parent: 8e08b41)
author | Jens Lehmann <Jens.Lehmann@web.de> | |
Sun, 17 Jan 2010 19:42:31 +0000 (20:42 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Jan 2010 23:55:11 +0000 (15:55 -0800) |
When the configuration variable status.submodulesummary is not 0 or
false, "git status" shows the submodule summary of the staged submodule
commits. But it did not show the summary of those commits not yet
staged in the supermodule, making it hard to see what will not be
committed.
The output of "submodule summary --for-status" has been changed from
"# Modified submodules:" to "# Submodule changes to be committed:" for
the already staged changes. "# Submodules changed but not updated:" has
been added for changes that will not be committed. This is much clearer
and consistent with the output for regular files.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
false, "git status" shows the submodule summary of the staged submodule
commits. But it did not show the summary of those commits not yet
staged in the supermodule, making it hard to see what will not be
committed.
The output of "submodule summary --for-status" has been changed from
"# Modified submodules:" to "# Submodule changes to be committed:" for
the already staged changes. "# Submodules changed but not updated:" has
been added for changes that will not be committed. This is much clearer
and consistent with the output for regular files.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh | patch | blob | history | |
t/t7401-submodule-summary.sh | patch | blob | history | |
t/t7508-status.sh | patch | blob | history | |
wt-status.c | patch | blob | history |
diff --git a/git-submodule.sh b/git-submodule.sh
index 77d223292c5b167a8a33b04b10b46426b68e0576..664f21721cb876eed7da167744066d834521c825 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
echo
done |
if test -n "$for_status"; then
- echo "# Modified submodules:"
+ if [ -n "$files" ]; then
+ echo "# Submodules changed but not updated:"
+ else
+ echo "# Submodule changes to be committed:"
+ fi
echo "#"
sed -e 's|^|# |' -e 's|^# $|#|'
else
index 6cc16c39fe75ee9dab942fc5ae376827d3b7ea44..d3c039f724c3a1247417b5fd29d6bd50a88f54be 100755 (executable)
test_expect_success '--for-status' "
git submodule summary --for-status HEAD^ >actual &&
test_cmp actual - <<EOF
-# Modified submodules:
+# Submodule changes to be committed:
#
# * sm1 $head6...0000000:
#
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index cf67fe3a4a07181640e2c5074e6b86188efe1e74..556d0faa77e027c8a18e213088fa6bbc5d7e7af5 100755 (executable)
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
#
# modified: dir1/modified
#
-# Modified submodules:
+# Submodule changes to be committed:
#
# * sm 0000000...$head (1):
# > Add foo
#
# modified: dir1/modified
#
-# Modified submodules:
+# Submodule changes to be committed:
#
# * sm 0000000...$head (1):
# > Add foo
diff --git a/wt-status.c b/wt-status.c
index 5d569880163cccec91fdf1e9d50e03a6b5314d58..deaac93d1784ebe51ff63b25804b6b90acc427b9 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
wt_status_print_trailer(s);
}
-static void wt_status_print_submodule_summary(struct wt_status *s)
+static void wt_status_print_submodule_summary(struct wt_status *s, int uncommitted)
{
struct child_process sm_summary;
char summary_limit[64];
const char *argv[] = {
"submodule",
"summary",
- "--cached",
+ uncommitted ? "--files" : "--cached",
"--for-status",
"--summary-limit",
summary_limit,
- s->amend ? "HEAD^" : "HEAD",
+ uncommitted ? NULL : (s->amend ? "HEAD^" : "HEAD"),
NULL
};
wt_status_print_updated(s);
wt_status_print_unmerged(s);
wt_status_print_changed(s);
- if (s->submodule_summary)
- wt_status_print_submodule_summary(s);
+ if (s->submodule_summary) {
+ wt_status_print_submodule_summary(s, 0); /* staged */
+ wt_status_print_submodule_summary(s, 1); /* unstaged */
+ }
if (s->show_untracked_files)
wt_status_print_untracked(s);
else if (s->commitable)