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

[PATCH v4 0/1] general style: replaces memcmp() with starts_with()

From
Quint Guvernator <quintus.public@gmail.com>
Date
Mar 17, 2014, 21:52 UTC
Message-ID
<1395093144-6786-1-git-send-email-quintus.public@gmail.com>
Hi again, all.

I've gone through the patch again to filter for the use of magic numbers so that I can leave those hunks alone. Junio says, and Michael agrees, that:

Show 5 quoted lines
> The original hunks show that the code knows and relies on magic numbers 7
> and 8 very clearly and there are rooms for improvement.  The result after
> the conversion, however, still have the same magic numbers, but one less
> of them each.  Doesn't it make it harder to later spot the patterns to
> come up with a better abstraction that does not rely on the magic number?
I cut this one down very sharply; Michael says:
> It would be much better for you to submit only a handful of changes (or
> even only one!) that is perfect, rather than throwing a bunch at the wall
> and asking the reviewer to pick between the good and the bad.
Thanks for the guidance, everyone.
This work is microproject #14 for GSoC.
Quint Guvernator (1):
  general style: replaces memcmp() with starts_with()
 builtin/apply.c        |  6 +++---
 builtin/for-each-ref.c |  2 +-
 builtin/mktag.c        |  4 ++--
 builtin/patch-id.c     | 10 +++++-----
 connect.c              |  4 ++--
 imap-send.c            |  6 +++---
 remote.c               |  2 +-
 7 files changed, 17 insertions(+), 17 deletions(-)
-- 
1.9.0
Next: Quint Guvernator
Message 1 of 12 in “general style: replaces memcmp() with starts_with()”
  1. 0/1 general style: replaces memcmp() with starts_with()Quint Guvernator, Mar 17, 2014
  2. 1/1 general style: replaces memcmp() with starts_with()Quint Guvernator, Mar 17, 2014
  3. Junio C HamanoMar 17, 2014
  4. Jeff KingMar 17, 2014
  5. Junio C HamanoMar 17, 2014
  6. Jeff KingMar 18, 2014
  7. Quint GuvernatorMar 17, 2014
  8. Eric SunshineMar 18, 2014
  9. Quint GuvernatorMar 18, 2014
  10. Eric SunshineMar 18, 2014
  11. Junio C HamanoMar 18, 2014
  12. Quint GuvernatorMar 17, 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.