git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Cc: Derrick Stolee <derrickstolee@github.com>
Subject: [PATCH 3/6] match_pathname(): drop unused "flags" parameter
Date: Fri, 19 Aug 2022 04:50:54 -0400	[thread overview]
Message-ID: <Yv9O7nSS+WMzm0I7@coredump.intra.peff.net> (raw)
In-Reply-To: <Yv9Oay+tNqhLDqVl@coredump.intra.peff.net>

This field has not been used since the function was introduced in
b559263216 (exclude: split pathname matching code into a separate
function, 2012-10-15), though there was a brief period where it was
erroneously used and then reverted in ed4958477b (dir: fix pattern
matching on dirs, 2021-09-24) and 5ceb663e92 (dir: fix
directory-matching bug, 2021-11-02).

It's possible we'd eventually add a flag that makes it useful here, but
there are only a handful of callers. It would be easy to add back if
necessary, and in the meantime this makes the function interface less
misleading.

Signed-off-by: Jeff King <peff@peff.net>
---
 attr.c | 2 +-
 dir.c  | 6 ++----
 dir.h  | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/attr.c b/attr.c
index 21e4ad25ad..8a78dde69e 100644
--- a/attr.c
+++ b/attr.c
@@ -1023,7 +1023,7 @@ static int path_matches(const char *pathname, int pathlen,
 	}
 	return match_pathname(pathname, pathlen - isdir,
 			      base, baselen,
-			      pattern, prefix, pat->patternlen, pat->flags);
+			      pattern, prefix, pat->patternlen);
 }
 
 static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem);
diff --git a/dir.c b/dir.c
index d7cfb08e44..50eeb8b11e 100644
--- a/dir.c
+++ b/dir.c
@@ -1244,8 +1244,7 @@ int match_basename(const char *basename, int basenamelen,
 
 int match_pathname(const char *pathname, int pathlen,
 		   const char *base, int baselen,
-		   const char *pattern, int prefix, int patternlen,
-		   unsigned flags)
+		   const char *pattern, int prefix, int patternlen)
 {
 	const char *name;
 	int namelen;
@@ -1347,8 +1346,7 @@ static struct path_pattern *last_matching_pattern_from_list(const char *pathname
 		if (match_pathname(pathname, pathlen,
 				   pattern->base,
 				   pattern->baselen ? pattern->baselen - 1 : 0,
-				   exclude, prefix, pattern->patternlen,
-				   pattern->flags)) {
+				   exclude, prefix, pattern->patternlen)) {
 			res = pattern;
 			break;
 		}
diff --git a/dir.h b/dir.h
index 7bc862030c..674747d93a 100644
--- a/dir.h
+++ b/dir.h
@@ -414,7 +414,7 @@ int match_basename(const char *, int,
 		   const char *, int, int, unsigned);
 int match_pathname(const char *, int,
 		   const char *, int,
-		   const char *, int, int, unsigned);
+		   const char *, int, int);
 
 struct path_pattern *last_matching_pattern(struct dir_struct *dir,
 					   struct index_state *istate,
-- 
2.37.2.928.g0821088f4a


  parent reply	other threads:[~2022-08-19  8:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  8:48 [PATCH 0/6] unused function parameter potpourri Jeff King
2022-08-19  8:49 ` [PATCH 1/6] xdiff: drop unused mmfile parameters from xdl_do_histogram_diff() Jeff King
2022-08-19 13:32   ` Phillip Wood
2022-08-20  6:58     ` Jeff King
2022-08-20  7:36       ` [PATCH 7/6] xdiff: drop unused mmfile parameters from xdl_do_patience_diff() Jeff King
2022-08-26 13:15         ` Phillip Wood
2022-08-19  8:50 ` [PATCH 2/6] log-tree: drop unused commit param in remerge_diff() Jeff King
2022-08-19 23:05   ` Elijah Newren
2022-08-20  7:04     ` Jeff King
2022-08-19  8:50 ` Jeff King [this message]
2022-08-19  8:51 ` [PATCH 4/6] verify_one_sparse(): drop unused repository parameter Jeff King
2022-08-19 19:04   ` Derrick Stolee
2022-08-20  7:01     ` Jeff King
2022-08-20  8:48   ` René Scharfe
2022-08-20  9:02     ` [PATCH v2 " Jeff King
2022-08-19  8:54 ` [PATCH 5/6] reftable: drop unused parameter from reader_seek_linear() Jeff King
2022-08-19 19:06   ` Derrick Stolee
2022-08-22  7:46     ` Han-Wen Nienhuys
2022-08-19  8:55 ` [PATCH 6/6] reflog: assert PARSE_OPT_NONEG in parse-options callbacks Jeff King
2022-08-19 19:08 ` [PATCH 0/6] unused function parameter potpourri Derrick Stolee
2022-08-19 23:07   ` Elijah Newren

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=Yv9O7nSS+WMzm0I7@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).