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

Re: [PATCH 2/2] xdiff: implement empty line chunk heuristic

From
Jacob Keller <jacob.keller@gmail.com>
Date
Apr 16, 2016, 01:07 UTC
Message-ID
<CA+P7+xq_Uei_ybEjJ=PPWtruk5uB5Dp2KajA=5G6TSWU0_g2kw@mail.gmail.com>
In-Reply-To
<xmqqd1pq74ys.fsf@gitster.mtv.corp.google.com>
On Fri, Apr 15, 2016 at 5:49 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> +static int line_length(const char *recs)
>> +{
>> +     char *s = strchr(recs, '\n');
>> +     return s ? s - recs : strlen(recs);
>> +}
>
> It seems that you guys are discarding this "number of bytes on a
> line, no matter what these bytes are" idea, so this may be moot, but
> is there a guarantee that reading through recs until you happen to
> see a NUL is safe?
>
> Shouldn't the code that accesses a "line" be using the same "from
> here to there", i.e. recs[]->ptr, recs[]->size, interface to avoid
> having to scan the underlying string in an unbounded way?
>
>

I think we're going to make use of xdl_blankline instead of this or our own "is_emptyline"

Thanks, Jake

Previous: Stefan BellerNext: Junio C Hamano
Message 9 of 11 in “implement shortest line diff chunk heuristic”
  1. 0/2 implement shortest line diff chunk heuristicStefan Beller, Apr 15, 2016
  2. 1/2 xdiff: add recs_match helper functionStefan Beller, Apr 15, 2016
  3. 2/2 xdiff: implement empty line chunk heuristicStefan Beller, Apr 15, 2016
  4. Jacob KellerApr 15, 2016
  5. Jacob KellerApr 15, 2016
  6. Stefan BellerApr 15, 2016
  7. Junio C HamanoApr 16, 2016
  8. Stefan BellerApr 16, 2016
  9. Jacob KellerApr 16, 2016
  10. Junio C HamanoApr 18, 2016
  11. Stefan BellerApr 18, 2016

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.