All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: git@vger.kernel.org
Cc: Stefan Beller <stefanbeller@gmail.com>
Subject: [PATCH] coccinelle: simplify variable declaractions in rules from the_repository.pending.cocci
Date: Tue, 12 Nov 2019 22:00:24 +0100	[thread overview]
Message-ID: <c260ef87-21d6-8fbc-8060-d7d1c6330601@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 12 Nov 2019 21:55:18 +0100

This script contained some transformation rules for the semantic patch language
where a few metavariables were declared with the same type “expression”.
Reduce duplicate SmPL code just by listing the desired variable names
directly behind the type specification.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 .../coccinelle/the_repository.pending.cocci   | 44 +++++--------------
 1 file changed, 12 insertions(+), 32 deletions(-)

diff --git a/contrib/coccinelle/the_repository.pending.cocci b/contrib/coccinelle/the_repository.pending.cocci
index 2ee702ecf7..697e8fc77b 100644
--- a/contrib/coccinelle/the_repository.pending.cocci
+++ b/contrib/coccinelle/the_repository.pending.cocci
@@ -3,9 +3,7 @@
 // our code base.

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - read_object_file(
 + repo_read_object_file(the_repository,
@@ -42,17 +40,14 @@ expression F;
   E)

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - parse_commit_internal(
 + repo_parse_commit_internal(the_repository,
   E, F, G)

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - parse_commit_gently(
 + repo_parse_commit_gently(the_repository,
@@ -66,78 +61,63 @@ expression E;
   E)

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - get_merge_bases(
 + repo_get_merge_bases(the_repository,
   E, F);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - get_merge_bases_many(
 + repo_get_merge_bases_many(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - get_merge_bases_many_dirty(
 + repo_get_merge_bases_many_dirty(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - in_merge_bases(
 + repo_in_merge_bases(the_repository,
   E, F);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - in_merge_bases_many(
 + repo_in_merge_bases_many(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - get_commit_buffer(
 + repo_get_commit_buffer(the_repository,
   E, F);

 @@
-expression E;
-expression F;
+expression E, F;
 @@
 - unuse_commit_buffer(
 + repo_unuse_commit_buffer(the_repository,
   E, F);

 @@
-expression E;
-expression F;
-expression G;
+expression E, F, G;
 @@
 - logmsg_reencode(
 + repo_logmsg_reencode(the_repository,
   E, F, G);

 @@
-expression E;
-expression F;
-expression G;
-expression H;
+expression E, F, G, H;
 @@
 - format_commit_message(
 + repo_format_commit_message(the_repository,
--
2.24.0


                 reply	other threads:[~2019-11-12 21:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=c260ef87-21d6-8fbc-8060-d7d1c6330601@web.de \
    --to=markus.elfring@web.de \
    --cc=git@vger.kernel.org \
    --cc=stefanbeller@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.