setlocalversion (e3da2fb712bb75b6035ba0743f3256df1de30bce) | setlocalversion (f03b283f081f538ec71b9e87cb8411bb62e2abc9) |
---|---|
1#!/bin/sh 2# Print additional version information for non-release trees. 3 4usage() { 5 echo "Usage: $0 [srctree]" >&2 6 exit 1 7} 8 9cd "${1:-.}" || usage 10 11# Check for git and a git repo. | 1#!/bin/sh 2# Print additional version information for non-release trees. 3 4usage() { 5 echo "Usage: $0 [srctree]" >&2 6 exit 1 7} 8 9cd "${1:-.}" || usage 10 11# Check for git and a git repo. |
12if head=`git rev-parse --verify HEAD 2>/dev/null`; then | 12if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then |
13 # Do we have an untagged version? 14 if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then 15 if tag=`git describe 2>/dev/null`; then 16 echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' | 13 # Do we have an untagged version? 14 if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then 15 if tag=`git describe 2>/dev/null`; then 16 echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' |
17 else 18 printf '%s%s' -g $head |
|
17 fi 18 fi 19 20 # Are there uncommitted changes? 21 git update-index --refresh --unmerged > /dev/null 22 if git diff-index --name-only HEAD | grep -v "^scripts/package" \ 23 | read dummy; then 24 printf '%s' -dirty --- 41 unchanged lines hidden --- | 19 fi 20 fi 21 22 # Are there uncommitted changes? 23 git update-index --refresh --unmerged > /dev/null 24 if git diff-index --name-only HEAD | grep -v "^scripts/package" \ 25 | read dummy; then 26 printf '%s' -dirty --- 41 unchanged lines hidden --- |