Created
April 17, 2016 07:36
-
-
Save mwgamera/95a53eb09e084b1145fc79ae6493a752 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# klg, Apr 2016 | |
set -e | |
UPSVN="$(git log -n 1 --format=%H --grep '^git-svn-id:' -- "$@")" | |
if [ -z "$UPSVN" ]; then | |
echo >&2 "No git-svn commit found" | |
exit 1 | |
fi | |
REV=$(git log -n 1 --format=%B "$UPSVN" | \ | |
sed -n 's/^git-svn-id:.*@//p' | sed 's/ .*//') | |
if [ -n "$(git log --oneline "$UPSVN"..)" ]; then | |
REV="${REV}M" | |
fi | |
echo "$REV" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is good for git svn on Linux etc, but not on Windows.