git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] strbuf_stripspace(): rename skip_comments arg to strip_comments

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 2, 2023, 19:00 UTC
Message-ID
<64515dea5c566_1ba2d29487@chronos.notmuch>
In-Reply-To
<20230427083253.GA1478679@coredump.intra.peff.net>
Jeff King wrote:
Show 32 quoted lines
> I'll quote liberally from the original below:
> 
> On Thu, Mar 23, 2023 at 05:22:34PM +0100, Oswald Buddenhagen wrote:
> 
> > That makes its function much clearer and more consistent with the
> > context.
> > 
> > Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
> > ---
> >  strbuf.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/strbuf.c b/strbuf.c
> > index 1c57ac6574..49e8beaa4c 100644
> > --- a/strbuf.c
> > +++ b/strbuf.c
> > @@ -1118,10 +1118,10 @@ static size_t cleanup(char *line, size_t len)
> >   *
> >   * If last line does not have a newline at the end, one is added.
> >   *
> > - * Enable skip_comments to skip every line starting with comment
> > + * Enable strip_comments to strip every line starting with a comment
> >   * character.
> >   */
> > -void strbuf_stripspace(struct strbuf *sb, int skip_comments)
> > +void strbuf_stripspace(struct strbuf *sb, int strip_comments)
> 
> I don't have a strong opinion either way. The original name was just
> copied from stripspace()'s similar parameter, which came from 9690c118fa
> (Fix git-stripspace to process correctly long lines and spaces.,
> 2007-06-25). I don't think it carries any particular significance,
> though I find either name easy enough to understand.

To me strip_comments makes more sense, because it implies an active action, skip_comments implies nothing will be done on them.

-- 
Felipe Contreras
Previous: Jeff King
Message 4 of 4 in “strbuf_stripspace(): rename skip_comments arg to strip_comments”
  1. strbuf_stripspace(): rename skip_comments arg to strip_commentsOswald Buddenhagen, Mar 23, 2023
  2. Oswald BuddenhagenApr 27, 2023
  3. Jeff KingApr 27, 2023
  4. Felipe ContrerasMay 2, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.