summaryrefslogtreecommitdiff
path: root/scripts/setlocalversion
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2008-04-01 09:53:14 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2008-04-01 09:53:14 +0000
commite2f56edbd37cd6036dae8d768054fdeeb3c4bdfe (patch)
tree35986acf820ef3384e588b1869be096eac09ccad /scripts/setlocalversion
parent34274164d9be605924bb8466fb7639bace5dee2b (diff)
setlocalversion: add git-svn support
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-xscripts/setlocalversion7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 1c1bdaf73..e9de7fa0a 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -12,7 +12,12 @@ cd "${1:-.}" || usage
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
# Do we have an untagged version?
if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
- git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+ git describe 2>/dev/null | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+ fi
+
+ # Is this git on svn?
+ if git config --get svn-remote.svn.url >/dev/null; then
+ printf -- '-svn%s' "`git-svn find-rev $head`"
fi
# Are there uncommitted changes?