Remove git-zip-tree
git-zip-tree can be safely removed because it was never part of a formal release. This patch makes 'git-archive --format=zip' the one and only git ZIP file creation command. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
Rene Scharfe committed
Sep 23, 2006 at 17:06 UTC
31756c5da8198eb09f2792230e1bed4d107f5135
5 files changed
-135
.gitignore
-1
@@ -128,7 +128,6 @@ git-verify-pack
128
git-verify-tag
129
git-whatchanged
130
git-write-tree
131
-git-zip-tree
131
git-core-*/?*
132
gitweb/gitweb.cgi
133
test-date
Documentation/git-zip-tree.txt
deleted
-67
@@ -1,67 +0,0 @@
1
-git-zip-tree(1)
2
-===============
3
-
4
-NAME
5
-----
6
-git-zip-tree - Creates a ZIP archive of the files in the named tree
7
-
8
-
9
-SYNOPSIS
10
---------
11
-'git-zip-tree' [-0|...|-9] <tree-ish> [ <base> ]
12
-
13
-DESCRIPTION
14
------------
15
-Creates a ZIP archive containing the tree structure for the named tree.
16
-When <base> is specified it is added as a leading path to the files in the
17
-generated ZIP archive.
18
-
19
-git-zip-tree behaves differently when given a tree ID versus when given
20
-a commit ID or tag ID. In the first case the current time is used as
21
-modification time of each file in the archive. In the latter case the
22
-commit time as recorded in the referenced commit object is used instead.
23
-Additionally the commit ID is stored as an archive comment.
24
-
25
-Currently git-zip-tree can handle only files and directories, symbolic
26
-links are not supported.
27
-
28
-OPTIONS
29
--------
30
-
31
--0::
32
- Store the files instead of deflating them.
33
-
34
--9::
35
- Highest and slowest compression level. You can specify any
36
- number from 1 to 9 to adjust compression speed and ratio.
37
-
38
-<tree-ish>::
39
- The tree or commit to produce ZIP archive for. If it is
40
- the object name of a commit object.
41
-
42
-<base>::
43
- Leading path to the files in the resulting ZIP archive.
44
-
45
-EXAMPLES
46
---------
47
-git zip-tree v1.4.0 git-1.4.0 >git-1.4.0.zip::
48
-
49
- Create a ZIP file for v1.4.0 release.
50
-
51
-git zip-tree HEAD:Documentation/ git-docs >docs.zip::
52
-
53
- Put everything in the current head's Documentation/ directory
54
- into 'docs.zip', with the prefix 'git-docs/'.
55
-
56
-Author
57
-------
58
-Written by Rene Scharfe.
59
-
60
-Documentation
61
---------------
62
-Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
63
-
64
-GIT
65
----
66
-Part of the gitlink:git[7] suite
67
-
builtin-zip-tree.c
-65
@@ -10,9 +10,6 @@
10
#include "builtin.h"
11
#include "archive.h"
12
13
-static const char zip_tree_usage[] =
14
-"git-zip-tree [-0|...|-9] <tree-ish> [ <base> ]";
15
-
13
static int verbose;
14
static int zip_date;
15
static int zip_time;
@@ -294,68 +291,6 @@ static void dos_time(time_t *time, int *dos_date, int *dos_time)
291
*dos_time = t->tm_sec / 2 + t->tm_min * 32 + t->tm_hour * 2048;
292
}
293
297
-int cmd_zip_tree(int argc, const char **argv, const char *prefix)
298
-{
299
- unsigned char sha1[20];
300
- struct tree *tree;
301
- struct commit *commit;
302
- time_t archive_time;
303
- char *base;
304
- int baselen;
305
-
306
- git_config(git_default_config);
307
-
308
- if (argc > 1 && argv[1][0] == '-') {
309
- if (isdigit(argv[1][1]) && argv[1][2] == '\0') {
310
- zlib_compression_level = argv[1][1] - '0';
311
- argc--;
312
- argv++;
313
- }
314
- }
315
-
316
- switch (argc) {
317
- case 3:
318
- base = xstrdup(argv[2]);
319
- baselen = strlen(base);
320
- break;
321
- case 2:
322
- base = xstrdup("");
323
- baselen = 0;
324
- break;
325
- default:
326
- usage(zip_tree_usage);
327
- }
328
-
329
- if (get_sha1(argv[1], sha1))
330
- die("Not a valid object name %s", argv[1]);
331
-
332
- commit = lookup_commit_reference_gently(sha1, 1);
333
- archive_time = commit ? commit->date : time(NULL);
334
- dos_time(&archive_time, &zip_date, &zip_time);
335
-
336
- zip_dir = xmalloc(ZIP_DIRECTORY_MIN_SIZE);
337
- zip_dir_size = ZIP_DIRECTORY_MIN_SIZE;
338
-
339
- tree = parse_tree_indirect(sha1);
340
- if (!tree)
341
- die("not a tree object");
342
-
343
- if (baselen > 0) {
344
- write_zip_entry(tree->object.sha1, "", 0, base, 040777, 0);
345
- base = xrealloc(base, baselen + 1);
346
- base[baselen] = '/';
347
- baselen++;
348
- base[baselen] = '\0';
349
- }
350
- read_tree_recursive(tree, base, baselen, 0, NULL, write_zip_entry);
351
- write_zip_trailer(commit ? commit->object.sha1 : NULL);
352
-
353
- free(zip_dir);
354
- free(base);
355
-
356
- return 0;
357
-}
358
-
294
int write_zip_archive(struct archiver_args *args)
295
{
296
int plen = strlen(args->base);
builtin.h
-1
@@ -53,7 +53,6 @@ extern int cmd_show(int argc, const char **argv, const char *prefix);
53
extern int cmd_stripspace(int argc, const char **argv, const char *prefix);
54
extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
55
extern int cmd_tar_tree(int argc, const char **argv, const char *prefix);
56
-extern int cmd_zip_tree(int argc, const char **argv, const char *prefix);
56
extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
57
extern int cmd_update_index(int argc, const char **argv, const char *prefix);
58
extern int cmd_update_ref(int argc, const char **argv, const char *prefix);
git.c
-1
@@ -259,7 +259,6 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
259
{ "stripspace", cmd_stripspace },
260
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
261
{ "tar-tree", cmd_tar_tree, RUN_SETUP },
262
- { "zip-tree", cmd_zip_tree, RUN_SETUP },
262
{ "unpack-objects", cmd_unpack_objects, RUN_SETUP },
263
{ "update-index", cmd_update_index, RUN_SETUP },
264
{ "update-ref", cmd_update_ref, RUN_SETUP },