commit fb3d35fa5fd4a91e71030750e95bd68b67c786ae parent da53ba63d7d83f54f20e976b44065d39d13b88d4 Author: Antoine Amarilli <a3nm@a3nm.net> Date: Wed, 5 Oct 2016 22:24:44 +0200 better truncate Diffstat:
svn-poll | | | 8 | ++++++-- |
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/svn-poll b/svn-poll @@ -7,7 +7,9 @@ # after this many lines of failure, complain MAX_ERRORS="100" -DIFF_MAX="10000" +DIFF_MAX="1000" +# drop diff after that many lines +DIFF_MAXB=$(($DIFF_MAX+1)) URL="$1" USER="$2" @@ -80,7 +82,9 @@ do # notify the revision svn log -v -r$revision "$URL" # show a diff with no colors - svn diff --internal-diff -c$revision "$URL" | head -n "$DIFF_MAX" + # and truncated to the right number of lines + svn diff --internal-diff -c$revision "$URL" | + sed "${DIFF_MAX}s/.*/... cut at line $DIFF_MAX .../;${DIFF_MAXB},\$d" # shut up until something new happens from $USER touch "$MUTEFILE" fi