Re: [RFC PATCH 1/3] refspec: relocate omit_name_by_refspec and related functions
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jan 24, 2025, 08:01 UTC
- Message-ID
- <Z5NI5jVxcNtPQmi8@pks.im>
- In-Reply-To
- <20250122075154.5697-2-meetsoni3017@gmail.com>
On Wed, Jan 22, 2025 at 01:21:52PM +0530, Meet Soni wrote:
Show 15 quoted lines
> diff --git a/refspec.h b/refspec.h > index 69d693c87d..9556d08bd5 100644 > --- a/refspec.h > +++ b/refspec.h > @@ -71,4 +71,12 @@ struct strvec; > void refspec_ref_prefixes(const struct refspec *rs, > struct strvec *ref_prefixes); > > +/* > + * Check whether a name matches any negative refspec in rs. Returns 1 if the > + * name matches at least one negative refspec, and 0 otherwise. > + */ > +int omit_name_by_refspec(const char *name, struct refspec *rs); > +int match_name_with_pattern(const char *key, const char *name, > + const char *value, char **result);
Reading the signature of `match_name_with_pattern()` I wouldn't have any clue how to use it. Could we maybe add some documentation to it now that we expose it?
Show 12 quoted lines
> #endif /* REFSPEC_H */
> diff --git a/remote.c b/remote.c
> index 0f6fba8562..40c2418065 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -907,54 +907,6 @@ void ref_push_report_free(struct ref_push_report *report)
> }
> }
>
> -static int match_name_with_pattern(const char *key, const char *name,
> - const char *value, char **result)
> -{It's a bit unfortunate that we have to convert this static function to a non-static one, but I guess it makes sense in the bigger picture of what this series wants to achieve.
Patrick