From: Robert Clausecker <fuzxxl@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Feature request: Allow extracting revisions into directories
Date: Sun, 10 Feb 2013 04:57:08 +0100 [thread overview]
Message-ID: <1360468628.6610.5.camel@t520> (raw)
In-Reply-To: <7vpq08u903.fsf@alter.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]
There are two things git archive is missing that are needed in my use
case:
First, git archive in combination with tar won't remove unneeded files.
You have to run rm -rf before manually which brings me to the next
point; git archive can't really make incremental updates. Consider an
export that overwrites a tree that resembles the state of an export two
commits before and contains a lot of files. I don't like to idea of
needing to remove all files and write all of them again just to change
one or two lines.
Perhaps my real problem is not "export" but rather "Can I have multiple
work trees with multiple checked out revisions?"...
Am Samstag, den 09.02.2013, 19:45 -0800 schrieb Junio C Hamano:
> Junio C Hamano <gitster@pobox.com> 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" -
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2013-02-10 3:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-03 14:18 Feature request: Allow extracting revisions into directories Robert Clausecker
2013-02-03 16:25 ` Sitaram Chamarty
2013-02-03 18:11 ` Robert Clausecker
2013-02-04 0:42 ` Sitaram Chamarty
2013-02-05 15:11 ` Phil Hord
2013-02-09 15:58 ` Robert Clausecker
2013-02-09 23:00 ` Junio C Hamano
2013-02-10 3:45 ` Junio C Hamano
2013-02-10 3:57 ` Robert Clausecker [this message]
2013-02-10 4:06 ` Jonathan Nieder
2013-02-10 4:10 ` Robert Clausecker
2013-02-10 4:19 ` Jonathan Nieder
2013-02-03 23:26 ` Konstantin Khomoutov
2013-02-04 11:18 ` Michael J Gruber
2013-02-04 12:14 ` Robert Clausecker
2013-02-04 12:47 ` Tomas Carnecky
2013-02-04 16:52 ` Junio C Hamano
2013-02-05 8:55 ` Sitaram Chamarty
2013-02-04 12:58 ` Andrew Ardill
2013-02-04 16:55 ` Junio C Hamano
2013-02-04 18:21 ` Andreas Schwab
2013-02-10 12:16 ` Thomas Koch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360468628.6610.5.camel@t520 \
--to=fuzxxl@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).