summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cb639e)
raw | patch | inline | side by side (parent: 1cb639e)
author | Ping Yin <pkufranky@gmail.com> | |
Tue, 11 Mar 2008 13:52:17 +0000 (21:52 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 12 Mar 2008 06:20:06 +0000 (23:20 -0700) |
This patch teaches git-submodule an option '--summary-limit|-n <number>'
to limit number of commits in total for the summary of each submodule in
the modified case (only a single commit is shown in other cases).
Giving 0 will disable the summary; a negative number means unlimted, which
is the default.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
to limit number of commits in total for the summary of each submodule in
the modified case (only a single commit is shown in other cases).
Giving 0 will disable the summary; a negative number means unlimted, which
is the default.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh | patch | blob | history |
diff --git a/git-submodule.sh b/git-submodule.sh
index 01f26d341cfdc5544e4bf9a92cf8eb3c183ece43..4d28fc0988f1359e914cd27e3750cf01f223527e 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
#
# Copyright (c) 2007 Lars Hjemli
-USAGE='[--quiet] [--cached] [add <repo> [-b branch]|status|init|update|summary [<commit>]] [--] [<path>...]'
+USAGE="[--quiet] [--cached] \
+[add <repo> [-b branch]|status|init|update|summary [-n|--summary-limit <n>] [<commit>]] \
+[--] [<path>...]"
OPTIONS_SPEC=
. git-sh-setup
require_work_tree
# $@ = [commit (default 'HEAD'),] requested paths (default all)
#
cmd_summary() {
+ summary_limit=-1
+
# parse $args after "submodule ... summary".
while test $# -ne 0
do
--cached)
cached="$1"
;;
+ -n|--summary-limit)
+ if summary_limit=$(($2 + 0)) 2>/dev/null && test "$summary_limit" = "$2"
+ then
+ :
+ else
+ usage
+ fi
+ shift
+ ;;
--)
shift
break
shift
done
+ test $summary_limit = 0 && return
+
if rev=$(git rev-parse --verify "$1^0" 2>/dev/null)
then
head=$rev
else
if test $mod_src = 160000 -a $mod_dst = 160000
then
+ limit=
+ test $summary_limit -gt 0 && limit="-$summary_limit"
GIT_DIR="$name/.git" \
- git log --pretty='format: %m %s' \
+ git log $limit --pretty='format: %m %s' \
--first-parent $sha1_src...$sha1_dst
elif test $mod_dst = 160000
then