Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: Feature request: Allow extracting revisions into directories

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:06

Junio C Hamano [off-list ref] writes:
I am not Phil, but if you ask me, I think it is borderline between
"meh" and "no way we would give a short-and-sweet -i to something
like this".
I think one reason it was "meh" for me is that we never did an
equivalent of "cvs export" and "svn export", primarily because
we had "tar-tree" (aka "archive --format=tar") first, and it was
sufficient to pipe its outputto "tar xf -" if somebody wanted to do
the non-existent "git export".  Also "tar-tree" was more useful for
people who wanted to eventually want to have a tarball (you can
first "export" and then "tar cf" the resulting directory).

But I think it is fine to add "git export <revision> <directory>",
which may look like this, perhaps.

	#!/bin/sh
	# git export <rev> <directory>
	rev=${1?revision} dir=${2?directory}
	. $(git --exec-path)/git-sh-setup

        mkdir -p "$dir" || exit
        git archive --format=tar "$rev" |
        tar Cxf "$dir" -
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help