Bug: git archive not doing export-subst when using --prefix= option
- From
- Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
- Date
- Apr 8, 2008, 21:35 UTC
- Message-ID
- <a1b6cb1b0804081435w24074d1aq177e8c1a5e1af0f8@mail.gmail.com>
In one of my small projects, I just tried to add an export-subst format to my version file to have the git version in the released tarball. However it seems git-archive --prefix="tarballname-version/" does not work well together with export-subst.
I have very old git! (v1.5.4.4). So please help me and try to reproduce this with newer versions:
The repo is publicly available at
git clone git://repo.or.cz/dragbox.git
The file in the repo having an export substitution format is Dragbox/version.py.in
Now try to export the git tree with git-archive, with and without --prefix= We will do some hackery and grep the binary output.
$ git archive HEAD | grep --text "git_version" git_version = "9c3f6c0af7e67a354cac9a24e24e2057d17778ef" $ git archive --prefix="dragbox-git/" HEAD | grep --text "git_version" git_version = "$Format:%H$"
I noticed in another even smaller repository that it would not behave the same but equally spurious; it would only perform the substitution for some prefixes and not for others (for example with or without ending slash)
Regards Ulrik Sverdrup