From patchwork Tue May 4 17:47:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Fedyk X-Patchwork-Id: 96837 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o44HlbMD005473 for ; Tue, 4 May 2010 17:47:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189Ab0EDRrf (ORCPT ); Tue, 4 May 2010 13:47:35 -0400 Received: from adsl-63-194-240-129.dsl.lsan03.pacbell.net ([63.194.240.129]:50431 "EHLO dt01.hm" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751145Ab0EDRre (ORCPT ); Tue, 4 May 2010 13:47:34 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by dt01.hm (8.14.3/8.14.3) with ESMTP id o44HlXfK004557 for ; Tue, 4 May 2010 10:47:33 -0700 From: Mike Fedyk Subject: [PATCH v2 1/2] Change version.sh from last tag and hash to output last commit date and hash To: linux-btrfs@vger.kernel.org Date: Tue, 04 May 2010 10:47:33 -0700 Message-ID: <20100504174733.4526.23527.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 04 May 2010 17:47:43 +0000 (UTC) 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