Subject: Re: [PATCH 00/86] replace prefixcmp() with has_prefix()

From: Junio C Hamano <[email-masked]>
Date: Tue, 12 Nov 2013 08:53:45 -0800

Jeff King <[email-masked]> writes:

> I am ambivalent on the code churn, but if we do apply it, we should
> probably leave off the final patch (dropping prefixcmp) for a cycle to
> let topics in flight catch up to the change. Just diffing "master" and
> "next", I see some new uses of prefixcmp which will need adjusted, along
> with spots where the patches themselves will cause textual conflicts.

Yes, I did that check too (but between 'maint' and 'pu'). I think it
is a good idea to stop using whatever_cmp() name for things that are
not *cmp() functions in the longer term, but smooth migration is a
bit tricky (but not as tricky as end-user visible transitions).

Even though we already added has_suffix() for tail matches, it is
not too late to rethink, as it is not in 'master' yet.

One thing I noticed is that it is probably misnamed, or at least in
a way that invites confusion.  Can people tell which one of these is
correct without looking at existing callsites?

	has_suffix(filename, "txt");
        has_suffix(filename, ".txt");

The semantics of the function we have is the latter and is better
called endswith(), I suspect.  And the corresponding function to
check for head matches should probably be called beginswith().