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

[PATCH] submodule summary: support --summary-limit=<n>

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 1, 2013, 13:06 UTC
Message-ID
<51598653.5030001@lsrfire.ath.cx>

In addition to "--summary-limit <n>" support the form "--summary-limit=<n>", for consistency with other parameters and commands.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 git-submodule.sh | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 204bc78..275c664 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -267,6 +267,11 @@ module_clone()
 	(clear_local_git_env; cd "$sm_path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
 }
 
+isnumber()
+{
+	n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
+}
+
 #
 # Add a new submodule to the working tree, .gitmodules and the index
 #
@@ -889,14 +894,14 @@ cmd_summary() {
 			for_status="$1"
 			;;
 		-n|--summary-limit)
-			if summary_limit=$(($2 + 0)) 2>/dev/null && test "$summary_limit" = "$2"
-			then
-				:
-			else
-				usage
-			fi
+			summary_limit="$2"
+			isnumber "$summary_limit" || usage
 			shift
 			;;
+		--summary-limit=*)
+			summary_limit="${1#--summary-limit=}"
+			isnumber "$summary_limit" || usage
+			;;
 		--)
 			shift
 			break
-- 
1.8.2
Message 1 of 1 in “submodule summary: support --summary-limit=<n>”
  1. submodule summary: support --summary-limit=<n>René Scharfe, Apr 1, 2013

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.