Skip to contentSkip to conversation

make-release: fix mtime for a wider range of git versions

PATCH In review Bernhard Kohl 1 participant 2 messages Nov 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make-release: fix mtime for a wider range of git versions

With the latest git versions, e.g. 1.7.2.3, git still prints out the tag info in addition to the requested format. So let's simply fetch the first line from the output.

In addition I use the --pretty option instead of --format which is not recognized in very old git versions, e.g. 1.5.5.6.

Tested with git versions 1.5.5.6 and 1.7.2.3.

---
 kvm/scripts/make-release |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kvm/scripts/make-release +1 -1
index 56302c3..2d050fc 100755
@@ -51,7 +51,7 @@ cd "$(dirname "$0")"/../..
 mkdir -p "$(dirname "$tarball")"
 git archive --prefix="$name/" --format=tar "$commit" > "$tarball"
 
-mtime=`git show --format=%ct "$commit""^{commit}" --`
+mtime=`git show --pretty=format:%ct "$commit""^{commit}" -- | head -n 1`
 tarargs="--owner=root --group=root"
 
 mkdir -p "$tmpdir/$name"
Signature · 1 line
1.7.2.3
#1 lore raw

Am 15.11.2010 12:48, schrieb Bernhard Kohl:

Quoted 11 lines

With the latest git versions, e.g. 1.7.2.3, git still prints out the tag info in addition to the requested format. So let's simply fetch the first line from the output.

In addition I use the --pretty option instead of --format which is not recognized in very old git versions, e.g. 1.5.5.6.

Tested with git versions 1.5.5.6 and 1.7.2.3.

Sorry, I sent this to the wrong list. Resent to kvm!

Bernhard

Quoted 18 lines
---
  kvm/scripts/make-release |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
kvm/scripts/make-release +1 -1
index 56302c3..2d050fc 100755
@@ -51,7 +51,7 @@ cd "$(dirname "$0")"/../..
  mkdir -p "$(dirname "$tarball")"
  git archive --prefix="$name/" --format=tar "$commit">  "$tarball"
 
-mtime=`git show --format=%ct "$commit""^{commit}" --`
+mtime=`git show --pretty=format:%ct "$commit""^{commit}" -- | head -n 1`
  tarargs="--owner=root --group=root"
 
  mkdir -p "$tmpdir/$name"