{"thread":{"id":"35446","subject":"[PATCH 0/5] use starts_with() and ends_with()","startedAt":"2013-12-01T07:49:13Z","lastAt":"2013-12-05T18:04:51Z","messageCount":17,"participants":["Christian Couder","Jeff King","Junio C Hamano","Antoine Pelisse"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"231322","messageId":"20131201074818.3042.57357.chriscool@tuxfamily.org","threadId":"35446","inReplyTo":null,"subject":"[PATCH 0/5] use starts_with() and ends_with()","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2013-12-01T07:49:13Z","receivedAt":"2013-12-01T07:49:13Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This is a new patch series along the lines Junio suggested in this\nthread:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/238054/\n\nI send it now because I saw a 1.8.5 tag.\n\nThe patches in this series can be related to what Junio suggested\nthis way:\n\n * A set of clean-up patches to normalize oddball usages of existing\n   functions (e.g. normalize 'prefixcmp(a,b) != 0' in some file(s)\n   to 'prefixcmp(a,b)');\n\n-> Patches 1/5 and 2/5 are such kind of cleanups.\n\n * A single patch to introduce the new function(s), to be applied on\n   top of 1.8.5;\n\n-> Patch 3/5 does that.\n\n * A large patch to convert all uses of prefixcmp to starts_with and\n   suffixcmp to ends_with in the 1.8.5 codebase;\n\n-> Patch 4/5 does that.\n\n * A patch for each topic in flight to convert newly introduced\n   prefixcmp/suffixcmp to starts_with/ends_with, to be applied after\n   the topic graduates to 'master' after 1.8.5; and then finally\n\n-> I didn't start to work on that yet. I hope that I will only need\n   to take care of what is going on in 'next'.\n\n * A separate patch to remove prefixcmp and suffixcmp, to be applied\n   after _all_ in-flight topic has graduated to 'master'.\n\n-> Patch 5/5 does that.\n\n\nChristian Couder (5):\n  environment: normalize use of prefixcmp() by removing \" != 0\"\n  builtin/remote: remove postfixcmp() and use suffixcmp() instead\n  strbuf: introduce starts_with() and ends_with()\n  Replace {pre,suf}fixcmp() with {starts,ends}_with()\n  strbuf: remove prefixcmp() and suffixcmp()\n\n alias.c                   |  2 +-\n attr.c                    |  2 +-\n bisect.c                  |  4 +--\n branch.c                  |  4 +--\n builtin/apply.c           | 12 +++----\n builtin/archive.c         |  4 +--\n builtin/branch.c          |  6 ++--\n builtin/checkout.c        |  8 ++---\n builtin/clean.c           |  4 +--\n builtin/clone.c           |  8 ++---\n builtin/column.c          |  2 +-\n builtin/commit.c          | 10 +++---\n builtin/describe.c        |  2 +-\n builtin/fast-export.c     |  2 +-\n builtin/fetch-pack.c      |  6 ++--\n builtin/fetch.c           | 18 +++++------\n builtin/fmt-merge-msg.c   | 10 +++---\n builtin/for-each-ref.c    | 14 ++++-----\n builtin/fsck.c            |  6 ++--\n builtin/help.c            |  8 ++---\n builtin/index-pack.c      |  8 ++---\n builtin/init-db.c         |  2 +-\n builtin/log.c             |  8 ++---\n builtin/ls-remote.c       |  4 +--\n builtin/mailinfo.c        | 16 +++++-----\n builtin/merge-recursive.c |  4 +--\n builtin/merge.c           | 12 +++----\n builtin/name-rev.c        |  6 ++--\n builtin/notes.c           |  2 +-\n builtin/pack-objects.c    |  2 +-\n builtin/prune.c           |  4 +--\n builtin/receive-pack.c    |  6 ++--\n builtin/reflog.c          |  4 +--\n builtin/remote.c          | 22 +++++--------\n builtin/repack.c          |  2 +-\n builtin/rev-parse.c       | 24 +++++++-------\n builtin/send-pack.c       |  8 ++---\n builtin/shortlog.c        |  6 ++--\n builtin/show-branch.c     | 20 ++++++------\n builtin/show-ref.c        |  6 ++--\n builtin/symbolic-ref.c    |  2 +-\n builtin/tag.c             |  2 +-\n builtin/tar-tree.c        |  2 +-\n builtin/unpack-objects.c  |  2 +-\n builtin/update-ref.c      | 10 +++---\n builtin/upload-archive.c  |  2 +-\n commit.c                  |  6 ++--\n config.c                  | 16 +++++-----\n connect.c                 |  2 +-\n connected.c               |  2 +-\n convert.c                 |  2 +-\n daemon.c                  | 40 ++++++++++++------------\n diff.c                    | 56 ++++++++++++++++-----------------\n environment.c             |  2 +-\n fast-import.c             | 80 +++++++++++++++++++++++------------------------\n fetch-pack.c              | 12 +++----\n git-compat-util.h         |  4 +--\n git.c                     | 12 +++----\n help.c                    |  8 ++---\n http-backend.c            |  4 +--\n http-push.c               |  4 +--\n http.c                    | 10 +++---\n imap-send.c               | 10 +++---\n log-tree.c                |  8 ++---\n merge-recursive.c         |  6 ++--\n notes-utils.c             |  4 +--\n notes.c                   |  8 ++---\n pager.c                   |  2 +-\n parse-options.c           | 12 +++----\n pathspec.c                |  2 +-\n pkt-line.c                |  4 +--\n pretty.c                  | 36 ++++++++++-----------\n refs.c                    | 30 +++++++++---------\n remote-curl.c             | 14 ++++-----\n remote-testsvn.c          | 10 +++---\n remote.c                  | 46 +++++++++++++--------------\n revision.c                | 38 +++++++++++-----------\n send-pack.c               |  4 +--\n sequencer.c               |  8 ++---\n setup.c                   |  4 +--\n sha1_name.c               | 16 +++++-----\n shell.c                   |  2 +-\n strbuf.c                  | 12 +++----\n submodule.c               |  2 +-\n tag.c                     | 10 +++---\n test-line-buffer.c        |  6 ++--\n test-string-list.c        |  2 +-\n transport-helper.c        | 16 +++++-----\n transport.c               | 28 ++++++++---------\n upload-pack.c             | 10 +++---\n vcs-svn/fast_export.c     | 11 +------\n wt-status.c               | 16 +++++-----\n 92 files changed, 469 insertions(+), 486 deletions(-)\n\n-- \n1.8.4.1.561.g12affca\n"},{"id":"231323","messageId":"20131201074919.3042.88989.chriscool@tuxfamily.org","threadId":"35446","inReplyTo":"20131201074818.3042.57357.chriscool@tuxfamily.org","subject":"[PATCH 1/5] environment: normalize use of prefixcmp() by removing \" != 0\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2013-12-01T07:49:14Z","receivedAt":"2013-12-01T07:49:14Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"To be able to automatically convert prefixcmp() to starts_with()\nwe need first to make sure that prefixcmp() is always used in\nthe same way.\n\nSo let's remove \" != 0\" after prefixcmp().\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n environment.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/environment.c b/environment.c\nindex 0a15349..cd2b068 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -171,7 +171,7 @@ const char *get_git_namespace(void)\n \n const char *strip_namespace(const char *namespaced_ref)\n {\n-\tif (prefixcmp(namespaced_ref, get_git_namespace()) != 0)\n+\tif (prefixcmp(namespaced_ref, get_git_namespace()))\n \t\treturn NULL;\n \treturn namespaced_ref + namespace_len;\n }\n-- \n1.8.4.1.561.g12affca\n"},{"id":"231324","messageId":"20131201074919.3042.71383.chriscool@tuxfamily.org","threadId":"35446","inReplyTo":"20131201074818.3042.57357.chriscool@tuxfamily.org","subject":"[PATCH 2/5] builtin/remote: remove postfixcmp() and use suffixcmp() instead","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2013-12-01T07:49:15Z","receivedAt":"2013-12-01T07:49:15Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Commit 8cc5b290 (git merge -X<option>, 25 Nov 2009) introduced\nsuffixcmp() with nearly the same implementation as postfixcmp()\nthat already existed since commit 211c8968 (Make git-remote a\nbuiltin, 29 Feb 2008).\n\nThe only difference between the two implementations is that,\nwhen the string is smaller than the suffix, one implementation\nreturns 1 while the other one returns -1.\n\nBut, as postfixcmp() is only used to compare for equality, the\ndistinction does not matter and does not affect the correctness of\nthis patch.\n\nAs postfixcmp() has always been static in builtin/remote.c\nand is used nowhere else, it makes more sense to remove it\nand use suffixcmp() instead in builtin/remote.c, rather than\nto remove suffixcmp().\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/remote.c | 14 +++-----------\n 1 file changed, 3 insertions(+), 11 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 4e14891..9b3a98e 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -80,14 +80,6 @@ static int verbose;\n static int show_all(void);\n static int prune_remote(const char *remote, int dry_run);\n \n-static inline int postfixcmp(const char *string, const char *postfix)\n-{\n-\tint len1 = strlen(string), len2 = strlen(postfix);\n-\tif (len1 < len2)\n-\t\treturn 1;\n-\treturn strcmp(string + len1 - len2, postfix);\n-}\n-\n static int fetch_remote(const char *name)\n {\n \tconst char *argv[] = { \"fetch\", name, NULL, NULL };\n@@ -277,13 +269,13 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n \t\tenum { REMOTE, MERGE, REBASE } type;\n \n \t\tkey += 7;\n-\t\tif (!postfixcmp(key, \".remote\")) {\n+\t\tif (!suffixcmp(key, \".remote\")) {\n \t\t\tname = xstrndup(key, strlen(key) - 7);\n \t\t\ttype = REMOTE;\n-\t\t} else if (!postfixcmp(key, \".merge\")) {\n+\t\t} else if (!suffixcmp(key, \".merge\")) {\n \t\t\tname = xstrndup(key, strlen(key) - 6);\n \t\t\ttype = MERGE;\n-\t\t} else if (!postfixcmp(key, \".rebase\")) {\n+\t\t} else if (!suffixcmp(key, \".rebase\")) {\n \t\t\tname = xstrndup(key, strlen(key) - 7);\n \t\t\ttype = REBASE;\n \t\t} else\n-- \n1.8.4.1.561.g12affca\n"},{"id":"231326","messageId":"20131201074919.3042.28757.chriscool@tuxfamily.org","threadId":"35446","inReplyTo":"20131201074818.3042.57357.chriscool@tuxfamily.org","subject":"[PATCH 3/5] strbuf: introduce starts_with() and ends_with()","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2013-12-01T07:49:16Z","receivedAt":"2013-12-01T07:49:16Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"prefixcmp() and suffixcmp() cannot be really used as comparison\nfunctions as they are not antisymmetric:\n\n        prefixcmp(\"foo\", \"foobar\") < 0\n        prefixcmp(\"foobar\", \"foo\") == 0\n\nSo they are not suitable as functions for passing to qsort.\nAnd in fact they are used nowhere as comparison functions.\n\nTherefore we should replace them with functions that just check\nfor equality.\n\nAs a first step toward this goal, this patch introduces\nstarts_with() and end_with() that will be used to replace\nrespectively prefixcmp() and suffixcmp().\n\nSome popular programming languages, like Java, Python and Ruby\nhave functions or methods called like starts_with() and\nends_with() that are doing what we want. Therefore it makes sense\nto use such names.\n\nIn vcs-svn/fast_export.c, there was already an ends_with()\nfunction that did the same thing. Let's use the new one instead\nwhile at it.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-compat-util.h     |  2 ++\n strbuf.c              | 18 ++++++++++++++++++\n vcs-svn/fast_export.c | 11 +----------\n 3 files changed, 21 insertions(+), 10 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 7776f12..b73916b 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -350,7 +350,9 @@ extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_lis\n extern void set_error_routine(void (*routine)(const char *err, va_list params));\n extern void set_die_is_recursing_routine(int (*routine)(void));\n \n+extern int starts_with(const char *str, const char *prefix);\n extern int prefixcmp(const char *str, const char *prefix);\n+extern int ends_with(const char *str, const char *suffix);\n extern int suffixcmp(const char *str, const char *suffix);\n \n static inline const char *skip_prefix(const char *str, const char *prefix)\ndiff --git a/strbuf.c b/strbuf.c\nindex 1170d01..83caf4a 100644\n--- a/strbuf.c\n+++ b/strbuf.c\n@@ -1,6 +1,15 @@\n #include \"cache.h\"\n #include \"refs.h\"\n \n+int starts_with(const char *str, const char *prefix)\n+{\n+\tfor (; ; str++, prefix++)\n+\t\tif (!*prefix)\n+\t\t\treturn 1;\n+\t\telse if (*str != *prefix)\n+\t\t\treturn 0;\n+}\n+\n int prefixcmp(const char *str, const char *prefix)\n {\n \tfor (; ; str++, prefix++)\n@@ -10,6 +19,15 @@ int prefixcmp(const char *str, const char *prefix)\n \t\t\treturn (unsigned char)*prefix - (unsigned char)*str;\n }\n \n+int ends_with(const char *str, const char *suffix)\n+{\n+\tint len = strlen(str), suflen = strlen(suffix);\n+\tif (len < suflen)\n+\t\treturn 0;\n+\telse\n+\t\treturn !strcmp(str + len - suflen, suffix);\n+}\n+\n int suffixcmp(const char *str, const char *suffix)\n {\n \tint len = strlen(str), suflen = strlen(suffix);\ndiff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c\nindex f2b23c8..bd0f2c2 100644\n--- a/vcs-svn/fast_export.c\n+++ b/vcs-svn/fast_export.c\n@@ -162,22 +162,13 @@ static void die_short_read(struct line_buffer *input)\n \tdie(\"invalid dump: unexpected end of file\");\n }\n \n-static int ends_with(const char *s, size_t len, const char *suffix)\n-{\n-\tconst size_t suffixlen = strlen(suffix);\n-\tif (len < suffixlen)\n-\t\treturn 0;\n-\treturn !memcmp(s + len - suffixlen, suffix, suffixlen);\n-}\n-\n static int parse_cat_response_line(const char *header, off_t *len)\n {\n-\tsize_t headerlen = strlen(header);\n \tuintmax_t n;\n \tconst char *type;\n \tconst char *end;\n \n-\tif (ends_with(header, headerlen, \" missing\"))\n+\tif (ends_with(header, \" missing\"))\n \t\treturn error(\"cat-blob reports missing blob: %s\", header);\n \ttype = strstr(header, \" blob \");\n \tif (!type)\n-- \n1.8.4.1.561.g12affca\n"},{"id":"231325","messageId":"20131201074919.3042.68588.chriscool@tuxfamily.org","threadId":"35446","inReplyTo":"20131201074818.3042.57357.chriscool@tuxfamily.org","subject":"[PATCH 5/5] strbuf: remove prefixcmp() and suffixcmp()","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2013-12-01T07:49:18Z","receivedAt":"2013-12-01T07:49:18Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"As starts_with() and ends_with() have been used to\nreplace prefixcmp() and suffixcmp() respectively,\nwe can now remove them.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-compat-util.h |  2 --\n strbuf.c          | 18 ------------------\n 2 files changed, 20 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex b73916b..c4c01e7 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -351,9 +351,7 @@ extern void set_error_routine(void (*routine)(const char *err, va_list params));\n extern void set_die_is_recursing_routine(int (*routine)(void));\n \n extern int starts_with(const char *str, const char *prefix);\n-extern int prefixcmp(const char *str, const char *prefix);\n extern int ends_with(const char *str, const char *suffix);\n-extern int suffixcmp(const char *str, const char *suffix);\n \n static inline const char *skip_prefix(const char *str, const char *prefix)\n {\ndiff --git a/strbuf.c b/strbuf.c\nindex 83caf4a..ee96dcf 100644\n--- a/strbuf.c\n+++ b/strbuf.c\n@@ -10,15 +10,6 @@ int starts_with(const char *str, const char *prefix)\n \t\t\treturn 0;\n }\n \n-int prefixcmp(const char *str, const char *prefix)\n-{\n-\tfor (; ; str++, prefix++)\n-\t\tif (!*prefix)\n-\t\t\treturn 0;\n-\t\telse if (*str != *prefix)\n-\t\t\treturn (unsigned char)*prefix - (unsigned char)*str;\n-}\n-\n int ends_with(const char *str, const char *suffix)\n {\n \tint len = strlen(str), suflen = strlen(suffix);\n@@ -28,15 +19,6 @@ int ends_with(const char *str, const char *suffix)\n \t\treturn !strcmp(str + len - suflen, suffix);\n }\n \n-int suffixcmp(const char *str, const char *suffix)\n-{\n-\tint len = strlen(str), suflen = strlen(suffix);\n-\tif (len < suflen)\n-\t\treturn -1;\n-\telse\n-\t\treturn strcmp(str + len - suflen, suffix);\n-}\n-\n /*\n  * Used as the default ->buf value, so that people can always assume\n  * buf is non NULL and ->buf is NUL terminated even for a freshly\n-- \n1.8.4.1.561.g12affca\n"},{"id":"231372","messageId":"20131202150956.GA20543@sigill.intra.peff.net","threadId":"35446","inReplyTo":"20131201074818.3042.57357.chriscool@tuxfamily.org","subject":"Re: [PATCH 0/5] use starts_with() and ends_with()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-12-02T15:09:56Z","receivedAt":"2013-12-02T15:09:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:\n\n> This is a new patch series along the lines Junio suggested in this\n> thread:\n> \n> http://thread.gmane.org/gmane.comp.version-control.git/238054/\n> \n> I send it now because I saw a 1.8.5 tag.\n\nThis looks sane to me. Your 4/5 did not make it to the list (nor\ndirectly to me), though. Perhaps because it is huge?\n\n-Peff\n"},{"id":"231380","messageId":"xmqq1u1vrtmo.fsf@gitster.dls.corp.google.com","threadId":"35446","inReplyTo":"20131202150956.GA20543@sigill.intra.peff.net","subject":"Re: [PATCH 0/5] use starts_with() and ends_with()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-02T18:32:31Z","receivedAt":"2013-12-02T18:32:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:\n>\n>> This is a new patch series along the lines Junio suggested in this\n>> thread:\n>> \n>> http://thread.gmane.org/gmane.comp.version-control.git/238054/\n>> \n>> I send it now because I saw a 1.8.5 tag.\n>\n> This looks sane to me. Your 4/5 did not make it to the list (nor\n> directly to me), though. Perhaps because it is huge?\n\nNor to me, either.\n"},{"id":"231383","messageId":"20131202.202952.431769670287377861.chriscool@tuxfamily.org","threadId":"35446","inReplyTo":"xmqq1u1vrtmo.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 0/5] use starts_with() and ends_with()","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2013-12-02T19:29:52Z","receivedAt":"2013-12-02T19:29:52Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n>\n> Jeff King <peff@peff.net> writes:\n> \n>> On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:\n>>\n>>> This is a new patch series along the lines Junio suggested in this\n>>> thread:\n>>> \n>>> http://thread.gmane.org/gmane.comp.version-control.git/238054/\n>>> \n>>> I send it now because I saw a 1.8.5 tag.\n>>\n>> This looks sane to me. Your 4/5 did not make it to the list (nor\n>> directly to me), though. Perhaps because it is huge?\n> \n> Nor to me, either.\n\nSorry about that I don't know what happened. Maybe my ISP has blocked\nit because it is big.\n\nI just tried to send it again.\n\nBest,\nChristian.\n"},{"id":"231384","messageId":"CALWbr2xAcvaH7L=3U=amqK3=Gf-TPOK+X0fJ3u56mGTnUDR+kw@mail.gmail.com","threadId":"35446","inReplyTo":"20131202.202952.431769670287377861.chriscool@tuxfamily.org","subject":"Re: [PATCH 0/5] use starts_with() and ends_with()","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-12-02T19:32:33Z","receivedAt":"2013-12-02T19:32:33Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Mon, Dec 2, 2013 at 8:29 PM, Christian Couder\n<chriscool@tuxfamily.org> wrote:\n> From: Junio C Hamano <gitster@pobox.com>\n>>\n>> Jeff King <peff@peff.net> writes:\n>>\n>>> On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:\n>>>\n>>>> This is a new patch series along the lines Junio suggested in this\n>>>> thread:\n>>>>\n>>>> http://thread.gmane.org/gmane.comp.version-control.git/238054/\n>>>>\n>>>> I send it now because I saw a 1.8.5 tag.\n>>>\n>>> This looks sane to me. Your 4/5 did not make it to the list (nor\n>>> directly to me), though. Perhaps because it is huge?\n>>\n>> Nor to me, either.\n>\n> Sorry about that I don't know what happened. Maybe my ISP has blocked\n> it because it is big.\n\nI don't know, I received it.\n"},{"id":"231410","messageId":"CAP8UFD2gNv7-W8ERf7Ccypb8BOMvQ6VmncMSfJ6vmAt9PSBtLw@mail.gmail.com","threadId":"35446","inReplyTo":"CALWbr2xAcvaH7L=3U=amqK3=Gf-TPOK+X0fJ3u56mGTnUDR+kw@mail.gmail.com","subject":"Re: [PATCH 0/5] use starts_with() and ends_with()","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2013-12-03T06:06:59Z","receivedAt":"2013-12-03T06:06:59Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Dec 2, 2013 at 8:32 PM, Antoine Pelisse <apelisse@gmail.com> wrote:\n> On Mon, Dec 2, 2013 at 8:29 PM, Christian Couder\n> <chriscool@tuxfamily.org> wrote:\n>> From: Junio C Hamano <gitster@pobox.com>\n>>>\n>>> Jeff King <peff@peff.net> writes:\n>>>\n>>>> This looks sane to me. Your 4/5 did not make it to the list (nor\n>>>> directly to me), though. Perhaps because it is huge?\n>>>\n>>> Nor to me, either.\n>>\n>> Sorry about that I don't know what happened. Maybe my ISP has blocked\n>> it because it is big.\n>\n> I don't know, I received it.\n\nWhen I send it to my gmail account, I receive it too.\n"},{"id":"231424","messageId":"20131203124645.GB26667@sigill.intra.peff.net","threadId":"35446","inReplyTo":"CAP8UFD0jg_Vr7Zf+DiMX9RG6vmmQvmk2NvmL7j=MC-x3fLOOBA@mail.gmail.com","subject":"Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-12-03T12:46:45Z","receivedAt":"2013-12-03T12:46:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Dec 03, 2013 at 08:03:39AM +0100, Christian Couder wrote:\n\n> I am trying to forward this patch from my gmail address, as it doesn't\n> seem to go through when I send it from my home machine.\n\nThis made it through to me, but not the list. There are at least two\nthings going on:\n\n  1. The message is 172K, which is over the 100K limit imposed by vger;\n     the list is silently dropping it.\n\n  2. In my case, the direct mail was being flagged by spam because it\n     contains the blacklisted domain \"old.name\". Which of course is not\n     a domain at all but rather this code:\n\n       old.name = old.path + strlen(\"refs/heads/\");\n\n     I've tweaked my server.\n\nI can't say why it wasn't getting to Junio via direct mail. Maybe the\nsame spam thing, or maybe something else.\n\n> From: Christian Couder <chriscool@tuxfamily.org>\n> Date: Sun, Dec 1, 2013 at 8:49 AM\n> Subject: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()\n> To: christian.couder@gmail.com\n> \n> This patch was generated automatically using the following\n> commands:\n> \n> git grep --name-only prefixcmp | grep -v '\\.h' | grep -v 'strbuf.c' |\n> xargs perl -pi -e 's/!prefixcmp\\(/starts_with\\(/g'\n> git grep --name-only prefixcmp | grep -v '\\.h' | grep -v 'strbuf.c' |\n> xargs perl -pi -e 's/prefixcmp\\(/!starts_with\\(/g'\n> git grep --name-only suffixcmp | grep -v '\\.h' | grep -v 'strbuf.c' |\n> xargs perl -pi -e 's/!suffixcmp\\(/ends_with\\(/g'\n> git grep --name-only suffixcmp | grep -v '\\.h' | grep -v 'strbuf.c' |\n> xargs perl -pi -e 's/suffixcmp\\(/!ends_with\\(/g'\n> \n> It was generated on version 1.8.5 of the git codebase.\n\nI skimmed the patch and didn't notice any problems. It's\nwhitespace-damaged by gmail, of course. The simplest thing is probably\nto just point us at a public repo with the commit, if you have one.\n\n-Peff\n"},{"id":"231467","messageId":"CAP8UFD0By77QVH1amsh85dX6h1S3iFZcmPzs3JjPZmiD_AmOPQ@mail.gmail.com","threadId":"35446","inReplyTo":"20131203124645.GB26667@sigill.intra.peff.net","subject":"Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2013-12-03T20:24:40Z","receivedAt":"2013-12-03T20:24:40Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Dec 3, 2013 at 1:46 PM, Jeff King <peff@peff.net> wrote:\n>\n> This made it through to me, but not the list. There are at least two\n> things going on:\n>\n>   1. The message is 172K, which is over the 100K limit imposed by vger;\n>      the list is silently dropping it.\n>\n>   2. In my case, the direct mail was being flagged by spam because it\n>      contains the blacklisted domain \"old.name\". Which of course is not\n>      a domain at all but rather this code:\n>\n>        old.name = old.path + strlen(\"refs/heads/\");\n>\n>      I've tweaked my server.\n>\n> I can't say why it wasn't getting to Junio via direct mail. Maybe the\n> same spam thing, or maybe something else.\n\n[...]\n\n> I skimmed the patch and didn't notice any problems. It's\n> whitespace-damaged by gmail, of course. The simplest thing is probably\n> to just point us at a public repo with the commit, if you have one.\n\nOk, the commit is in the use_starts_ends_with branch on this github repo:\n\nhttps://github.com/chriscool/git.git\n\nThanks,\nChristian.\n"},{"id":"231534","messageId":"20131204194515.GA16603@sigill.intra.peff.net","threadId":"35446","inReplyTo":"CAP8UFD0By77QVH1amsh85dX6h1S3iFZcmPzs3JjPZmiD_AmOPQ@mail.gmail.com","subject":"Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-12-04T19:45:15Z","receivedAt":"2013-12-04T19:45:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Dec 03, 2013 at 09:24:40PM +0100, Christian Couder wrote:\n\n> > I skimmed the patch and didn't notice any problems. It's\n> > whitespace-damaged by gmail, of course. The simplest thing is probably\n> > to just point us at a public repo with the commit, if you have one.\n> \n> Ok, the commit is in the use_starts_ends_with branch on this github repo:\n> \n> https://github.com/chriscool/git.git\n\nThanks. I looked more carefully this time, using a few greps to classify\nthe surrounding context (since the script you used for the update could\nconceivably miss some really odd misuse). The whole thing looks good to\nme.\n\n-Peff\n"},{"id":"231542","messageId":"xmqqk3fkjq5c.fsf@gitster.dls.corp.google.com","threadId":"35446","inReplyTo":"CAP8UFD0By77QVH1amsh85dX6h1S3iFZcmPzs3JjPZmiD_AmOPQ@mail.gmail.com","subject":"Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-04T20:51:43Z","receivedAt":"2013-12-04T20:51:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> Ok, the commit is in the use_starts_ends_with branch on this github repo:\n>\n> https://github.com/chriscool/git.git\n\nI looked at the patches, and they looked alright.  The endgame needs\nto be on a separate topic to be held until a distant future, though.\n\nWill queue.  Thanks.\n"},{"id":"231543","messageId":"xmqqfvq8jmv5.fsf@gitster.dls.corp.google.com","threadId":"35446","inReplyTo":"xmqqk3fkjq5c.fsf@gitster.dls.corp.google.com","subject":"Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-04T22:02:38Z","receivedAt":"2013-12-04T22:02:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Christian Couder <christian.couder@gmail.com> writes:\n>\n>> Ok, the commit is in the use_starts_ends_with branch on this github repo:\n>>\n>> https://github.com/chriscool/git.git\n>\n> I looked at the patches, and they looked alright.  The endgame needs\n> to be on a separate topic to be held until a distant future, though.\n>\n> Will queue.  Thanks.\n\nIt turns out that, naturally, there are many new uses of prefixcmp\nin the topics in flight.  I can manage, but adjusting all of them\nwould not look too pretty X-<.\n"},{"id":"231575","messageId":"CAP8UFD1+2-JuU0EPcfWUHpcfqrp9MODZBd4XEwVv-d6C8Nk=nA@mail.gmail.com","threadId":"35446","inReplyTo":"xmqqfvq8jmv5.fsf@gitster.dls.corp.google.com","subject":"Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2013-12-05T07:19:11Z","receivedAt":"2013-12-05T07:19:11Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Wed, Dec 4, 2013 at 11:02 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Christian Couder <christian.couder@gmail.com> writes:\n>>\n>>> Ok, the commit is in the use_starts_ends_with branch on this github repo:\n>>>\n>>> https://github.com/chriscool/git.git\n>>\n>> I looked at the patches, and they looked alright.  The endgame needs\n>> to be on a separate topic to be held until a distant future, though.\n>>\n>> Will queue.  Thanks.\n\nGreat!\n\n> It turns out that, naturally, there are many new uses of prefixcmp\n> in the topics in flight.  I can manage, but adjusting all of them\n> would not look too pretty X-<.\n\nTell me if I can do something.\nI can prepare patches for the topics in flight in 'next' for example.\n\nThanks,\nChristian.\n"},{"id":"231618","messageId":"xmqqa9gfi37g.fsf@gitster.dls.corp.google.com","threadId":"35446","inReplyTo":"CAP8UFD1+2-JuU0EPcfWUHpcfqrp9MODZBd4XEwVv-d6C8Nk=nA@mail.gmail.com","subject":"Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-12-05T18:04:51Z","receivedAt":"2013-12-05T18:04:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> Tell me if I can do something.\n\nI think the tip of 'pu' with cc/starts-n-ends-with-endgame is in\nfairly a good shape.  The evil merge there may need to be updated\nover time, but I think I can manage.\n"}]}