* [PATCH 0/5] use starts_with() and ends_with()
@ 2013-12-01 7:49 Christian Couder
2013-12-01 7:49 ` [PATCH 1/5] environment: normalize use of prefixcmp() by removing " != 0" Christian Couder
` (5 more replies)
0 siblings, 6 replies; 17+ messages in thread
From: Christian Couder @ 2013-12-01 7:49 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Antoine Pelisse, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
This is a new patch series along the lines Junio suggested in this
thread:
http://thread.gmane.org/gmane.comp.version-control.git/238054/
I send it now because I saw a 1.8.5 tag.
The patches in this series can be related to what Junio suggested
this way:
* A set of clean-up patches to normalize oddball usages of existing
functions (e.g. normalize 'prefixcmp(a,b) != 0' in some file(s)
to 'prefixcmp(a,b)');
-> Patches 1/5 and 2/5 are such kind of cleanups.
* A single patch to introduce the new function(s), to be applied on
top of 1.8.5;
-> Patch 3/5 does that.
* A large patch to convert all uses of prefixcmp to starts_with and
suffixcmp to ends_with in the 1.8.5 codebase;
-> Patch 4/5 does that.
* A patch for each topic in flight to convert newly introduced
prefixcmp/suffixcmp to starts_with/ends_with, to be applied after
the topic graduates to 'master' after 1.8.5; and then finally
-> I didn't start to work on that yet. I hope that I will only need
to take care of what is going on in 'next'.
* A separate patch to remove prefixcmp and suffixcmp, to be applied
after _all_ in-flight topic has graduated to 'master'.
-> Patch 5/5 does that.
Christian Couder (5):
environment: normalize use of prefixcmp() by removing " != 0"
builtin/remote: remove postfixcmp() and use suffixcmp() instead
strbuf: introduce starts_with() and ends_with()
Replace {pre,suf}fixcmp() with {starts,ends}_with()
strbuf: remove prefixcmp() and suffixcmp()
alias.c | 2 +-
attr.c | 2 +-
bisect.c | 4 +--
branch.c | 4 +--
builtin/apply.c | 12 +++----
builtin/archive.c | 4 +--
builtin/branch.c | 6 ++--
builtin/checkout.c | 8 ++---
builtin/clean.c | 4 +--
builtin/clone.c | 8 ++---
builtin/column.c | 2 +-
builtin/commit.c | 10 +++---
builtin/describe.c | 2 +-
builtin/fast-export.c | 2 +-
builtin/fetch-pack.c | 6 ++--
builtin/fetch.c | 18 +++++------
builtin/fmt-merge-msg.c | 10 +++---
builtin/for-each-ref.c | 14 ++++-----
builtin/fsck.c | 6 ++--
builtin/help.c | 8 ++---
builtin/index-pack.c | 8 ++---
builtin/init-db.c | 2 +-
builtin/log.c | 8 ++---
builtin/ls-remote.c | 4 +--
builtin/mailinfo.c | 16 +++++-----
builtin/merge-recursive.c | 4 +--
builtin/merge.c | 12 +++----
builtin/name-rev.c | 6 ++--
builtin/notes.c | 2 +-
builtin/pack-objects.c | 2 +-
builtin/prune.c | 4 +--
builtin/receive-pack.c | 6 ++--
builtin/reflog.c | 4 +--
builtin/remote.c | 22 +++++--------
builtin/repack.c | 2 +-
builtin/rev-parse.c | 24 +++++++-------
builtin/send-pack.c | 8 ++---
builtin/shortlog.c | 6 ++--
builtin/show-branch.c | 20 ++++++------
builtin/show-ref.c | 6 ++--
builtin/symbolic-ref.c | 2 +-
builtin/tag.c | 2 +-
builtin/tar-tree.c | 2 +-
builtin/unpack-objects.c | 2 +-
builtin/update-ref.c | 10 +++---
builtin/upload-archive.c | 2 +-
commit.c | 6 ++--
config.c | 16 +++++-----
connect.c | 2 +-
connected.c | 2 +-
convert.c | 2 +-
daemon.c | 40 ++++++++++++------------
diff.c | 56 ++++++++++++++++-----------------
environment.c | 2 +-
fast-import.c | 80 +++++++++++++++++++++++------------------------
fetch-pack.c | 12 +++----
git-compat-util.h | 4 +--
git.c | 12 +++----
help.c | 8 ++---
http-backend.c | 4 +--
http-push.c | 4 +--
http.c | 10 +++---
imap-send.c | 10 +++---
log-tree.c | 8 ++---
merge-recursive.c | 6 ++--
notes-utils.c | 4 +--
notes.c | 8 ++---
pager.c | 2 +-
parse-options.c | 12 +++----
pathspec.c | 2 +-
pkt-line.c | 4 +--
pretty.c | 36 ++++++++++-----------
refs.c | 30 +++++++++---------
remote-curl.c | 14 ++++-----
remote-testsvn.c | 10 +++---
remote.c | 46 +++++++++++++--------------
revision.c | 38 +++++++++++-----------
send-pack.c | 4 +--
sequencer.c | 8 ++---
setup.c | 4 +--
sha1_name.c | 16 +++++-----
shell.c | 2 +-
strbuf.c | 12 +++----
submodule.c | 2 +-
tag.c | 10 +++---
test-line-buffer.c | 6 ++--
test-string-list.c | 2 +-
transport-helper.c | 16 +++++-----
transport.c | 28 ++++++++---------
upload-pack.c | 10 +++---
vcs-svn/fast_export.c | 11 +------
wt-status.c | 16 +++++-----
92 files changed, 469 insertions(+), 486 deletions(-)
--
1.8.4.1.561.g12affca
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/5] environment: normalize use of prefixcmp() by removing " != 0"
2013-12-01 7:49 [PATCH 0/5] use starts_with() and ends_with() Christian Couder
@ 2013-12-01 7:49 ` Christian Couder
2013-12-01 7:49 ` [PATCH 2/5] builtin/remote: remove postfixcmp() and use suffixcmp() instead Christian Couder
` (4 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Christian Couder @ 2013-12-01 7:49 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Antoine Pelisse, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
To be able to automatically convert prefixcmp() to starts_with()
we need first to make sure that prefixcmp() is always used in
the same way.
So let's remove " != 0" after prefixcmp().
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
environment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/environment.c b/environment.c
index 0a15349..cd2b068 100644
--- a/environment.c
+++ b/environment.c
@@ -171,7 +171,7 @@ const char *get_git_namespace(void)
const char *strip_namespace(const char *namespaced_ref)
{
- if (prefixcmp(namespaced_ref, get_git_namespace()) != 0)
+ if (prefixcmp(namespaced_ref, get_git_namespace()))
return NULL;
return namespaced_ref + namespace_len;
}
--
1.8.4.1.561.g12affca
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/5] builtin/remote: remove postfixcmp() and use suffixcmp() instead
2013-12-01 7:49 [PATCH 0/5] use starts_with() and ends_with() Christian Couder
2013-12-01 7:49 ` [PATCH 1/5] environment: normalize use of prefixcmp() by removing " != 0" Christian Couder
@ 2013-12-01 7:49 ` Christian Couder
2013-12-01 7:49 ` [PATCH 3/5] strbuf: introduce starts_with() and ends_with() Christian Couder
` (3 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Christian Couder @ 2013-12-01 7:49 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Antoine Pelisse, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
Commit 8cc5b290 (git merge -X<option>, 25 Nov 2009) introduced
suffixcmp() with nearly the same implementation as postfixcmp()
that already existed since commit 211c8968 (Make git-remote a
builtin, 29 Feb 2008).
The only difference between the two implementations is that,
when the string is smaller than the suffix, one implementation
returns 1 while the other one returns -1.
But, as postfixcmp() is only used to compare for equality, the
distinction does not matter and does not affect the correctness of
this patch.
As postfixcmp() has always been static in builtin/remote.c
and is used nowhere else, it makes more sense to remove it
and use suffixcmp() instead in builtin/remote.c, rather than
to remove suffixcmp().
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
builtin/remote.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index 4e14891..9b3a98e 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -80,14 +80,6 @@ static int verbose;
static int show_all(void);
static int prune_remote(const char *remote, int dry_run);
-static inline int postfixcmp(const char *string, const char *postfix)
-{
- int len1 = strlen(string), len2 = strlen(postfix);
- if (len1 < len2)
- return 1;
- return strcmp(string + len1 - len2, postfix);
-}
-
static int fetch_remote(const char *name)
{
const char *argv[] = { "fetch", name, NULL, NULL };
@@ -277,13 +269,13 @@ static int config_read_branches(const char *key, const char *value, void *cb)
enum { REMOTE, MERGE, REBASE } type;
key += 7;
- if (!postfixcmp(key, ".remote")) {
+ if (!suffixcmp(key, ".remote")) {
name = xstrndup(key, strlen(key) - 7);
type = REMOTE;
- } else if (!postfixcmp(key, ".merge")) {
+ } else if (!suffixcmp(key, ".merge")) {
name = xstrndup(key, strlen(key) - 6);
type = MERGE;
- } else if (!postfixcmp(key, ".rebase")) {
+ } else if (!suffixcmp(key, ".rebase")) {
name = xstrndup(key, strlen(key) - 7);
type = REBASE;
} else
--
1.8.4.1.561.g12affca
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/5] strbuf: introduce starts_with() and ends_with()
2013-12-01 7:49 [PATCH 0/5] use starts_with() and ends_with() Christian Couder
2013-12-01 7:49 ` [PATCH 1/5] environment: normalize use of prefixcmp() by removing " != 0" Christian Couder
2013-12-01 7:49 ` [PATCH 2/5] builtin/remote: remove postfixcmp() and use suffixcmp() instead Christian Couder
@ 2013-12-01 7:49 ` Christian Couder
2013-12-01 7:49 ` [PATCH 5/5] strbuf: remove prefixcmp() and suffixcmp() Christian Couder
` (2 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Christian Couder @ 2013-12-01 7:49 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Antoine Pelisse, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
prefixcmp() and suffixcmp() cannot be really used as comparison
functions as they are not antisymmetric:
prefixcmp("foo", "foobar") < 0
prefixcmp("foobar", "foo") == 0
So they are not suitable as functions for passing to qsort.
And in fact they are used nowhere as comparison functions.
Therefore we should replace them with functions that just check
for equality.
As a first step toward this goal, this patch introduces
starts_with() and end_with() that will be used to replace
respectively prefixcmp() and suffixcmp().
Some popular programming languages, like Java, Python and Ruby
have functions or methods called like starts_with() and
ends_with() that are doing what we want. Therefore it makes sense
to use such names.
In vcs-svn/fast_export.c, there was already an ends_with()
function that did the same thing. Let's use the new one instead
while at it.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
git-compat-util.h | 2 ++
strbuf.c | 18 ++++++++++++++++++
vcs-svn/fast_export.c | 11 +----------
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index 7776f12..b73916b 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -350,7 +350,9 @@ extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_lis
extern void set_error_routine(void (*routine)(const char *err, va_list params));
extern void set_die_is_recursing_routine(int (*routine)(void));
+extern int starts_with(const char *str, const char *prefix);
extern int prefixcmp(const char *str, const char *prefix);
+extern int ends_with(const char *str, const char *suffix);
extern int suffixcmp(const char *str, const char *suffix);
static inline const char *skip_prefix(const char *str, const char *prefix)
diff --git a/strbuf.c b/strbuf.c
index 1170d01..83caf4a 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,6 +1,15 @@
#include "cache.h"
#include "refs.h"
+int starts_with(const char *str, const char *prefix)
+{
+ for (; ; str++, prefix++)
+ if (!*prefix)
+ return 1;
+ else if (*str != *prefix)
+ return 0;
+}
+
int prefixcmp(const char *str, const char *prefix)
{
for (; ; str++, prefix++)
@@ -10,6 +19,15 @@ int prefixcmp(const char *str, const char *prefix)
return (unsigned char)*prefix - (unsigned char)*str;
}
+int ends_with(const char *str, const char *suffix)
+{
+ int len = strlen(str), suflen = strlen(suffix);
+ if (len < suflen)
+ return 0;
+ else
+ return !strcmp(str + len - suflen, suffix);
+}
+
int suffixcmp(const char *str, const char *suffix)
{
int len = strlen(str), suflen = strlen(suffix);
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index f2b23c8..bd0f2c2 100644
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
@@ -162,22 +162,13 @@ static void die_short_read(struct line_buffer *input)
die("invalid dump: unexpected end of file");
}
-static int ends_with(const char *s, size_t len, const char *suffix)
-{
- const size_t suffixlen = strlen(suffix);
- if (len < suffixlen)
- return 0;
- return !memcmp(s + len - suffixlen, suffix, suffixlen);
-}
-
static int parse_cat_response_line(const char *header, off_t *len)
{
- size_t headerlen = strlen(header);
uintmax_t n;
const char *type;
const char *end;
- if (ends_with(header, headerlen, " missing"))
+ if (ends_with(header, " missing"))
return error("cat-blob reports missing blob: %s", header);
type = strstr(header, " blob ");
if (!type)
--
1.8.4.1.561.g12affca
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/5] strbuf: remove prefixcmp() and suffixcmp()
2013-12-01 7:49 [PATCH 0/5] use starts_with() and ends_with() Christian Couder
` (2 preceding siblings ...)
2013-12-01 7:49 ` [PATCH 3/5] strbuf: introduce starts_with() and ends_with() Christian Couder
@ 2013-12-01 7:49 ` Christian Couder
2013-12-02 15:09 ` [PATCH 0/5] use starts_with() and ends_with() Jeff King
[not found] ` <20131201074919.3042.92026.chriscool@tuxfamily.org>
5 siblings, 0 replies; 17+ messages in thread
From: Christian Couder @ 2013-12-01 7:49 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Antoine Pelisse, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
As starts_with() and ends_with() have been used to
replace prefixcmp() and suffixcmp() respectively,
we can now remove them.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
git-compat-util.h | 2 --
strbuf.c | 18 ------------------
2 files changed, 20 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b73916b..c4c01e7 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -351,9 +351,7 @@ extern void set_error_routine(void (*routine)(const char *err, va_list params));
extern void set_die_is_recursing_routine(int (*routine)(void));
extern int starts_with(const char *str, const char *prefix);
-extern int prefixcmp(const char *str, const char *prefix);
extern int ends_with(const char *str, const char *suffix);
-extern int suffixcmp(const char *str, const char *suffix);
static inline const char *skip_prefix(const char *str, const char *prefix)
{
diff --git a/strbuf.c b/strbuf.c
index 83caf4a..ee96dcf 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -10,15 +10,6 @@ int starts_with(const char *str, const char *prefix)
return 0;
}
-int prefixcmp(const char *str, const char *prefix)
-{
- for (; ; str++, prefix++)
- if (!*prefix)
- return 0;
- else if (*str != *prefix)
- return (unsigned char)*prefix - (unsigned char)*str;
-}
-
int ends_with(const char *str, const char *suffix)
{
int len = strlen(str), suflen = strlen(suffix);
@@ -28,15 +19,6 @@ int ends_with(const char *str, const char *suffix)
return !strcmp(str + len - suflen, suffix);
}
-int suffixcmp(const char *str, const char *suffix)
-{
- int len = strlen(str), suflen = strlen(suffix);
- if (len < suflen)
- return -1;
- else
- return strcmp(str + len - suflen, suffix);
-}
-
/*
* Used as the default ->buf value, so that people can always assume
* buf is non NULL and ->buf is NUL terminated even for a freshly
--
1.8.4.1.561.g12affca
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 0/5] use starts_with() and ends_with()
2013-12-01 7:49 [PATCH 0/5] use starts_with() and ends_with() Christian Couder
` (3 preceding siblings ...)
2013-12-01 7:49 ` [PATCH 5/5] strbuf: remove prefixcmp() and suffixcmp() Christian Couder
@ 2013-12-02 15:09 ` Jeff King
2013-12-02 18:32 ` Junio C Hamano
[not found] ` <20131201074919.3042.92026.chriscool@tuxfamily.org>
5 siblings, 1 reply; 17+ messages in thread
From: Jeff King @ 2013-12-02 15:09 UTC (permalink / raw)
To: Christian Couder
Cc: Junio C Hamano, git, Antoine Pelisse, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:
> This is a new patch series along the lines Junio suggested in this
> thread:
>
> http://thread.gmane.org/gmane.comp.version-control.git/238054/
>
> I send it now because I saw a 1.8.5 tag.
This looks sane to me. Your 4/5 did not make it to the list (nor
directly to me), though. Perhaps because it is huge?
-Peff
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/5] use starts_with() and ends_with()
2013-12-02 15:09 ` [PATCH 0/5] use starts_with() and ends_with() Jeff King
@ 2013-12-02 18:32 ` Junio C Hamano
2013-12-02 19:29 ` Christian Couder
0 siblings, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2013-12-02 18:32 UTC (permalink / raw)
To: Jeff King
Cc: Christian Couder, git, Antoine Pelisse, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
Jeff King <peff@peff.net> writes:
> On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:
>
>> This is a new patch series along the lines Junio suggested in this
>> thread:
>>
>> http://thread.gmane.org/gmane.comp.version-control.git/238054/
>>
>> I send it now because I saw a 1.8.5 tag.
>
> This looks sane to me. Your 4/5 did not make it to the list (nor
> directly to me), though. Perhaps because it is huge?
Nor to me, either.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/5] use starts_with() and ends_with()
2013-12-02 18:32 ` Junio C Hamano
@ 2013-12-02 19:29 ` Christian Couder
2013-12-02 19:32 ` Antoine Pelisse
0 siblings, 1 reply; 17+ messages in thread
From: Christian Couder @ 2013-12-02 19:29 UTC (permalink / raw)
To: gitster
Cc: peff, git, apelisse, apenwarr, Johannes.Schindelin, jrnieder, max,
ae
From: Junio C Hamano <gitster@pobox.com>
>
> Jeff King <peff@peff.net> writes:
>
>> On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:
>>
>>> This is a new patch series along the lines Junio suggested in this
>>> thread:
>>>
>>> http://thread.gmane.org/gmane.comp.version-control.git/238054/
>>>
>>> I send it now because I saw a 1.8.5 tag.
>>
>> This looks sane to me. Your 4/5 did not make it to the list (nor
>> directly to me), though. Perhaps because it is huge?
>
> Nor to me, either.
Sorry about that I don't know what happened. Maybe my ISP has blocked
it because it is big.
I just tried to send it again.
Best,
Christian.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/5] use starts_with() and ends_with()
2013-12-02 19:29 ` Christian Couder
@ 2013-12-02 19:32 ` Antoine Pelisse
2013-12-03 6:06 ` Christian Couder
0 siblings, 1 reply; 17+ messages in thread
From: Antoine Pelisse @ 2013-12-02 19:32 UTC (permalink / raw)
To: Christian Couder
Cc: Junio C Hamano, Jeff King, git, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
On Mon, Dec 2, 2013 at 8:29 PM, Christian Couder
<chriscool@tuxfamily.org> wrote:
> From: Junio C Hamano <gitster@pobox.com>
>>
>> Jeff King <peff@peff.net> writes:
>>
>>> On Sun, Dec 01, 2013 at 08:49:13AM +0100, Christian Couder wrote:
>>>
>>>> This is a new patch series along the lines Junio suggested in this
>>>> thread:
>>>>
>>>> http://thread.gmane.org/gmane.comp.version-control.git/238054/
>>>>
>>>> I send it now because I saw a 1.8.5 tag.
>>>
>>> This looks sane to me. Your 4/5 did not make it to the list (nor
>>> directly to me), though. Perhaps because it is huge?
>>
>> Nor to me, either.
>
> Sorry about that I don't know what happened. Maybe my ISP has blocked
> it because it is big.
I don't know, I received it.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/5] use starts_with() and ends_with()
2013-12-02 19:32 ` Antoine Pelisse
@ 2013-12-03 6:06 ` Christian Couder
0 siblings, 0 replies; 17+ messages in thread
From: Christian Couder @ 2013-12-03 6:06 UTC (permalink / raw)
To: Antoine Pelisse
Cc: Christian Couder, Junio C Hamano, Jeff King, git, Avery Pennarun,
Johannes Schindelin, Jonathan Nieder, Max Horn, Andreas Ericsson
On Mon, Dec 2, 2013 at 8:32 PM, Antoine Pelisse <apelisse@gmail.com> wrote:
> On Mon, Dec 2, 2013 at 8:29 PM, Christian Couder
> <chriscool@tuxfamily.org> wrote:
>> From: Junio C Hamano <gitster@pobox.com>
>>>
>>> Jeff King <peff@peff.net> writes:
>>>
>>>> This looks sane to me. Your 4/5 did not make it to the list (nor
>>>> directly to me), though. Perhaps because it is huge?
>>>
>>> Nor to me, either.
>>
>> Sorry about that I don't know what happened. Maybe my ISP has blocked
>> it because it is big.
>
> I don't know, I received it.
When I send it to my gmail account, I receive it too.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
[not found] ` <CAP8UFD0jg_Vr7Zf+DiMX9RG6vmmQvmk2NvmL7j=MC-x3fLOOBA@mail.gmail.com>
@ 2013-12-03 12:46 ` Jeff King
2013-12-03 20:24 ` Christian Couder
0 siblings, 1 reply; 17+ messages in thread
From: Jeff King @ 2013-12-03 12:46 UTC (permalink / raw)
To: Christian Couder
Cc: git, Junio C Hamano, Jonathan Nieder, Johannes Schindelin
On Tue, Dec 03, 2013 at 08:03:39AM +0100, Christian Couder wrote:
> I am trying to forward this patch from my gmail address, as it doesn't
> seem to go through when I send it from my home machine.
This made it through to me, but not the list. There are at least two
things going on:
1. The message is 172K, which is over the 100K limit imposed by vger;
the list is silently dropping it.
2. In my case, the direct mail was being flagged by spam because it
contains the blacklisted domain "old.name". Which of course is not
a domain at all but rather this code:
old.name = old.path + strlen("refs/heads/");
I've tweaked my server.
I can't say why it wasn't getting to Junio via direct mail. Maybe the
same spam thing, or maybe something else.
> From: Christian Couder <chriscool@tuxfamily.org>
> Date: Sun, Dec 1, 2013 at 8:49 AM
> Subject: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
> To: christian.couder@gmail.com
>
> This patch was generated automatically using the following
> commands:
>
> git grep --name-only prefixcmp | grep -v '\.h' | grep -v 'strbuf.c' |
> xargs perl -pi -e 's/!prefixcmp\(/starts_with\(/g'
> git grep --name-only prefixcmp | grep -v '\.h' | grep -v 'strbuf.c' |
> xargs perl -pi -e 's/prefixcmp\(/!starts_with\(/g'
> git grep --name-only suffixcmp | grep -v '\.h' | grep -v 'strbuf.c' |
> xargs perl -pi -e 's/!suffixcmp\(/ends_with\(/g'
> git grep --name-only suffixcmp | grep -v '\.h' | grep -v 'strbuf.c' |
> xargs perl -pi -e 's/suffixcmp\(/!ends_with\(/g'
>
> It was generated on version 1.8.5 of the git codebase.
I skimmed the patch and didn't notice any problems. It's
whitespace-damaged by gmail, of course. The simplest thing is probably
to just point us at a public repo with the commit, if you have one.
-Peff
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
2013-12-03 12:46 ` Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with() Jeff King
@ 2013-12-03 20:24 ` Christian Couder
2013-12-04 19:45 ` Jeff King
2013-12-04 20:51 ` Junio C Hamano
0 siblings, 2 replies; 17+ messages in thread
From: Christian Couder @ 2013-12-03 20:24 UTC (permalink / raw)
To: Jeff King; +Cc: git, Junio C Hamano, Jonathan Nieder, Johannes Schindelin
On Tue, Dec 3, 2013 at 1:46 PM, Jeff King <peff@peff.net> wrote:
>
> This made it through to me, but not the list. There are at least two
> things going on:
>
> 1. The message is 172K, which is over the 100K limit imposed by vger;
> the list is silently dropping it.
>
> 2. In my case, the direct mail was being flagged by spam because it
> contains the blacklisted domain "old.name". Which of course is not
> a domain at all but rather this code:
>
> old.name = old.path + strlen("refs/heads/");
>
> I've tweaked my server.
>
> I can't say why it wasn't getting to Junio via direct mail. Maybe the
> same spam thing, or maybe something else.
[...]
> I skimmed the patch and didn't notice any problems. It's
> whitespace-damaged by gmail, of course. The simplest thing is probably
> to just point us at a public repo with the commit, if you have one.
Ok, the commit is in the use_starts_ends_with branch on this github repo:
https://github.com/chriscool/git.git
Thanks,
Christian.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
2013-12-03 20:24 ` Christian Couder
@ 2013-12-04 19:45 ` Jeff King
2013-12-04 20:51 ` Junio C Hamano
1 sibling, 0 replies; 17+ messages in thread
From: Jeff King @ 2013-12-04 19:45 UTC (permalink / raw)
To: Christian Couder
Cc: git, Junio C Hamano, Jonathan Nieder, Johannes Schindelin
On Tue, Dec 03, 2013 at 09:24:40PM +0100, Christian Couder wrote:
> > I skimmed the patch and didn't notice any problems. It's
> > whitespace-damaged by gmail, of course. The simplest thing is probably
> > to just point us at a public repo with the commit, if you have one.
>
> Ok, the commit is in the use_starts_ends_with branch on this github repo:
>
> https://github.com/chriscool/git.git
Thanks. I looked more carefully this time, using a few greps to classify
the surrounding context (since the script you used for the update could
conceivably miss some really odd misuse). The whole thing looks good to
me.
-Peff
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
2013-12-03 20:24 ` Christian Couder
2013-12-04 19:45 ` Jeff King
@ 2013-12-04 20:51 ` Junio C Hamano
2013-12-04 22:02 ` Junio C Hamano
1 sibling, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2013-12-04 20:51 UTC (permalink / raw)
To: Christian Couder; +Cc: Jeff King, git, Jonathan Nieder, Johannes Schindelin
Christian Couder <christian.couder@gmail.com> writes:
> Ok, the commit is in the use_starts_ends_with branch on this github repo:
>
> https://github.com/chriscool/git.git
I looked at the patches, and they looked alright. The endgame needs
to be on a separate topic to be held until a distant future, though.
Will queue. Thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
2013-12-04 20:51 ` Junio C Hamano
@ 2013-12-04 22:02 ` Junio C Hamano
2013-12-05 7:19 ` Christian Couder
0 siblings, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2013-12-04 22:02 UTC (permalink / raw)
To: Christian Couder; +Cc: Jeff King, git, Jonathan Nieder, Johannes Schindelin
Junio C Hamano <gitster@pobox.com> writes:
> Christian Couder <christian.couder@gmail.com> writes:
>
>> Ok, the commit is in the use_starts_ends_with branch on this github repo:
>>
>> https://github.com/chriscool/git.git
>
> I looked at the patches, and they looked alright. The endgame needs
> to be on a separate topic to be held until a distant future, though.
>
> Will queue. Thanks.
It turns out that, naturally, there are many new uses of prefixcmp
in the topics in flight. I can manage, but adjusting all of them
would not look too pretty X-<.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
2013-12-04 22:02 ` Junio C Hamano
@ 2013-12-05 7:19 ` Christian Couder
2013-12-05 18:04 ` Junio C Hamano
0 siblings, 1 reply; 17+ messages in thread
From: Christian Couder @ 2013-12-05 7:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, git, Jonathan Nieder, Johannes Schindelin
On Wed, Dec 4, 2013 at 11:02 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Christian Couder <christian.couder@gmail.com> writes:
>>
>>> Ok, the commit is in the use_starts_ends_with branch on this github repo:
>>>
>>> https://github.com/chriscool/git.git
>>
>> I looked at the patches, and they looked alright. The endgame needs
>> to be on a separate topic to be held until a distant future, though.
>>
>> Will queue. Thanks.
Great!
> It turns out that, naturally, there are many new uses of prefixcmp
> in the topics in flight. I can manage, but adjusting all of them
> would not look too pretty X-<.
Tell me if I can do something.
I can prepare patches for the topics in flight in 'next' for example.
Thanks,
Christian.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with()
2013-12-05 7:19 ` Christian Couder
@ 2013-12-05 18:04 ` Junio C Hamano
0 siblings, 0 replies; 17+ messages in thread
From: Junio C Hamano @ 2013-12-05 18:04 UTC (permalink / raw)
To: Christian Couder; +Cc: Jeff King, git, Jonathan Nieder, Johannes Schindelin
Christian Couder <christian.couder@gmail.com> writes:
> Tell me if I can do something.
I think the tip of 'pu' with cc/starts-n-ends-with-endgame is in
fairly a good shape. The evil merge there may need to be updated
over time, but I think I can manage.
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2013-12-05 18:05 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-01 7:49 [PATCH 0/5] use starts_with() and ends_with() Christian Couder
2013-12-01 7:49 ` [PATCH 1/5] environment: normalize use of prefixcmp() by removing " != 0" Christian Couder
2013-12-01 7:49 ` [PATCH 2/5] builtin/remote: remove postfixcmp() and use suffixcmp() instead Christian Couder
2013-12-01 7:49 ` [PATCH 3/5] strbuf: introduce starts_with() and ends_with() Christian Couder
2013-12-01 7:49 ` [PATCH 5/5] strbuf: remove prefixcmp() and suffixcmp() Christian Couder
2013-12-02 15:09 ` [PATCH 0/5] use starts_with() and ends_with() Jeff King
2013-12-02 18:32 ` Junio C Hamano
2013-12-02 19:29 ` Christian Couder
2013-12-02 19:32 ` Antoine Pelisse
2013-12-03 6:06 ` Christian Couder
[not found] ` <20131201074919.3042.92026.chriscool@tuxfamily.org>
[not found] ` <CAP8UFD0jg_Vr7Zf+DiMX9RG6vmmQvmk2NvmL7j=MC-x3fLOOBA@mail.gmail.com>
2013-12-03 12:46 ` Fwd: [PATCH 4/5] Replace {pre,suf}fixcmp() with {starts,ends}_with() Jeff King
2013-12-03 20:24 ` Christian Couder
2013-12-04 19:45 ` Jeff King
2013-12-04 20:51 ` Junio C Hamano
2013-12-04 22:02 ` Junio C Hamano
2013-12-05 7:19 ` Christian Couder
2013-12-05 18:04 ` Junio C Hamano
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 NNTP newsgroup(s).