From: David Michael Barr Date: Fri, 01 Jun 2012 16:43:02 GMT Subject: Re: [PATCH v2 3/6] vcs-svn: prefer constcmp to prefixcmp Message-ID: In-Reply-To: <7vfwaf3sll.fsf@alter.siamese.dyndns.org> On Sat, Jun 2, 2012 at 2:27 AM, Junio C Hamano wrote: > David Barr writes: > >> Comparisons in svndump.c are always guarded by length. >> As a bonus, elimate dependency on prefixcmp for upstream. >> >> Signed-off-by: David Barr > > It feels suboptimal, from cross-project maintenance point of view, > that "do not use prefixcmp() in the source in this directory" has to > be an unwritten rule.  Is there something we can do better to avoid > having to apply a patch like this in the future? I should note that constcmp() is local to vcs-svn/svndump.c. In this particular case, using prefixcmp() was a departure from the style of the surrounding code. Should prefixcmp() be referenced outside svndump_read() and handle_property(), I'll handle the dependency upstream. >>  vcs-svn/svndump.c |    2 +- >>  1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c >> index 0899790..8d0ae9c 100644 >> --- a/vcs-svn/svndump.c >> +++ b/vcs-svn/svndump.c >> @@ -361,7 +361,7 @@ void svndump_read(const char *url) >>                       reset_rev_ctx(atoi(val)); >>                       break; >>               case sizeof("Node-path"): >> -                     if (prefixcmp(t, "Node-")) >> +                     if (constcmp(t, "Node-")) >>                               continue; >>                       if (!constcmp(t + strlen("Node-"), "path")) { >>                               if (active_ctx == NODE_CTX) -- David Barr