{"thread":{"id":"5661","subject":"[PATCH 1/2] Remove git-zip-tree","startedAt":"2006-09-23T15:06:11Z","lastAt":"2006-09-25T18:11:42Z","messageCount":3,"participants":["Rene Scharfe","Franck Bui-Huu"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"27479","messageId":"45154D63.8030107@lsrfire.ath.cx","threadId":"5661","inReplyTo":null,"subject":"[PATCH 1/2] Remove git-zip-tree","fromName":"Rene Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2006-09-23T15:06:11Z","receivedAt":"2006-09-23T15:06:11Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"git-zip-tree can be safely removed because it was never part of a formal\nrelease.  This patch makes 'git-archive --format=zip' the one and only git\nZIP file creation command.  \n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n\n Documentation/git-zip-tree.txt |   67 ----------------------------------------\n .gitignore                     |    1 -\n builtin-zip-tree.c             |   65 --------------------------------------\n builtin.h                      |    1 -\n git.c                          |    1 -\n 5 files changed, 0 insertions(+), 135 deletions(-)\n\ndiff --git a/Documentation/git-zip-tree.txt b/Documentation/git-zip-tree.txt\ndeleted file mode 100644\nindex 2e9d981..0000000\n--- a/Documentation/git-zip-tree.txt\n+++ /dev/null\n@@ -1,67 +0,0 @@\n-git-zip-tree(1)\n-===============\n-\n-NAME\n-----\n-git-zip-tree - Creates a ZIP archive of the files in the named tree\n-\n-\n-SYNOPSIS\n---------\n-'git-zip-tree' [-0|...|-9] <tree-ish> [ <base> ]\n-\n-DESCRIPTION\n------------\n-Creates a ZIP archive containing the tree structure for the named tree.\n-When <base> is specified it is added as a leading path to the files in the\n-generated ZIP archive.\n-\n-git-zip-tree behaves differently when given a tree ID versus when given\n-a commit ID or tag ID.  In the first case the current time is used as\n-modification time of each file in the archive.  In the latter case the\n-commit time as recorded in the referenced commit object is used instead.\n-Additionally the commit ID is stored as an archive comment.\n-\n-Currently git-zip-tree can handle only files and directories, symbolic\n-links are not supported.\n-\n-OPTIONS\n--------\n-\n--0::\n-\tStore the files instead of deflating them.\n-\n--9::\n-\tHighest and slowest compression level.  You can specify any\n-\tnumber from 1 to 9 to adjust compression speed and ratio.\n-\n-<tree-ish>::\n-\tThe tree or commit to produce ZIP archive for.  If it is\n-\tthe object name of a commit object.\n-\n-<base>::\n-\tLeading path to the files in the resulting ZIP archive.\n-\n-EXAMPLES\n---------\n-git zip-tree v1.4.0 git-1.4.0 >git-1.4.0.zip::\n-\n-\tCreate a ZIP file for v1.4.0 release.\n-\n-git zip-tree HEAD:Documentation/ git-docs >docs.zip::\n-\n-\tPut everything in the current head's Documentation/ directory\n-\tinto 'docs.zip', with the prefix 'git-docs/'.\n-\n-Author\n-------\n-Written by Rene Scharfe.\n-\n-Documentation\n---------------\n-Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.\n-\n-GIT\n----\n-Part of the gitlink:git[7] suite\n-\ndiff --git a/.gitignore b/.gitignore\nindex a3d9c7a..3ca66e4 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -128,7 +128,6 @@ git-verify-pack\n git-verify-tag\n git-whatchanged\n git-write-tree\n-git-zip-tree\n git-core-*/?*\n gitweb/gitweb.cgi\n test-date\ndiff --git a/builtin-zip-tree.c b/builtin-zip-tree.c\nindex 52d4b7a..3ffdad6 100644\n--- a/builtin-zip-tree.c\n+++ b/builtin-zip-tree.c\n@@ -10,9 +10,6 @@ #include \"quote.h\"\n #include \"builtin.h\"\n #include \"archive.h\"\n \n-static const char zip_tree_usage[] =\n-\"git-zip-tree [-0|...|-9] <tree-ish> [ <base> ]\";\n-\n static int verbose;\n static int zip_date;\n static int zip_time;\n@@ -294,68 +291,6 @@ static void dos_time(time_t *time, int *\n \t*dos_time = t->tm_sec / 2 + t->tm_min * 32 + t->tm_hour * 2048;\n }\n \n-int cmd_zip_tree(int argc, const char **argv, const char *prefix)\n-{\n-\tunsigned char sha1[20];\n-\tstruct tree *tree;\n-\tstruct commit *commit;\n-\ttime_t archive_time;\n-\tchar *base;\n-\tint baselen;\n-\n-\tgit_config(git_default_config);\n-\n-\tif (argc > 1 && argv[1][0] == '-') {\n-\t\tif (isdigit(argv[1][1]) && argv[1][2] == '\\0') {\n-\t\t\tzlib_compression_level = argv[1][1] - '0';\n-\t\t\targc--;\n-\t\t\targv++;\n-\t\t}\n-\t}\n-\n-\tswitch (argc) {\n-\tcase 3:\n-\t\tbase = xstrdup(argv[2]);\n-\t\tbaselen = strlen(base);\n-\t\tbreak;\n-\tcase 2:\n-\t\tbase = xstrdup(\"\");\n-\t\tbaselen = 0;\n-\t\tbreak;\n-\tdefault:\n-\t\tusage(zip_tree_usage);\n-\t}\n-\n-\tif (get_sha1(argv[1], sha1))\n-\t\tdie(\"Not a valid object name %s\", argv[1]);\n-\n-\tcommit = lookup_commit_reference_gently(sha1, 1);\n-\tarchive_time = commit ? commit->date : time(NULL);\n-\tdos_time(&archive_time, &zip_date, &zip_time);\n-\n-\tzip_dir = xmalloc(ZIP_DIRECTORY_MIN_SIZE);\n-\tzip_dir_size = ZIP_DIRECTORY_MIN_SIZE;\n-\n-\ttree = parse_tree_indirect(sha1);\n-\tif (!tree)\n-\t\tdie(\"not a tree object\");\n-\n-\tif (baselen > 0) {\n-\t\twrite_zip_entry(tree->object.sha1, \"\", 0, base, 040777, 0);\n-\t\tbase = xrealloc(base, baselen + 1);\n-\t\tbase[baselen] = '/';\n-\t\tbaselen++;\n-\t\tbase[baselen] = '\\0';\n-\t}\n-\tread_tree_recursive(tree, base, baselen, 0, NULL, write_zip_entry);\n-\twrite_zip_trailer(commit ? commit->object.sha1 : NULL);\n-\n-\tfree(zip_dir);\n-\tfree(base);\n-\n-\treturn 0;\n-}\n-\n int write_zip_archive(struct archiver_args *args)\n {\n \tint plen = strlen(args->base);\ndiff --git a/builtin.h b/builtin.h\nindex ccade94..f9fa9ff 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -53,7 +53,6 @@ extern int cmd_show(int argc, const char\n extern int cmd_stripspace(int argc, const char **argv, const char *prefix);\n extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);\n extern int cmd_tar_tree(int argc, const char **argv, const char *prefix);\n-extern int cmd_zip_tree(int argc, const char **argv, const char *prefix);\n extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);\n extern int cmd_update_index(int argc, const char **argv, const char *prefix);\n extern int cmd_update_ref(int argc, const char **argv, const char *prefix);\ndiff --git a/git.c b/git.c\nindex 44ab0de..1686220 100644\n--- a/git.c\n+++ b/git.c\n@@ -259,7 +259,6 @@ static void handle_internal_command(int \n \t\t{ \"stripspace\", cmd_stripspace },\n \t\t{ \"symbolic-ref\", cmd_symbolic_ref, RUN_SETUP },\n \t\t{ \"tar-tree\", cmd_tar_tree, RUN_SETUP },\n-\t\t{ \"zip-tree\", cmd_zip_tree, RUN_SETUP },\n \t\t{ \"unpack-objects\", cmd_unpack_objects, RUN_SETUP },\n \t\t{ \"update-index\", cmd_update_index, RUN_SETUP },\n \t\t{ \"update-ref\", cmd_update_ref, RUN_SETUP },\n"},{"id":"27616","messageId":"4517B018.4040907@innova-card.com","threadId":"5661","inReplyTo":"45154D63.8030107@lsrfire.ath.cx","subject":"Re: [PATCH 1/2] Remove git-zip-tree","fromName":"Franck Bui-Huu","fromEmail":"vagabon.xyz@gmail.com","sentAt":"2006-09-25T10:31:52Z","receivedAt":"2006-09-25T10:31:52Z","isPatch":true,"sender":{"key":"vagabon.xyz@gmail.com","avatar":null},"body":"Rene Scharfe wrote:\n> git-zip-tree can be safely removed because it was never part of a formal\n> release.  This patch makes 'git-archive --format=zip' the one and only git\n> ZIP file creation command.  \n> \n[snip]\n> -\n> -Currently git-zip-tree can handle only files and directories, symbolic\n> -links are not supported.\n> -\n> -OPTIONS\n> --------\n> -\n> --0::\n> -\tStore the files instead of deflating them.\n> -\n> --9::\n> -\tHighest and slowest compression level.  You can specify any\n> -\tnumber from 1 to 9 to adjust compression speed and ratio.\n> -\n\nWe should keep these options documented somewhere... What about this ?\n\n-- >8 --\n\nSubject: [PATCH] git-archive: update documentation\n\nThis patch documents zip backend options.\n\nIt also adds git-archive command into the main git manual\npage.\n\nSigned-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>\n---\n Documentation/git-archive.txt |   13 +++++++++++++\n Documentation/git.txt         |    3 +++\n 2 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt\nindex 913528d..031fcd5 100644\n--- a/Documentation/git-archive.txt\n+++ b/Documentation/git-archive.txt\n@@ -40,6 +40,7 @@ OPTIONS\n \n <extra>::\n \tThis can be any options that the archiver backend understand.\n+\tSee next section.\n \n --remote=<repo>::\n \tInstead of making a tar archive from local repository,\n@@ -52,6 +53,18 @@ path::\n \tIf one or more paths are specified, include only these in the\n \tarchive, otherwise include all files and subdirectories.\n \n+BACKEND EXTRA OPTIONS\n+---------------------\n+\n+zip\n+~~~\n+-0::\n+\tStore the files instead of deflating them.\n+-9::\n+\tHighest and slowest compression level.  You can specify any\n+\tnumber from 1 to 9 to adjust compression speed and ratio.\n+\n+\n CONFIGURATION\n -------------\n By default, file and directories modes are set to 0666 or 0777 in tar\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 1bf5ef5..2135b65 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -266,6 +266,9 @@ gitlink:git-am[1]::\n gitlink:git-applymbox[1]::\n \tApply patches from a mailbox, original version by Linus.\n \n+gitlink:git-archive[1]::\n+\tCreates an archive of files from a named tree.\n+\n gitlink:git-bisect[1]::\n \tFind the change that introduced a bug by binary search.\n \n-- \n1.4.2.1\n"},{"id":"27633","messageId":"45181BDE.3090305@lsrfire.ath.cx","threadId":"5661","inReplyTo":"4517B018.4040907@innova-card.com","subject":"Re: [PATCH 1/2] Remove git-zip-tree","fromName":"Rene Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2006-09-25T18:11:42Z","receivedAt":"2006-09-25T18:11:42Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Franck Bui-Huu schrieb:\n> Subject: [PATCH] git-archive: update documentation\n> \n> This patch documents zip backend options.\n> \n> It also adds git-archive command into the main git manual\n> page.\n\nAh, yes.  Thanks for catching this omission.\n\nRené\n"}]}