Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 37 lines (28 sloc) 1.085 kb
2ea4cf7e » Marc Liyanage
2010-01-04 added git-coderev and git-export, small tweaks to existing scripts
1 #/bin/sh
2 #
3 # Compare two revisions of the Git project in the current working
4 # directory with coderev (http://code.google.com/p/coderev/) to
5 # produce an HTML report for code review.
6 #
7 # Marc Liyanage <http://www.entropy.ch>
8 #
9
10 CODEDIFF=/usr/local/coderev/codediff.py
11
12 set -e
13
14 REVISION1=$1
15 [ $REVISION1 ] || { echo Usage: $0 '<old_revision>' '[new_revision]'; echo "new_revision defaults to 'head'"; false; }
16 REVISION2=$2
17 [ $REVISION2 ] || { echo using head as new version; REVISION2=head; }
18
19 BRANCH=$(git status | grep 'On branch' | sed -e 's/.*branch //')
20 [ $BRANCH ] || { echo unable to determine branch; false; }
21 DIR=$(basename "$PWD")
22
23 git-export.sh "$REVISION1"
24 git-export.sh "$REVISION2"
25
26 git diff --stat "$REVISION1" "$REVISION2" > /tmp/diffstat.txt
27
28 $CODEDIFF \
29 -o ~/Desktop/"code review $DIR $BRANCH" \
30 --wrap=130 \
31 --commentfile=/tmp/diffstat.txt \
32 --title="Code changes for $DIR $BRANCH" \
33 ~/Desktop/"$REVISION1" ~/Desktop/"$REVISION2"
34
e1b197b4 » Marc Liyanage
2010-01-05 clean up empty directories left by codediff.py
35 rm -r ~/Desktop/"$REVISION1" ~/Desktop/"$REVISION2" /tmp/diffstat.txt
36
37 find ~/Desktop/"code review $DIR $BRANCH" -type d -empty -delete
Something went wrong with that request. Please try again.