summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d5c0cc)
raw | patch | inline | side by side (parent: 3d5c0cc)
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 23 Sep 2006 15:06:11 +0000 (17:06 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 23 Sep 2006 21:00:27 +0000 (14:00 -0700) |
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>
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>
.gitignore | patch | blob | history | |
Documentation/git-zip-tree.txt | [deleted file] | patch | blob | history |
builtin-zip-tree.c | patch | blob | history | |
builtin.h | patch | blob | history | |
git.c | patch | blob | history |
diff --git a/.gitignore b/.gitignore
index a3d9c7a11dc8e2807db377090fd1d4144aad0056..3ca66e42fdbc0b4df11d38867e6d1faa7c9d5172 100644 (file)
--- a/.gitignore
+++ b/.gitignore
git-verify-tag
git-whatchanged
git-write-tree
-git-zip-tree
git-core-*/?*
gitweb/gitweb.cgi
test-date
diff --git a/Documentation/git-zip-tree.txt b/Documentation/git-zip-tree.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-git-zip-tree(1)
-===============
-
-NAME
-----
-git-zip-tree - Creates a ZIP archive of the files in the named tree
-
-
-SYNOPSIS
---------
-'git-zip-tree' [-0|...|-9] <tree-ish> [ <base> ]
-
-DESCRIPTION
------------
-Creates a ZIP archive containing the tree structure for the named tree.
-When <base> is specified it is added as a leading path to the files in the
-generated ZIP archive.
-
-git-zip-tree behaves differently when given a tree ID versus when given
-a commit ID or tag ID. In the first case the current time is used as
-modification time of each file in the archive. In the latter case the
-commit time as recorded in the referenced commit object is used instead.
-Additionally the commit ID is stored as an archive comment.
-
-Currently git-zip-tree can handle only files and directories, symbolic
-links are not supported.
-
-OPTIONS
--------
-
--0::
- Store the files instead of deflating them.
-
--9::
- Highest and slowest compression level. You can specify any
- number from 1 to 9 to adjust compression speed and ratio.
-
-<tree-ish>::
- The tree or commit to produce ZIP archive for. If it is
- the object name of a commit object.
-
-<base>::
- Leading path to the files in the resulting ZIP archive.
-
-EXAMPLES
---------
-git zip-tree v1.4.0 git-1.4.0 >git-1.4.0.zip::
-
- Create a ZIP file for v1.4.0 release.
-
-git zip-tree HEAD:Documentation/ git-docs >docs.zip::
-
- Put everything in the current head's Documentation/ directory
- into 'docs.zip', with the prefix 'git-docs/'.
-
-Author
-------
-Written by Rene Scharfe.
-
-Documentation
---------------
-Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
-
-GIT
----
-Part of the gitlink:git[7] suite
-
diff --git a/builtin-zip-tree.c b/builtin-zip-tree.c
index 52d4b7a17e39831964fe7c9c9c0cb374d0d61a62..3ffdad68d130136312028b389da73af1a789232e 100644 (file)
--- a/builtin-zip-tree.c
+++ b/builtin-zip-tree.c
#include "builtin.h"
#include "archive.h"
-static const char zip_tree_usage[] =
-"git-zip-tree [-0|...|-9] <tree-ish> [ <base> ]";
-
static int verbose;
static int zip_date;
static int zip_time;
*dos_time = t->tm_sec / 2 + t->tm_min * 32 + t->tm_hour * 2048;
}
-int cmd_zip_tree(int argc, const char **argv, const char *prefix)
-{
- unsigned char sha1[20];
- struct tree *tree;
- struct commit *commit;
- time_t archive_time;
- char *base;
- int baselen;
-
- git_config(git_default_config);
-
- if (argc > 1 && argv[1][0] == '-') {
- if (isdigit(argv[1][1]) && argv[1][2] == '\0') {
- zlib_compression_level = argv[1][1] - '0';
- argc--;
- argv++;
- }
- }
-
- switch (argc) {
- case 3:
- base = xstrdup(argv[2]);
- baselen = strlen(base);
- break;
- case 2:
- base = xstrdup("");
- baselen = 0;
- break;
- default:
- usage(zip_tree_usage);
- }
-
- if (get_sha1(argv[1], sha1))
- die("Not a valid object name %s", argv[1]);
-
- commit = lookup_commit_reference_gently(sha1, 1);
- archive_time = commit ? commit->date : time(NULL);
- dos_time(&archive_time, &zip_date, &zip_time);
-
- zip_dir = xmalloc(ZIP_DIRECTORY_MIN_SIZE);
- zip_dir_size = ZIP_DIRECTORY_MIN_SIZE;
-
- tree = parse_tree_indirect(sha1);
- if (!tree)
- die("not a tree object");
-
- if (baselen > 0) {
- write_zip_entry(tree->object.sha1, "", 0, base, 040777, 0);
- base = xrealloc(base, baselen + 1);
- base[baselen] = '/';
- baselen++;
- base[baselen] = '\0';
- }
- read_tree_recursive(tree, base, baselen, 0, NULL, write_zip_entry);
- write_zip_trailer(commit ? commit->object.sha1 : NULL);
-
- free(zip_dir);
- free(base);
-
- return 0;
-}
-
int write_zip_archive(struct archiver_args *args)
{
int plen = strlen(args->base);
diff --git a/builtin.h b/builtin.h
index ccade94e26b34f9005b1ed2575b4c11cb6ceab22..f9fa9ff1d245e81630438d2b321cfe04c7905905 100644 (file)
--- a/builtin.h
+++ b/builtin.h
extern int cmd_stripspace(int argc, const char **argv, const char *prefix);
extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
extern int cmd_tar_tree(int argc, const char **argv, const char *prefix);
-extern int cmd_zip_tree(int argc, const char **argv, const char *prefix);
extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
extern int cmd_update_index(int argc, const char **argv, const char *prefix);
extern int cmd_update_ref(int argc, const char **argv, const char *prefix);
index 44ab0de94d84e3b09d753b1da85679efcfd793a0..1686220488bb62dbf2e238dc488d3fb739156fae 100644 (file)
--- a/git.c
+++ b/git.c
{ "stripspace", cmd_stripspace },
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
{ "tar-tree", cmd_tar_tree, RUN_SETUP },
- { "zip-tree", cmd_zip_tree, RUN_SETUP },
{ "unpack-objects", cmd_unpack_objects, RUN_SETUP },
{ "update-index", cmd_update_index, RUN_SETUP },
{ "update-ref", cmd_update_ref, RUN_SETUP },