Skip to content

Commit 925cecc

Browse files
johnkeepinggitster
authored andcommitted
tar-tree: remove deprecated command
"git tar-tree" has been a thin wrapper around "git archive" since commit fd88d9c (Remove upload-tar and make git-tar-tree a thin wrapper to git-archive, 2006-09-24), which also made it print a message indicating that git-tar-tree is deprecated. Signed-off-by: John Keeping <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb8e7e1 commit 925cecc

File tree

9 files changed

+5
-173
lines changed

9 files changed

+5
-173
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@
158158
/git-svn
159159
/git-symbolic-ref
160160
/git-tag
161-
/git-tar-tree
162161
/git-unpack-file
163162
/git-unpack-objects
164163
/git-update-index

Documentation/git-tar-tree.txt

Lines changed: 0 additions & 82 deletions
This file was deleted.

builtin/tar-tree.c

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,71 +7,9 @@
77
#include "builtin.h"
88
#include "quote.h"
99

10-
static const char tar_tree_usage[] =
11-
"git tar-tree [--remote=<repo>] <tree-ish> [basedir]\n"
12-
"*** Note that this command is now deprecated; use \"git archive\" instead.";
13-
1410
static const char builtin_get_tar_commit_id_usage[] =
1511
"git get-tar-commit-id < <tarfile>";
1612

17-
int cmd_tar_tree(int argc, const char **argv, const char *prefix)
18-
{
19-
/*
20-
* "git tar-tree" is now a wrapper around "git archive --format=tar"
21-
*
22-
* $0 --remote=<repo> arg... ==>
23-
* git archive --format=tar --remote=<repo> arg...
24-
* $0 tree-ish ==>
25-
* git archive --format=tar tree-ish
26-
* $0 tree-ish basedir ==>
27-
* git archive --format-tar --prefix=basedir tree-ish
28-
*/
29-
const char **nargv = xcalloc(sizeof(*nargv), argc + 3);
30-
struct strbuf sb = STRBUF_INIT;
31-
char *basedir_arg;
32-
int nargc = 0;
33-
34-
nargv[nargc++] = "archive";
35-
nargv[nargc++] = "--format=tar";
36-
37-
if (2 <= argc && !prefixcmp(argv[1], "--remote=")) {
38-
nargv[nargc++] = argv[1];
39-
argv++;
40-
argc--;
41-
}
42-
43-
/*
44-
* Because it's just a compatibility wrapper, tar-tree supports only
45-
* the old behaviour of reading attributes from the work tree.
46-
*/
47-
nargv[nargc++] = "--worktree-attributes";
48-
49-
switch (argc) {
50-
default:
51-
usage(tar_tree_usage);
52-
break;
53-
case 3:
54-
/* base-path */
55-
basedir_arg = xmalloc(strlen(argv[2]) + 11);
56-
sprintf(basedir_arg, "--prefix=%s/", argv[2]);
57-
nargv[nargc++] = basedir_arg;
58-
/* fallthru */
59-
case 2:
60-
/* tree-ish */
61-
nargv[nargc++] = argv[1];
62-
}
63-
nargv[nargc] = NULL;
64-
65-
fprintf(stderr,
66-
"*** \"git tar-tree\" is now deprecated.\n"
67-
"*** Running \"git archive\" instead.\n***");
68-
sq_quote_argv(&sb, nargv, 0);
69-
strbuf_addch(&sb, '\n');
70-
fputs(sb.buf, stderr);
71-
strbuf_release(&sb);
72-
return cmd_archive(nargc, nargv, prefix);
73-
}
74-
7513
/* ustar header + extended global header content */
7614
#define RECORDSIZE (512)
7715
#define HEADERSIZE (2 * RECORDSIZE)

command-list.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ git-submodule mainporcelain
126126
git-svn foreignscminterface
127127
git-symbolic-ref plumbingmanipulators
128128
git-tag mainporcelain common
129-
git-tar-tree plumbinginterrogators deprecated
130129
git-unpack-file plumbinginterrogators
131130
git-unpack-objects plumbingmanipulators
132131
git-update-index plumbingmanipulators

