git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Brandon Casey <casey@nrlssc.navy.mil>
Cc: git@vger.kernel.org, Brandon Casey <drafnel@gmail.com>
Subject: Re: [PATCH 2/4] xdiff-interface.c: always trim trailing space from xfuncname matches
Date: Thu, 9 Sep 2010 15:21:08 -0400	[thread overview]
Message-ID: <20100909192108.GC32508@sigill.intra.peff.net> (raw)
In-Reply-To: <rRj7JpFIk_D_n7-wGkkucCda_kClmekHTPEHOGwmU5nYdmNhqqgzF59v609YFx69vv526WtEpyU@cipher.nrlssc.navy.mil>

On Thu, Sep 09, 2010 at 02:02:46PM -0500, Brandon Casey wrote:

> From: Brandon Casey <drafnel@gmail.com>
> 
> Generally, trailing space is removed from the string matched by the
> xfuncname patterns.  The exception is when the matched string exceeds the
> length of the fixed-size buffer that it will be copied in to.  But, a
> string that exceeds the buffer can still contain trailing space in the
> portion of the string that will be copied into the buffer.  So, simplify
> this code slightly, and just perform the trailing space removal always.

Hrm. So we are cutting off trailing space that might have been
non-trailing space in their original string? It is hard to argue that is
much worse than truncating the original string in the first place. But I
really wonder whether we should be silently truncating anything, and not
just dying or somehow handling this better?

If I understand what is going on (and I'm not sure that I do), are we
silently producing bogus word-diffs in the face of really long lines?

-Peff

  reply	other threads:[~2010-09-09 19:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 19:02 [PATCH 1/4] diff.c: call regfree to free memory allocated by regcomp when necessary Brandon Casey
2010-09-09 19:02 ` [PATCH 2/4] xdiff-interface.c: always trim trailing space from xfuncname matches Brandon Casey
2010-09-09 19:21   ` Jeff King [this message]
2010-09-09 19:33     ` Brandon Casey
2010-09-09 19:35       ` Jeff King
2010-09-09 19:02 ` [PATCH 3/4] t/t4018: test whether the word_regex patterns compile Brandon Casey
2010-09-09 19:23   ` Jeff King
2010-09-09 19:39     ` Brandon Casey
2010-09-09 19:59       ` Jeff King
2010-09-10 16:13         ` [PATCH] t/t4018: avoid two unnecessary sub-shell invocations Brandon Casey
2010-09-10 17:25           ` Ævar Arnfjörð Bjarmason
2010-09-09 19:02 ` [PATCH 4/4] userdiff.c: add builtin fortran regex patterns Brandon Casey
2010-09-09 19:25   ` Jeff King
2010-09-09 19:41     ` Brandon Casey
2010-09-10 16:18       ` [PATCH 4/4 v2] " Brandon Casey
2010-09-09 19:15 ` [PATCH 1/4] diff.c: call regfree to free memory allocated by regcomp when necessary Jeff King

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100909192108.GC32508@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=casey@nrlssc.navy.mil \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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).