Raymond Toy pushed to branch issue-464-lisp-version-uses-branch-name at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • bin/git-version.sh
    ... ... @@ -40,7 +40,8 @@ else
    40 40
         # name as appropriate.  This is much more informative.  However,
    
    41 41
         # we have to remove everything before the first slash which
    
    42 42
         # contains things like "tag/" or "head/".
    
    43
    -    GIT_HASH="`(git describe --all --dirty | sed 's;^[^/]\+/;;' 2>/dev/null || git describe 2>/dev/null)`"
    
    43
    +    GIT_DESC="`(git describe --all --dirty || git describe 2>/dev/null)`"
    
    44
    +    GIT_HASH="`echo ${GIT_DESC} | sed 's;^[^/]\+/;;' 2>/dev/null"
    
    44 45
         BRANCH="`git rev-parse --abbrev-ref HEAD`*"
    
    45 46
     
    
    46 47
         if [ `expr "X$GIT_HASH" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]'` != 0 ]; then
    
    ... ... @@ -54,14 +55,14 @@ else
    54 55
     	# The hash looks like the current branch with possibly more
    
    55 56
     	# stuff at the end.  Use the hash as the version.
    
    56 57
     	DEFAULT_VERSION="${GIT_HASH}"
    
    57
    -    elif [ `expr "${GIT_HASH}" : "pipelines/[0-9]*"` != 0]; then
    
    58
    +    elif [ `expr "${GIT_HASH}" : "[0-9]*"` != 0]; then
    
    58 59
     	# Assuming this is CI which seems to produce a githash like
    
    59 60
     	# "pipeline/<digits>".
    
    60 61
     	DEFAULT_VERSION="${GIT_HASH}"
    
    61 62
         fi
    
    62 63
     
    
    63 64
         if [ -z "$DEFAULT_VERSION" ]; then
    
    64
    -	echo "Unable to determine a default version from hash $GIT_HASH"
    
    65
    +	echo "Unable to determine a default version from git describe: $GIT_DESC"
    
    65 66
     	exit 1;
    
    66 67
         fi
    
    67 68
     fi