Changeset ca5e52a for git-version.sh


Ignore:
Timestamp:
05/01/2021 02:07:11 PM (5 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.0, qt5new, trunk
Children:
9d0684c
Parents:
4a570af
Message:

git-version: simplify version number

File:
1 edited

Legend:

Unmodified
Added
Removed
  • git-version.sh

    r4a570af rca5e52a  
    3232full_date="$month $day$suffix, $year"
    3333
    34 sha="g$(git describe --always)"
    35 version="$short_date-$sha"
     34sha="$(git describe --abbrev=1)"
     35if git describe --all --match trunk > /dev/null 2> /dev/null; then
     36        sha=$(echo "$sha" | sed 's/-g[^-]*$//')
     37fi
     38version="$sha"
    3639
    3740if [ "$(git diff HEAD | wc -l)" != "0" ]; then
    38         version="$version-MODIFIED"
     41        version="$version+"
    3942fi
    4043
     
    4447echo "<!ENTITY copyrightdate     \"2001-$year\">"          >> version.ent
    4548echo "<!ENTITY version           \"$version\">"            >> version.ent
    46 echo "<!ENTITY short-version     \"$sha\">"                >> version.ent
    4749echo "<!ENTITY releasedate       \"$full_date\">"          >> version.ent
    4850echo "<!ENTITY pubdate           \"$short_date\">"         >> version.ent
Note: See TracChangeset for help on using the changeset viewer.