git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Makefile: don't hardcode HEAD in dist target
@ 2014-05-31 20:25 Dennis Kaarsemaker
  2014-06-02 18:53 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Dennis Kaarsemaker @ 2014-05-31 20:25 UTC (permalink / raw)
  To: git

Instead of calling git-archive HEAD^{tree}, use $(GIT_VERSION)^{tree}.
This makes sure the archive name and contents are consistent, if HEAD
has moved, but GIT-VERSION-FILE hasn't been regenerated yet.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
---
I have a somewhat odd setup in which I share a .git between multiple
checkouts for automated builds. To minimize locking time for parallel
builds with different options, there's only a lock around checkout and
running git describe $commit > version, the builds themselves run in
parallel.

This works just fine except during 'make dist', which is hardcoded to
package up HEAD, but that's not always the commit that is actually
checked out, another process may have checked out something else.

I realize this setup is somewhat strange, but the only change necessary
to make this work is this one-line patch, so I hope that's acceptable.

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a53f3a8..63d9bac 100644
--- a/Makefile
+++ b/Makefile
@@ -2433,7 +2433,7 @@ git.spec: git.spec.in GIT-VERSION-FILE
 GIT_TARNAME = git-$(GIT_VERSION)
 dist: git.spec git-archive$(X) configure
 	./git-archive --format=tar \
-		--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
+		--prefix=$(GIT_TARNAME)/ $(GIT_VERSION)^{tree} > $(GIT_TARNAME).tar
 	@mkdir -p $(GIT_TARNAME)
 	@cp git.spec configure $(GIT_TARNAME)
 	@echo $(GIT_VERSION) > $(GIT_TARNAME)/version
-- 
2.0.0-538-ga6b2d95

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-02 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-31 20:25 [PATCH] Makefile: don't hardcode HEAD in dist target Dennis Kaarsemaker
2014-06-02 18:53 ` Junio C Hamano
2014-06-02 19:34   ` Dennis Kaarsemaker
2014-06-02 20:27     ` Junio C Hamano

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).