source:
tools/PrettyGitLogs.sh
@
8220e50
Last change on this file since 8220e50 was 13c98a4, checked in by , 6 years ago | |
---|---|
|
|
File size: 749 bytes |
Rev | Line | |
---|---|---|
[36fb4ce8] | 1 | #!/bin/bash |
2 | ||
[42ee8f2] | 3 | set -e |
[36fb4ce8] | 4 | |
[9f5bb817] | 5 | GIT="git --git-dir=$1/.git" |
6 | ||
7 | GIT_UPDATE="$2/GIT_UPDATE" | |
8 | GIT_LOG="$2/GIT_LOG" | |
9 | GIT_DIFF="$2/GIT_DIFF" | |
[42ee8f2] | 10 | |
11 | rm -f ${GIT_UPDATE} ${GIT_LOG} ${GIT_DIFF} | |
12 | ||
[9f5bb817] | 13 | GitOldRef=$3 |
14 | GitNewRef=$4 | |
[36fb4ce8] | 15 | |
[42ee8f2] | 16 | |
17 | revisions=$(git rev-list ${GitOldRef}..${GitNewRef}) | |
[36fb4ce8] | 18 | |
19 | for rev in ${revisions}; do | |
20 | type=$(git cat-file -t ${rev}) | |
[42ee8f2] | 21 | echo " via ${rev} (${type})" >> ${GIT_UPDATE} |
[36fb4ce8] | 22 | done |
23 | rev=${GitOldRef} | |
24 | type=$(git cat-file -t ${rev}) | |
[42ee8f2] | 25 | echo " from ${rev} (${type})" >> ${GIT_UPDATE} |
[36fb4ce8] | 26 | |
[42ee8f2] | 27 | git rev-list --format=short ${GitOldRef}...${GitNewRef} > ${GIT_LOG} |
[36fb4ce8] | 28 | |
[13c98a4] | 29 | git diff --stat --color ${GitNewRef} ${GitOldRef} | sed -e 's/\[32m/<span style\=\"color\: \#00AA00\;\">/g' -e 's/\[31m/<span style\=\"color\: \#AA0000\;\">/g' -e 's/\[m/<\/span>/g' > ${GIT_DIFF} |
Note: See TracBrowser
for help on using the repository browser.