contrib/completion/git-completion.bash

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,6 @@ __git_list_porcelain_commands ()
706706
ssh-*) : transport;;
707707
stripspace) : plumbing;;
708708
symbolic-ref) : plumbing;;
709-
tar-tree) : deprecated;;
710709
unpack-file) : plumbing;;
711710
unpack-objects) : plumbing;;
712711
update-index) : plumbing;;

git.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ static void handle_internal_command(int argc, const char **argv)
437437
{ "stripspace", cmd_stripspace },
438438
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
439439
{ "tag", cmd_tag, RUN_SETUP },
440-
{ "tar-tree", cmd_tar_tree },
441440
{ "unpack-file", cmd_unpack_file, RUN_SETUP },
442441
{ "unpack-objects", cmd_unpack_objects, RUN_SETUP },
443442
{ "update-index", cmd_update_index, RUN_SETUP },

t/t4116-apply-reverse.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ test_expect_success 'apply in reverse' '
4848

4949
test_expect_success 'setup separate repository lacking postimage' '
5050
51-
git tar-tree initial initial | $TAR xf - &&
51+
git archive --format=tar --prefix=initial/ initial | $TAR xf - &&
5252
(
5353
cd initial && git init && git add .
5454
) &&
5555
56-
git tar-tree second second | $TAR xf - &&
56+
git archive --format=tar --prefix=second/ second | $TAR xf - &&
5757
(
5858
cd second && git init && git add .
5959
)

t/t5000-tar-tree.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (C) 2005 Rene Scharfe
44
#
55

6-
test_description='git tar-tree and git get-tar-commit-id test
6+
test_description='git archive and git get-tar-commit-id test
77
88
This test covers the topics of file contents, commit date handling and
99
commit id embedding:
@@ -13,11 +13,11 @@ commit id embedding:
1313
binary file (/bin/sh). Only paths shorter than 99 characters are
1414
used.
1515
16-
git tar-tree applies the commit date to every file in the archive it
16+
git archive applies the commit date to every file in the archive it
1717
creates. The test sets the commit date to a specific value and checks
1818
if the tar archive contains that value.
1919
20-
When giving git tar-tree a commit id (in contrast to a tree id) it
20+
When giving git archive a commit id (in contrast to a tree id) it
2121
embeds this commit id into the tar archive as a comment. The test
2222
checks the ability of git get-tar-commit-id to figure it out from the
2323
tar file.
@@ -196,16 +196,6 @@ test_expect_success \
196196
'git get-tar-commit-id <b.tar >b.commitid &&
197197
test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
198198

199-
test_expect_success 'git tar-tree' '
200-
git tar-tree HEAD >tar-tree.tar &&
201-
test_cmp b.tar tar-tree.tar
202-
'
203-
204-
test_expect_success 'git tar-tree with prefix' '
205-
git tar-tree HEAD prefix >tar-tree_with_prefix.tar &&
206-
test_cmp with_prefix.tar tar-tree_with_prefix.tar
207-
'
208-
209199
test_expect_success 'git archive with --output, override inferred format' '
210200
git archive --format=tar --output=d4.zip HEAD &&
211201
test_cmp b.tar d4.zip

t/t5001-archive-attr.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,4 @@ test_expect_success 'export-subst' '
8787
test_cmp substfile2 archive/substfile2
8888
'
8989

90-
test_expect_success 'git tar-tree vs. git archive with worktree attributes' '
91-
git tar-tree HEAD >tar-tree.tar &&
92-
test_cmp worktree.tar tar-tree.tar
93-
'
94-
95-
test_expect_success 'git tar-tree vs. git archive with worktree attrs, bare' '
96-
(cd bare && git tar-tree HEAD) >bare-tar-tree.tar &&
97-
test_cmp bare-worktree.tar bare-tar-tree.tar
98-
'
99-
10090
test_done

0 commit comments

Comments
 (0)