linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Fedyk <mfedyk@mikefedyk.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 1/2] Change version.sh from last tag and hash to output last commit date and hash
Date: Tue, 04 May 2010 10:47:33 -0700	[thread overview]
Message-ID: <20100504174733.4526.23527.stgit@localhost.localdomain> (raw)

The btrfs git repo doesn't have all of the tags from the base 2.6.32 kernel
it's currently based upon and the btrfs module is regularly compiled
against other kernels so this changes the version to be based upon the date
and hash of the latest commit instead which is more relevant to most people
testing.

An example version string with this change:
Btrfs 2010-04-06_09:37:47_-0400_9f680ce
---

 fs/btrfs/version.sh |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
 mode change 100644 => 100755 fs/btrfs/version.sh

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
  


             reply	other threads:[~2010-05-04 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04 17:47 Mike Fedyk [this message]
2010-05-04 17:47 ` [PATCH v2 2/2] Fix version.sh to work with dash Mike Fedyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100504174733.4526.23527.stgit@localhost.localdomain \
    --to=mfedyk@mikefedyk.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).