@matheusbsbs / matheus-bagliano / commits / 4cc41a16c1
Fork 0

Remove git-diff-stages.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 7, 2007 at 17:03 UTC 4cc41a16c15a6d73b13f9211eb8bf49ec869705f
9 files changed +2 -160
.gitignore
-1
@@ -33,7 +33,6 @@ git-daemon
33 git-diff
34 git-diff-files
35 git-diff-index
36 -git-diff-stages
36 git-diff-tree
37 git-describe
38 git-fast-import
Documentation/cmd-list.perl
-1
@@ -90,7 +90,6 @@ git-describe mainporcelain
90 git-diff-files plumbinginterrogators
91 git-diff-index plumbinginterrogators
92 git-diff mainporcelain
93 -git-diff-stages plumbinginterrogators
93 git-diff-tree plumbinginterrogators
94 git-fast-import ancillarymanipulators
95 git-fetch mainporcelain
Documentation/diffcore.txt
+2 -5
@@ -6,8 +6,8 @@ June 2005
6 Introduction
7 ------------
8
9 -The diff commands git-diff-index, git-diff-files, git-diff-tree, and
10 -git-diff-stages can be told to manipulate differences they find in
9 +The diff commands git-diff-index, git-diff-files, and git-diff-tree
10 +can be told to manipulate differences they find in
11 unconventional ways before showing diff(1) output. The manipulation
12 is collectively called "diffcore transformation". This short note
13 describes what they are and how to use them to produce diff outputs
@@ -30,9 +30,6 @@ files:
30
31 - git-diff-tree compares contents of two "tree" objects;
32
33 - - git-diff-stages compares contents of blobs at two stages in an
34 - unmerged index file.
35 -
33 In all of these cases, the commands themselves compare
34 corresponding paths in the two sets of files. The result of
35 comparison is passed from these commands to what is internally
Documentation/git-diff-stages.txt deleted
-42
@@ -1,42 +0,0 @@
1 -git-diff-stages(1)
2 -==================
3 -
4 -NAME
5 -----
6 -git-diff-stages - Compares two merge stages in the index
7 -
8 -
9 -SYNOPSIS
10 ---------
11 -'git-diff-stages' [<common diff options>] <stage1> <stage2> [<path>...]
12 -
13 -DESCRIPTION
14 ------------
15 -DEPRECATED and will be removed in 1.5.1.
16 -
17 -Compares the content and mode of the blobs in two stages in an
18 -unmerged index file.
19 -
20 -OPTIONS
21 --------
22 -include::diff-options.txt[]
23 -
24 -<stage1>,<stage2>::
25 - The stage number to be compared.
26 -
27 -Output format
28 --------------
29 -include::diff-format.txt[]
30 -
31 -
32 -Author
33 -------
34 -Written by Junio C Hamano <junkio@cox.net>
35 -
36 -Documentation
37 ---------------
38 -Documentation by Junio C Hamano.
39 -
40 -GIT
41 ----
42 -Part of the gitlink:git[7] suite
Makefile
-1
@@ -280,7 +280,6 @@ BUILTIN_OBJS = \
280 builtin-diff.o \
281 builtin-diff-files.o \
282 builtin-diff-index.o \
283 - builtin-diff-stages.o \
283 builtin-diff-tree.o \
284 builtin-fmt-merge-msg.o \
285 builtin-for-each-ref.o \
builtin-diff-stages.c deleted
-107
@@ -1,107 +0,0 @@
1 -/*
2 - * Copyright (c) 2005 Junio C Hamano
3 - */
4 -
5 -#include "cache.h"
6 -#include "diff.h"
7 -#include "builtin.h"
8 -
9 -static struct diff_options diff_options;
10 -
11 -static const char diff_stages_usage[] =
12 -"git-diff-stages [<common diff options>] <stage1> <stage2> [<path>...]"
13 -COMMON_DIFF_OPTIONS_HELP;
14 -
15 -static void diff_stages(int stage1, int stage2, const char **pathspec)
16 -{
17 - int i = 0;
18 - while (i < active_nr) {
19 - struct cache_entry *ce, *stages[4] = { NULL, };
20 - struct cache_entry *one, *two;
21 - const char *name;
22 - int len, skip;
23 -
24 - ce = active_cache[i];
25 - skip = !ce_path_match(ce, pathspec);
26 - len = ce_namelen(ce);
27 - name = ce->name;
28 - for (;;) {
29 - int stage = ce_stage(ce);
30 - stages[stage] = ce;
31 - if (active_nr <= ++i)
32 - break;
33 - ce = active_cache[i];
34 - if (ce_namelen(ce) != len ||
35 - memcmp(name, ce->name, len))
36 - break;
37 - }
38 - one = stages[stage1];
39 - two = stages[stage2];
40 -
41 - if (skip || (!one && !two))
42 - continue;
43 - if (!one)
44 - diff_addremove(&diff_options, '+', ntohl(two->ce_mode),
45 - two->sha1, name, NULL);
46 - else if (!two)
47 - diff_addremove(&diff_options, '-', ntohl(one->ce_mode),
48 - one->sha1, name, NULL);
49 - else if (hashcmp(one->sha1, two->sha1) ||
50 - (one->ce_mode != two->ce_mode) ||
51 - diff_options.find_copies_harder)
52 - diff_change(&diff_options,
53 - ntohl(one->ce_mode), ntohl(two->ce_mode),
54 - one->sha1, two->sha1, name, NULL);
55 - }
56 -}
57 -
58 -int cmd_diff_stages(int ac, const char **av, const char *prefix)
59 -{
60 - int stage1, stage2;
61 - const char **pathspec = NULL;
62 -
63 - git_config(git_default_config); /* no "diff" UI options */
64 - read_cache();
65 - diff_setup(&diff_options);
66 - while (1 < ac && av[1][0] == '-') {
67 - const char *arg = av[1];
68 - if (!strcmp(arg, "-r"))
69 - ; /* as usual */
70 - else {
71 - int diff_opt_cnt;
72 - diff_opt_cnt = diff_opt_parse(&diff_options,
73 - av+1, ac-1);
74 - if (diff_opt_cnt < 0)
75 - usage(diff_stages_usage);
76 - else if (diff_opt_cnt) {
77 - av += diff_opt_cnt;
78 - ac -= diff_opt_cnt;
79 - continue;
80 - }
81 - else
82 - usage(diff_stages_usage);
83 - }
84 - ac--; av++;
85 - }
86 -
87 - if (!diff_options.output_format)
88 - diff_options.output_format = DIFF_FORMAT_RAW;
89 -
90 - if (ac < 3 ||
91 - sscanf(av[1], "%d", &stage1) != 1 ||
92 - ! (0 <= stage1 && stage1 <= 3) ||
93 - sscanf(av[2], "%d", &stage2) != 1 ||
94 - ! (0 <= stage2 && stage2 <= 3))
95 - usage(diff_stages_usage);
96 -
97 - av += 3; /* The rest from av[0] are for paths restriction. */
98 - pathspec = get_pathspec(prefix, av);
99 -
100 - if (diff_setup_done(&diff_options) < 0)
101 - usage(diff_stages_usage);
102 -
103 - diff_stages(stage1, stage2, pathspec);
104 - diffcore_std(&diff_options);
105 - diff_flush(&diff_options);
106 - return 0;
107 -}
builtin.h
-1
@@ -29,7 +29,6 @@ extern int cmd_describe(int argc, const char **argv, const char *prefix);
29 extern int cmd_diff_files(int argc, const char **argv, const char *prefix);
30 extern int cmd_diff_index(int argc, const char **argv, const char *prefix);
31 extern int cmd_diff(int argc, const char **argv, const char *prefix);
32 -extern int cmd_diff_stages(int argc, const char **argv, const char *prefix);
32 extern int cmd_diff_tree(int argc, const char **argv, const char *prefix);
33 extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
34 extern int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
contrib/completion/git-completion.bash
-1
@@ -269,7 +269,6 @@ __git_commands ()
269 cvsimport) : import;;
270 cvsserver) : daemon;;
271 daemon) : daemon;;
272 - diff-stages) : nobody uses it;;
272 fast-import) : import;;
273 fsck-objects) : plumbing;;
274 fetch-pack) : plumbing;;
git.c
-1
@@ -240,7 +240,6 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
240 { "diff", cmd_diff, RUN_SETUP | USE_PAGER },
241 { "diff-files", cmd_diff_files, RUN_SETUP },
242 { "diff-index", cmd_diff_index, RUN_SETUP },
243 - { "diff-stages", cmd_diff_stages, RUN_SETUP },
243 { "diff-tree", cmd_diff_tree, RUN_SETUP },
244 { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },
245 { "for-each-ref", cmd_for_each_ref, RUN_SETUP },