Re: [PATCH v2 3/3] refspec: relocate apply_refspecs and related funtions
- From
Meet Soni <meetsoni3017@gmail.com>
- Date
- Jan 29, 2025, 07:03 UTC
- Message-ID
- <CAPhwyn0tsU-0Tw44DeZssBJnjDpL_mYF6OBGT5sTdSYEy+k4cw@mail.gmail.com>
- In-Reply-To
- <xmqqtt9kqak5.fsf@gitster.g>
On Tue, 28 Jan 2025 at 01:44, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> > Meet Soni <meetsoni3017@gmail.com> writes: > > > +/* > > + * Applies refspecs to a name and returns the corresponding destination. > > + * Returns the destination string if a match is found, NULL otherwise. > > + */ > > +char *apply_refspecs(struct refspec *rs, const char *name); > > Explaining a function whose name has "apply" with a comment that > uses "apply" as the verb does not add as much information as a > comment with a bit rephrased explanation. What does it mean to > "apply refspec to a name" in the context of this function?
The term "apply" was intended to convey the idea of mapping the refspec with the given name, but it’s more helpful to describe the function’s behavior more explicitly.
I’ll update the comment in the next version of this series. Here’s the revised comment I plan to use:
/* * Search for a refspec that matches the given name and return the * corresponding destination (dst) if a match is found, NULL otherwise. */