@matheusbsbs / matheus-bagliano / commits / 58452f9442
Fork 0

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>

Junio C Hamano committed Oct 16, 2005 at 22:06 UTC 58452f9442a1fa20e0fde5d200091b7f02e62cea
2 files changed +2 -43
Documentation/git-apply.txt
+1 -4
@@ -8,7 +8,7 @@ git-apply - Apply patch on a git index file and a work tree
8
9 SYNOPSIS
10 --------
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>...]
12
13 DESCRIPTION
14 -----------
@@ -45,9 +45,6 @@ OPTIONS
45 up-to-date, it is flagged as an error. This flag also
46 causes the index file to be updated.
47
48 ---show-files::
49 - Show summary of files that are affected by the patch.
50 -
48 --index-info::
49 Newer git-diff output has embedded 'index information'
50 for each blob to help identify the original version that
apply.c
+1 -39
@@ -13,7 +13,6 @@
13 // --check turns on checking that the working tree matches the
14 // files that are being modified, but doesn't apply the patch
15 // --stat does just a diffstat, and doesn't actually apply
16 -// --show-files shows the directory changes
16 // --index-info shows the old and new index info for paths if available.
17 //
18 static int check_index = 0;
@@ -22,11 +21,10 @@ static int diffstat = 0;
21 static int summary = 0;
22 static int check = 0;
23 static int apply = 1;
25 -static int show_files = 0;
24 static int show_index_info = 0;
25 static int line_termination = '\n';
26 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>...";
28
29 /*
30 * For "diff-stat" like behaviour, we keep track of the biggest change
@@ -1270,35 +1268,6 @@ static int check_patch_list(struct patch *patch)
1268 return error;
1269 }
1270
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 -
1271 static inline int is_null_sha1(const unsigned char *sha1)
1272 {
1273 return !memcmp(sha1, null_sha1, 20);
@@ -1675,9 +1644,6 @@ static int apply_patch(int fd)
1644 die("Unable to write new cachefile");
1645 }
1646
1678 - if (show_files)
1679 - show_file_list(list);
1680 -
1647 if (show_index_info)
1648 show_index_list(list);
1649
@@ -1735,10 +1701,6 @@ int main(int argc, char **argv)
1701 apply = 1;
1702 continue;
1703 }
1738 - if (!strcmp(arg, "--show-files")) {
1739 - show_files = 1;
1740 - continue;
1741 - }
1704 if (!strcmp(arg, "--index-info")) {
1705 apply = 0;
1706 show_index_info = 1;