Skip to content

Commit 58452f9

Browse files
author
Junio C Hamano
committed
git-apply: remove unused --show-files flag.
Linus says he does not use it (and the thinking behind its initial introduction), and neither Cogito nor StGIT uses it. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 973d6a2 commit 58452f9

File tree

2 files changed

+2
-43
lines changed

2 files changed

+2
-43
lines changed

Documentation/git-apply.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-apply - Apply patch on a git index file and a work tree
88

99
SYNOPSIS
1010
--------
11-
'git-apply' [--stat] [--summary] [--check] [--index] [--apply] [--show-files] [--index-info] [-z] [<patch>...]
11+
'git-apply' [--stat] [--summary] [--check] [--index] [--apply] [--index-info] [-z] [<patch>...]
1212

1313
DESCRIPTION
1414
-----------
@@ -45,9 +45,6 @@ OPTIONS
4545
up-to-date, it is flagged as an error. This flag also
4646
causes the index file to be updated.
4747

48-
--show-files::
49-
Show summary of files that are affected by the patch.
50-
5148
--index-info::
5249
Newer git-diff output has embedded 'index information'
5350
for each blob to help identify the original version that

apply.c

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// --check turns on checking that the working tree matches the
1414
// files that are being modified, but doesn't apply the patch
1515
// --stat does just a diffstat, and doesn't actually apply
16-
// --show-files shows the directory changes
1716
// --index-info shows the old and new index info for paths if available.
1817
//
1918
static int check_index = 0;
@@ -22,11 +21,10 @@ static int diffstat = 0;
2221
static int summary = 0;
2322
static int check = 0;
2423
static int apply = 1;
25-
static int show_files = 0;
2624
static int show_index_info = 0;
2725
static int line_termination = '\n';
2826
static const char apply_usage[] =
29-
"git-apply [--stat] [--summary] [--check] [--index] [--apply] [--show-files] [--index-info] [-z] <patch>...";
27+
"git-apply [--stat] [--summary] [--check] [--index] [--apply] [--index-info] [-z] <patch>...";
3028

3129
/*
3230
* For "diff-stat" like behaviour, we keep track of the biggest change
@@ -1270,35 +1268,6 @@ static int check_patch_list(struct patch *patch)
12701268
return error;
12711269
}
12721270

1273-
static void show_file(int c, unsigned int mode, const char *name)
1274-
{
1275-
printf("%c %o %s\n", c, mode, name);
1276-
}
1277-
1278-
static void show_file_list(struct patch *patch)
1279-
{
1280-
for (;patch ; patch = patch->next) {
1281-
if (patch->is_rename) {
1282-
show_file('-', patch->old_mode, patch->old_name);
1283-
show_file('+', patch->new_mode, patch->new_name);
1284-
continue;
1285-
}
1286-
if (patch->is_copy || patch->is_new) {
1287-
show_file('+', patch->new_mode, patch->new_name);
1288-
continue;
1289-
}
1290-
if (patch->is_delete) {
1291-
show_file('-', patch->old_mode, patch->old_name);
1292-
continue;
1293-
}
1294-
if (patch->old_mode && patch->new_mode && patch->old_mode != patch->new_mode) {
1295-
printf("M %o:%o %s\n", patch->old_mode, patch->new_mode, patch->old_name);
1296-
continue;
1297-
}
1298-
printf("M %o %s\n", patch->old_mode, patch->old_name);
1299-
}
1300-
}
1301-
13021271
static inline int is_null_sha1(const unsigned char *sha1)
13031272
{
13041273
return !memcmp(sha1, null_sha1, 20);
@@ -1675,9 +1644,6 @@ static int apply_patch(int fd)
16751644
die("Unable to write new cachefile");
16761645
}
16771646

1678-
if (show_files)
1679-
show_file_list(list);
1680-
16811647
if (show_index_info)
16821648
show_index_list(list);
16831649

@@ -1735,10 +1701,6 @@ int main(int argc, char **argv)
17351701
apply = 1;
17361702
continue;
17371703
}
1738-
if (!strcmp(arg, "--show-files")) {
1739-
show_files = 1;
1740-
continue;
1741-
}
17421704
if (!strcmp(arg, "--index-info")) {
17431705
apply = 0;
17441706
show_index_info = 1;

0 commit comments

Comments
 (0)