All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Glen Choo" <chooglen@google.com>,
	"Elijah Newren" <newren@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 08/17] cocci: apply the "diff.h" part of "the_repository.pending"
Date: Tue, 28 Mar 2023 15:58:49 +0200	[thread overview]
Message-ID: <patch-v2-08.17-f442e7b9acc-20230328T110947Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-v2-00.17-00000000000-20230328T110946Z-avarab@gmail.com>

Apply the part of "the_repository.pending.cocci" pertaining to
"diff.h".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/log.c                                   | 2 +-
 builtin/rebase.c                                | 2 +-
 builtin/stash.c                                 | 2 +-
 contrib/coccinelle/the_repository.cocci         | 4 ++++
 contrib/coccinelle/the_repository.pending.cocci | 4 ----
 diff.h                                          | 3 ---
 log-tree.c                                      | 2 +-
 range-diff.c                                    | 2 +-
 8 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index a55325025a4..11ba99d6b48 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1385,7 +1385,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);
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 3e2cdabfda5..80a5b7486f8 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1787,7 +1787,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 |=
diff --git a/builtin/stash.c b/builtin/stash.c
index dd5f67e7e6e..447c3b678f3 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -428,7 +428,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;
diff --git a/contrib/coccinelle/the_repository.cocci b/contrib/coccinelle/the_repository.cocci
index 0cdf3f46304..3c0bd8781e7 100644
--- a/contrib/coccinelle/the_repository.cocci
+++ b/contrib/coccinelle/the_repository.cocci
@@ -73,6 +73,10 @@
 |
 - get_commit_tree
 + repo_get_commit_tree
+// diff.h
+|
+- diff_setup
++ repo_diff_setup
 )
   (
 + the_repository,
diff --git a/contrib/coccinelle/the_repository.pending.cocci b/contrib/coccinelle/the_repository.pending.cocci
index bf19e6a2487..00461ee86b3 100644
--- a/contrib/coccinelle/the_repository.pending.cocci
+++ b/contrib/coccinelle/the_repository.pending.cocci
@@ -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 09627f6e84a..c759bedc269 100644
--- a/diff.h
+++ b/diff.h
@@ -536,9 +536,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 *);
diff --git a/log-tree.c b/log-tree.c
index 97d374c76d6..5c97bc403fb 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -852,7 +852,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);
diff --git a/range-diff.c b/range-diff.c
index 5bcf966f6c5..15d0bc35a87 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -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)
-- 
2.40.0.rc1.1034.g5867a1b10c5


  parent reply	other threads:[~2023-03-28 13:59 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 15:35 [PATCH 00/17] cocci: remove "the_index" wrapper macros Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 01/17] cocci: remove dead rule from "the_repository.pending.cocci" Ævar Arnfjörð Bjarmason
2023-03-17 16:14   ` Eric Sunshine
2023-03-19  5:53   ` Elijah Newren
2023-03-17 15:35 ` [PATCH 02/17] cocci: fix incorrect & verbose "the_repository" rules Ævar Arnfjörð Bjarmason
2023-03-19  5:55   ` Elijah Newren
2023-03-22 22:46   ` Glen Choo
2023-03-26  5:02     ` Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 03/17] cocci: sort "the_repository" rules by header Ævar Arnfjörð Bjarmason
2023-03-19  5:59   ` Elijah Newren
2023-03-17 15:35 ` [PATCH 04/17] cocci: add missing "the_repository" macros to "pending" Ævar Arnfjörð Bjarmason
2023-03-19  6:04   ` Elijah Newren
2023-03-17 15:35 ` [PATCH 05/17] cocci: apply the "cache.h" part of "the_repository.pending" Ævar Arnfjörð Bjarmason
2023-03-19  6:06   ` Elijah Newren
2023-03-22 23:17   ` Glen Choo
2023-03-17 15:35 ` [PATCH 06/17] cocci: apply the "commit-reach.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 07/17] cocci: apply the "commit.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 08/17] cocci: apply the "diff.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 09/17] cocci: apply the "object-store.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 10/17] cocci: apply the "pretty.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 11/17] cocci: apply the "packfile.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 12/17] cocci: apply the "promisor-remote.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 13/17] cocci: apply the "refs.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 14/17] cocci: apply the "rerere.h" " Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 15/17] cocci: apply the "revision.h" " Ævar Arnfjörð Bjarmason
2023-03-22 23:38   ` Glen Choo
2023-03-22 23:53     ` Glen Choo
2023-03-26  4:59       ` Ævar Arnfjörð Bjarmason
2023-03-17 15:35 ` [PATCH 16/17] post-cocci: adjust comments for recent repo_* migration Ævar Arnfjörð Bjarmason
2023-03-19  6:12   ` Elijah Newren
2023-03-17 15:35 ` [PATCH 17/17] libs: use "struct repository *" argument, not "the_repository" Ævar Arnfjörð Bjarmason
2023-03-19  6:19   ` Elijah Newren
2023-03-28 10:53     ` Ævar Arnfjörð Bjarmason
2023-03-17 19:22 ` [PATCH 00/17] cocci: remove "the_index" wrapper macros Junio C Hamano
2023-03-28 13:58 ` [PATCH v2 00/17] cocci: remove "the_repository" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 01/17] cocci: remove dead rule from "the_repository.pending.cocci" Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 02/17] cocci: fix incorrect & verbose "the_repository" rules Ævar Arnfjörð Bjarmason
2023-03-29 20:35     ` Taylor Blau
2023-03-28 13:58   ` [PATCH v2 03/17] cocci: sort "the_repository" rules by header Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 04/17] cocci: add missing "the_repository" macros to "pending" Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 05/17] cocci: apply the "cache.h" part of "the_repository.pending" Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 06/17] cocci: apply the "commit-reach.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 07/17] cocci: apply the "commit.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` Ævar Arnfjörð Bjarmason [this message]
2023-03-28 13:58   ` [PATCH v2 09/17] cocci: apply the "object-store.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 10/17] cocci: apply the "pretty.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 11/17] cocci: apply the "packfile.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 12/17] cocci: apply the "promisor-remote.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 13/17] cocci: apply the "refs.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 14/17] cocci: apply the "rerere.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 15/17] cocci: apply the "revision.h" " Ævar Arnfjörð Bjarmason
2023-03-28 13:58   ` [PATCH v2 16/17] post-cocci: adjust comments for recent repo_* migration Ævar Arnfjörð Bjarmason
2023-03-29 20:50     ` Taylor Blau
2023-03-28 13:58   ` [PATCH v2 17/17] libs: use "struct repository *" argument, not "the_repository" Ævar Arnfjörð Bjarmason
2023-03-28 14:09   ` [PATCH v2 00/17] cocci: remove "the_repository" wrapper macros Junio C Hamano
2023-03-28 14:34     ` Junio C Hamano
2023-03-29 19:02   ` Junio C Hamano
2023-03-29 22:04     ` Taylor Blau
2023-03-30  3:55     ` Elijah Newren
2023-03-30 18:08     ` Glen Choo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-v2-08.17-f442e7b9acc-20230328T110947Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.