Commit graph

60 commits

Author SHA1 Message Date
Junio C Hamano d751864cf7 builtin-archive.c: rename remote_request() to extract_remote_arg()
Suggested by Franck, and I think it makes sense.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-12 22:43:22 -07:00
Junio C Hamano 23d6d112c0 Add sideband status report to git-archive protocol
Using the refactored sideband code from existing upload-pack protocol,
this lets the error condition and status output sent from the remote
process to be shown locally.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-10 18:10:55 -07:00
Junio C Hamano fe5ab763f8 Teach --exec to git-archive --remote
Some people needed --exec to specify the location of the upload-pack
executable, because their default SSH log-in does not include the
directory they have their own private copy of git on the $PATH.
These people need to be able to say --exec to git-archive --remote
for the same reason.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-10 13:39:32 -07:00
Junio C Hamano e0ffb24877 Add --verbose to git-archive
And teach backends about it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9e2c44a2893ae90944a0b7c9f40a9d22b759b5c0 commit)
2006-09-10 13:39:25 -07:00
Junio C Hamano 8142f603b9 archive: force line buffered output to stderr
Otherwise the remote notification that comes with -v option can get
clumped together.

Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from a675cda60ead41f439b04bc69e0f19ace04e59d3 commit)
2006-09-10 13:39:24 -07:00
Junio C Hamano 37f944363d archive: allow remote to have more formats than we understand.
This fixes git-archive --remote not to parse archiver arguments;
otherwise if the remote end implements formats other than the
one known locally we will not be able to access that format.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 23:57:46 -07:00
Rene Scharfe 854c4168e7 git-archive: make compression level of ZIP archives configurable
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 13:39:57 -07:00
Franck Bui-Huu ec06bff5e6 git-archive: wire up ZIP format.
Again, this is based on Rene Scharfe's earlier patch, but uses
the archiver support introduced by the previous patch.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 11:57:37 -07:00
Franck Bui-Huu efd8696cd7 git-archive: wire up TAR format.
This is based on Rene Scharfe's earlier patch, but uses the
archiver support introduced by the previous patch.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 11:57:37 -07:00
Franck Bui-Huu 4df096a5ca Add git-archive
git-archive is a command to make TAR and ZIP archives of a git tree.
It helps prevent a proliferation of git-{format}-tree commands.

Instead of directly calling git-{tar,zip}-tree command, it defines
a very simple API, that archiver should implement and register in
"git-archive.c". This API is made up by 2 functions whose prototype
is defined in "archive.h" file.

 - The first one is used to parse 'extra' parameters which have
   signification only for the specific archiver. That would allow
   different archive backends to have different kind of options.

 - The second one is used to ask to an archive backend to build
   the archive given some already resolved parameters.

The main reason for making this API is to avoid using
git-{tar,zip}-tree commands, hence making them useless. Maybe it's
time for them to die ?

It also implements remote operations by defining a very simple
protocol: it first sends the name of the specific uploader followed
the repository name (git-upload-tar git://example.org/repo.git).
Then it sends options. It's done by sending a sequence of one
argument per packet, with prefix "argument ", followed by a flush.

The remote protocol is implemented in "git-archive.c" for client
side and is triggered by "--remote=<repo>" option. For example,
to fetch a TAR archive in a remote repo, you can issue:

$ git archive --format=tar --remote=git://xxx/yyy/zzz.git HEAD

We choose to not make a new command "git-fetch-archive" for example,
avoind one more GIT command which should be nice for users (less
commands to remember, keeps existing --remote option).

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 11:57:36 -07:00