]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cocci: apply the "diff.h" part of "the_repository.pending"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 28 Mar 2023 13:58:49 +0000 (15:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 14:36:45 +0000 (07:36 -0700)
Apply the part of "the_repository.pending.cocci" pertaining to
"diff.h".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c
builtin/rebase.c
builtin/stash.c
contrib/coccinelle/the_repository.cocci
contrib/coccinelle/the_repository.pending.cocci
diff.h
log-tree.c
range-diff.c

index f249aca049a5a37dae5686cde335931dbe6f9483..b76a1c82d8f0da4a478f47db0d830d1a751923ec 100644 (file)
@@ -1371,7 +1371,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
                        .other_arg = &other_arg
                };
 
-               diff_setup(&opts);
+               repo_diff_setup(the_repository, &opts);
                opts.file = rev->diffopt.file;
                opts.use_color = rev->diffopt.use_color;
                diff_setup_done(&opts);
index eba48bffaad1149adfc3010b347e74de7cca4fc2..76cce94373e1c1d3c2ee21345463adbd437fc3da 100644 (file)
@@ -1786,7 +1786,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                }
 
                /* We want color (if set), but no pager */
-               diff_setup(&opts);
+               repo_diff_setup(the_repository, &opts);
                opts.stat_width = -1; /* use full terminal width */
                opts.stat_graph_width = -1; /* respect statGraphWidth config */
                opts.output_format |=
index ed1275829e7e4adb0136969c3b13cde2a40074f0..6c062e5204852755e9f849452eed139f89c9a68b 100644 (file)
@@ -427,7 +427,7 @@ static void unstage_changes_unless_new(struct object_id *orig_tree)
         * to the index before a merge was run) and the current index
         * (reflecting the changes brought in by the merge).
         */
-       diff_setup(&diff_opts);
+       repo_diff_setup(the_repository, &diff_opts);
        diff_opts.flags.recursive = 1;
        diff_opts.detect_rename = 0;
        diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
index 0cdf3f46304ba8ec9dbea7b4a37b39961dacd42a..3c0bd8781e774a205f9f7cfe2599c61f42834b43 100644 (file)
 |
 - get_commit_tree
 + repo_get_commit_tree
+// diff.h
+|
+- diff_setup
++ repo_diff_setup
 )
   (
 + the_repository,
index bf19e6a2487f1b17c2a12bcbf160c49e0b5f7b04..00461ee86b3c2a4d46554dbf0354fbcbb1caeedd 100644 (file)
@@ -5,11 +5,7 @@
 @@
 @@
 (
-// diff.h
-- diff_setup
-+ repo_diff_setup
 // object-store.h
-|
 - read_object_file
 + repo_read_object_file
 |
diff --git a/diff.h b/diff.h
index 8d770b1d579c8ec61ce52c4ac4c9df799c509901..8b510eb579d77643dd2b5e9035556e42e5f5478b 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -535,9 +535,6 @@ int git_diff_basic_config(const char *var, const char *value, void *cb);
 int git_diff_heuristic_config(const char *var, const char *value, void *cb);
 void init_diff_ui_defaults(void);
 int git_diff_ui_config(const char *var, const char *value, void *cb);
-#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
-#define diff_setup(diffopts) repo_diff_setup(the_repository, diffopts)
-#endif
 void repo_diff_setup(struct repository *, struct diff_options *);
 struct option *add_diff_options(const struct option *, struct diff_options *);
 int diff_opt_parse(struct diff_options *, const char **, int, const char *);
index 4bebb86ecacf002b6db1c80e607344405425ce78..1bd4d6ab00827aceb1e91079a4d54631fb24a4c9 100644 (file)
@@ -849,7 +849,7 @@ void show_log(struct rev_info *opt)
                 * Pass minimum required diff-options to range-diff; others
                 * can be added later if deemed desirable.
                 */
-               diff_setup(&opts);
+               repo_diff_setup(the_repository, &opts);
                opts.file = opt->diffopt.file;
                opts.use_color = opt->diffopt.use_color;
                diff_setup_done(&opts);
index 5bcf966f6c5d2332cca08f5bd21d2fdbaa6064cf..15d0bc35a8782917e3c6ae0ced1188f20987d3e1 100644 (file)
@@ -485,7 +485,7 @@ static void output(struct string_list *a, struct string_list *b,
        if (range_diff_opts->diffopt)
                memcpy(&opts, range_diff_opts->diffopt, sizeof(opts));
        else
-               diff_setup(&opts);
+               repo_diff_setup(the_repository, &opts);
 
        opts.no_free = 1;
        if (!opts.output_format)