From: Jens Lehmann <Jens.Lehmann@web.de>
To: Quint Guvernator <quintus.public@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] general style: replaces memcmp() with starts_with()
Date: Wed, 12 Mar 2014 18:22:24 +0100 [thread overview]
Message-ID: <532097D0.4070909@web.de> (raw)
In-Reply-To: <CALs4jVFpr=YVAagJSEkAJ6qGJmYWNdu4ZXXvMYQRd0KYQXcVQA@mail.gmail.com>
Am 12.03.2014 17:46, schrieb Quint Guvernator:
> 2014-03-12 11:47 GMT-04:00 Jens Lehmann <Jens.Lehmann@web.de>:
>> I think this hunk should be dropped as the memcmp() here doesn't mean
>> "starts with" but "is identical" (due to the "ce_namelen(ce) == 11" in
>> the line above).
>
> There is an issue with negation in this patch. I've submitted a new
> one [1] to the mailing list. The subject line of the new patch is
> "[PATCH] general style: replaces memcmp() with proper starts_with()".
Thanks, I missed that one (please use "[PATCH v2]" in the subject
line of a second patch to make follow-ups easily distinguishable
from the initial one ;-).
> Let me know if you still think the hunk should be dropped there.
Yes, I think so. That spot uses memcmp() because ce->name may
not be 0-terminated. If that assumption isn't correct, it should
be replaced with a plain strcmp() instead (while also dropping
the ce_namelen() comparison in the line above). But starts_with()
points into the wrong direction there.
> [1]: http://thread.gmane.org/gmane.comp.version-control.git/243940
next prev parent reply other threads:[~2014-03-12 17:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 13:44 [PATCH] general style: replaces memcmp() with starts_with() Quint Guvernator
2014-03-12 13:51 ` Duy Nguyen
2014-03-12 14:06 ` Quint Guvernator
2014-03-13 16:05 ` Michael Haggerty
2014-03-14 16:32 ` Quint Guvernator
2014-03-12 15:47 ` Jens Lehmann
2014-03-12 16:46 ` Quint Guvernator
2014-03-12 17:22 ` Jens Lehmann [this message]
2014-03-12 18:00 ` Jeff King
2014-03-12 23:26 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=532097D0.4070909@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=quintus.public@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).