Re: Git archive and trailing "/" in prefix
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 8, 2009, 16:26 UTC
- Message-ID
- <7v4oq9j1gs.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <loom.20091008T172303-658@post.gmane.org>
Sergio Callegari <sergio.callegari@gmail.com> writes:
> The git-archive man page indicates that if the --prefix option is passed to > git-archive, it is compulsory to end the prefix with a "/"
No, it does not have to.
$ git archive --prefix=v1.6.0- v1.6.0 Makefile | tar xf - $ make -f v1.6.0-Makefile
This is consistent with the way the same --prefix option can be used with checkout-index. e.g. to swap Makefile in work tree and in the index:
$ edit Makefile
$ git checkout-index --prefix=old- Makefile
$ git update-index Makefile
$ mv old-Makefile MakefileThese may or may not be useful examples, but this feature has been with us for a long time. I wouldn't be surprised if removing the ability to archive or checkout with filename prefix (not leading directory path prefix) causes grief to existing scripts of people.