diff mbox

[1/2] Change version.sh from last tag and hash to output last commit date and hash

Message ID 20100504161201.3720.37609.stgit@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Mike Fedyk May 4, 2010, 4:12 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/version.sh b/fs/btrfs/version.sh
old mode 100644
new mode 100755
index 1ca1952..a4576f2
--- a/fs/btrfs/version.sh
+++ b/fs/btrfs/version.sh
@@ -12,10 +12,7 @@  which git &> /dev/null
 if [ $? == 0 ]; then
     git branch >& /dev/null
     if [ $? == 0 ]; then
-	    if head=`git rev-parse --verify HEAD 2>/dev/null`; then
-		if tag=`git describe --tags 2>/dev/null`; then
-		    v="$tag"
-		fi
+		v="`git show --format='%ci_%h'|head -n 1|sed 's/[^a-z0-9_-:]/_/ig'`"
 
 		# Are there uncommitted changes?
 		git update-index --refresh --unmerged > /dev/null
@@ -24,7 +21,6 @@  if [ $? == 0 ]; then
 		    | read dummy; then
 		    v="$v"-dirty
 		fi
-	    fi
     fi
 fi