git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/5] git-status: configurable submodule summary size

From
Ping Yin <pkufranky@gmail.com>
Date
Jan 12, 2008, 07:37 UTC
Message-ID
<576f7d00c7ecb2cf92fe22592f04b8b1ea6512f7.1200122041.git.pkufranky@gmail.com>
In-Reply-To
<b220c31f973576dfc1a90ee588bbfd01cd8f6409.1200122041.git.pkufranky@gmail.com>

Add config variable status.submodulesummary which is passed as the arg for '--summary-limit' of 'git submodule' to limit the submodule summary size.

The summary function is disabled by default by this config (say status.submodulesummary is 0 by default).

Signed-off-by: Ping Yin <pkufranky@gmail.com>
---
 wt-status.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index df5be80..25ce58b 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -11,6 +11,7 @@
 
 int wt_status_relative_paths = 1;
 int wt_status_use_color = 0;
+int wt_status_submodule_summary = 0;
 static char wt_status_colors[][COLOR_MAXLEN] = {
 	"",         /* WT_STATUS_HEADER: normal */
 	"\033[32m", /* WT_STATUS_UPDATED: green */
@@ -275,10 +276,14 @@ static void wt_status_print_changed(struct wt_status *s)
 static void wt_status_print_submodule_summary(struct wt_status *s)
 {
 	struct child_process sm_summary;
+	char summary_limit[64];
+	sprintf(summary_limit, "%d", wt_status_submodule_summary);
 	const char *argv[] = {
 		"submodule",
 		"summary",
 		"--cached",
+		"--summary-limit",
+		summary_limit,
 		s->amend ? "HEAD^" : "HEAD",
 		NULL
 	};
@@ -424,6 +429,10 @@ void wt_status_print(struct wt_status *s)
 
 int git_status_config(const char *k, const char *v)
 {
+	if (!strcmp(k, "status.submodulesummary")) {
+		wt_status_submodule_summary = atoi(v);
+		return 0;
+	}
 	if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) {
 		wt_status_use_color = git_config_colorbool(k, v, -1);
 		return 0;
-- 
1.5.4.rc2.9.gf5146-dirty
Previous: Ping YinNext: Junio C Hamano
Message 6 of 19 in “submodule summary support”
  1. 0/5 submodule summary supportPing Yin, Jan 12, 2008
  2. 1/5 git-submodule: New subcommand 'summary' (1) - code frameworkPing Yin, Jan 12, 2008
  3. 2/5 git-submodule: New subcommand 'summary' (2) - hard workPing Yin, Jan 12, 2008
  4. 3/5 git-submodule: New subcommand 'summary' (3) - limit summary sizePing Yin, Jan 12, 2008
  5. 4/5 git-status: submodule summary supportPing Yin, Jan 12, 2008
  6. 5/5 git-status: configurable submodule summary sizePing Yin, Jan 12, 2008
  7. Junio C HamanoJan 12, 2008
  8. Ping YinJan 12, 2008
  9. Junio C HamanoJan 12, 2008
  10. Ping YinJan 13, 2008
  11. Junio C HamanoJan 12, 2008
  12. Ping YinJan 12, 2008
  13. Ping YinJan 12, 2008
  14. Junio C HamanoJan 12, 2008
  15. Ping YinJan 12, 2008
  16. Junio C HamanoJan 12, 2008
  17. Ping YinJan 13, 2008
  18. Junio C HamanoJan 12, 2008
  19. Ping YinJan 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.