setlocalversion (519cb688072008363e091be3f291c1b5779e2ba8) | setlocalversion (56b2f0706d82535fd8d85503f2dcc0be40c8e55d) |
---|---|
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 13 # Do we have an untagged version? 14 if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then | 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 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 git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' | 15 if tag=`git describe 2>/dev/null`; then 16 echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' 17 fi |
16 fi 17 18 # Are there uncommitted changes? 19 git update-index --refresh --unmerged > /dev/null 20 if git diff-index --name-only HEAD | grep -v "^scripts/package" \ 21 | read dummy; then 22 printf '%s' -dirty 23 fi --- 40 unchanged lines hidden --- | 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 25 fi --- 40 unchanged lines hidden --- |