On Thu, 2008-11-06 at 19:58 -0600, Peter Samuelson wrote:
> | #!/bin/bash
> | # Write a log message template, listing the files that would be committed.
> | FILES=`svn st "$@" | grep "^[^?]" | grep -v "^ L" | sed 's/^.......//' | sort`
> or | cut -c8- | sort
>
> | echo
> | for FILE in $FILES; do
> | echo "* $FILE"
> | # Find the names of the functions affected, and list them in parentheses.
> | svn diff --diff-cmd diff -x '-U0 -p' $FILE | sed -e "s/^@@ [^@]* @@ .*\<\([A-Za-z_][A-Za-z0-9_]*\) *(.*/ (\1): /" -e "t" -e "d" | uniq
> | echo
> | done
>
> echo '--This line, and those below, will be ignored--'
Heh! That's brilliant. Thanks. It never occurred to me.
> | # (when in sorted order) svn diff -x -up "$@"
> | for FILE in $FILES; do
> | svn diff --diff-cmd diff -x -up $FILE
> | done
>
> Why not just call svn diff with $FILES ?
Because
(a) I want the files to appear in the same order here (a diff with
context) as they do when generating the message template above (where I
use no context, '-U0', in order to get more accurate reporting of the
function names). Subversion doesn't guarantee that diffs come out in the
same order each time.
(b) I want the order to be a sensible sorted order. Subversion doesn't
do that.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
- application/x-shellscript attachment: svnlogmsg
Received on 2008-11-07 11:48:36 CET