From b7816b9dad7eb40dad647eb3a6e597a351c9bb37 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 11 May 2012 01:45:07 -0300 Subject: [PATCH] schhist/schhist2web: truncate commit entries after 300 characters This limit includes the entire entry, including the author and the date. --- schhist/schhist2web | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/schhist/schhist2web b/schhist/schhist2web index 1eae4bf..f619b74 100755 --- a/schhist/schhist2web +++ b/schhist/schhist2web @@ -2,8 +2,8 @@ # # schhist2web - Web-browseable graphical revision history of schematics # -# Written 2010 by Werner Almesberger -# Copyright 2010 Werner Almesberger +# Written 2010, 2012 by Werner Almesberger +# Copyright 2010, 2012 Werner Almesberger # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,6 +17,7 @@ THUMB_OPTS="-w 3 -d 60 -c 0.5,0.5,0.5 -n 1,1,0" BG_COLOR="f0f0ff" FNAME_COLOR="#b0f0ff" SEP_COLOR="#000000" +CUTOFF=300 shrink() @@ -66,7 +67,7 @@ EOF echo "
"
     ( cd "$dir" && git show \
         --pretty=format:"%aN <%aE>%n    %ad%n%n    %s" \
-	--quiet $next; ) |
+	--quiet $next; ) | sed '/\(.\{'$CUTOFF'\}\).*/s//\1.../' |
       sed 's/&/&/g;s//\>/g' |
       if [ -z "$SCHHIST_COMMIT_TEMPLATE" ]; then
 	cat