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

Re: [PATCH 1/2] line-log: fix assertion error

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 18, 2025, 19:17 UTC
Message-ID
<xmqqjz30igmf.fsf@gitster.g>
In-Reply-To
<20250818111310.1283932-2-szeder.dev@gmail.com>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 26 quoted lines
>   - When a commit modifies an interesting path, the line-log machinery
>     first checks which diff range (i.e. hunk) modify any line ranges.
>     This is done in diff_ranges_filter_touched(), where the outer loop
>     iterates over the diff ranges, and in each iteration the inner
>     loop advances the line ranges supposedly until the current line
>     range ends at or after the current diff range starts, and then the
>     current diff and line ranges are checked for overlap.
> ...
>     Fix that loop condition in diff_ranges_filter_touched() to not
>     treat 'end' as part of the line range.
>
>   - With the above fix the assertion error is gone... but, alas, we
>     now get stuck in an endless loop!
> ...
>     Fix this condition in range_set_difference() to not treat 'end' as
>     part of the line range.
>
>   - With the above fix the endless loop is gone... but, alas, the
>     output is now wrong, as it shows both line ranges for HEAD, even
>     though the first line range is not modified by that commit:
> ...
>     Fix this condition to not treat 'end' as part of the line range,
>     just like in the previous cases.
>
> After all this the command in the above example finally finishes and
> produces the right output:
What a lengthy journey X-<.
Thanks for an amusing description.
Previous: SZEDER GáborNext: SZEDER Gábor
Message 3 of 5 in “line-log: small fixes”
  1. 0/2 line-log: small fixesSZEDER Gábor, Aug 18, 2025
  2. 1/2 line-log: fix assertion errorSZEDER Gábor, Aug 18, 2025
  3. Junio C HamanoAug 18, 2025
  4. 2/2 line-log: show all line ranges touched by the same diff rangeSZEDER Gábor, Aug 18, 2025
  5. SZEDER GáborAug 18, 2025

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.