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

Re: [PATCH] commit.c:record_author_date() use skip_prefix() instead of starts_with()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 3, 2014, 18:40 UTC
Message-ID
<xmqqmwh7qg6v.fsf@gitster.dls.corp.google.com>
In-Reply-To
<53144450.3080006@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 7 quoted lines
>> -		if (!starts_with(buf, "author ")) {
>> +		if (!skip_prefix(buf, "author ")) {
>
> If this is the only change, there is not much point, is there?  How does
> this help?  Perhaps there is some way to take advantage of the
> difference between starts_with() and skip_prefix() to simplify the rest
> of the function?

I admit I lost track, but wasn't there a discussion to use starts_with/ends_with when appropriate (namely, the caller is absolutely not interested in what the remainder of the string is after skipping the prefix), moving away from skip_prefix()? Isn't this change going in the wrong direction?

Previous: Michael HaggertyNext: Eric Sunshine
Message 3 of 4 in “commit.c:record_author_date() use skip_prefix() instead of starts_with()”
  1. commit.c:record_author_date() use skip_prefix() instead of starts_with()Tanay Abhra, Mar 1, 2014
  2. Michael HaggertyMar 3, 2014
  3. Junio C HamanoMar 3, 2014
  4. Eric SunshineMar 3, 2014

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.