Skip to contentSkip to conversation

make-release: fix mtime on rhel6 beta

PATCH Superseded Michael S. Tsirkin 2 participants 4 messages Jun 24, 2010 KVM

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make-release: fix mtime on rhel6 beta

With recent git versions (like one in rhel6 beta), git prints out tag info in addition to requested format, if passed a tag name. This breaks make-release.
To get just the time as we want, we need to pass something that is not a tag name but matches same commit. $commit~0 does this.

---

Eduardo, you might want to pick this one up too.

 kvm/scripts/make-release |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kvm/scripts/make-release +1 -1
index e8051f4..cd28275 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" --`
+mtime=`git show --format=%ct "$commit"~0 --`
 tarargs="--owner=root --group=root --mtime=@$mtime"
 
 mkdir -p "$tmpdir"
Signature · 1 line
1.7.1.12.g42b7f
#1 lore raw
Quoted 9 lines · Michael S. Tsirkin

With recent git versions (like one in rhel6 beta), git prints out tag info in addition to requested format, if passed a tag name. This breaks make-release.
To get just the time as we want, we need to pass something that is not a tag name but matches same commit. $commit~0 does this.

I suggest using "$commit^{commit}", to make it more clear.

Quoted 3 lines
kvm/scripts/make-release +1 -1
-mtime=`git show --format=%ct "$commit" --`
+mtime=`git show --format=%ct "$commit"~0 --`
 tarargs="--owner=root --group=root --mtime=@$mtime"
Signature · 1 line
Eduardo
#2 lore raw
Quoted 9 lines · Eduardo Habkost
Quoted 8 lines · Michael S. Tsirkin

With recent git versions (like one in rhel6 beta), git prints out tag info in addition to requested format, if passed a tag name. This breaks make-release.
To get just the time as we want, we need to pass something that is not a tag name but matches same commit. $commit~0 does this.

Quoted 3 lines
Quoted 1 line

I suggest using "$commit^{commit}", to make it more clear.

Since which git version does this work?

Quoted 6 lines
Quoted 3 lines
kvm/scripts/make-release +1 -1
-mtime=`git show --format=%ct "$commit" --`
+mtime=`git show --format=%ct "$commit"~0 --`
 tarargs="--owner=root --group=root --mtime=@$mtime"
Signature · 1 line
Eduardo
#3 lore raw
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Eduardo Habkost
Quoted 8 lines · Michael S. Tsirkin

With recent git versions (like one in rhel6 beta), git prints out tag info in addition to requested format, if passed a tag name. This breaks make-release.
To get just the time as we want, we need to pass something that is not a tag name but matches same commit. $commit~0 does this.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I suggest using "$commit^{commit}", to make it more clear.

Since which git version does this work?

Since v0.99.9 (October 2005).

Signature · 1 line
Eduardo