git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: git@vger.kernel.org,  Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Subject: Re: [PATCH 1/2] line-log: fix assertion error
Date: Mon, 18 Aug 2025 12:17:44 -0700	[thread overview]
Message-ID: <xmqqjz30igmf.fsf@gitster.g> (raw)
In-Reply-To: <20250818111310.1283932-2-szeder.dev@gmail.com> ("SZEDER Gábor"'s message of "Mon, 18 Aug 2025 13:13:09 +0200")

SZEDER Gábor <szeder.dev@gmail.com> writes:

>   - 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.

  reply	other threads:[~2025-08-18 19:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 11:13 [PATCH 0/2] line-log: small fixes SZEDER Gábor
2025-08-18 11:13 ` [PATCH 1/2] line-log: fix assertion error SZEDER Gábor
2025-08-18 19:17   ` Junio C Hamano [this message]
2025-08-18 11:13 ` [PATCH 2/2] line-log: show all line ranges touched by the same diff range SZEDER Gábor
2025-08-18 11:25 ` [PATCH 0/2] line-log: small fixes SZEDER Gábor

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=xmqqjz30igmf.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=evgeni.chasnovski@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=szeder.dev@gmail.com \
    /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).