From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
git@vger.kernel.org, "Phillip Wood" <phillip.wood123@gmail.com>,
"Matthias Aßhauer" <mha1993@live.de>
Subject: Re: [PATCH] 2.36 gitk/diff-tree --stdin regression fix
Date: Wed, 27 Apr 2022 13:03:41 -0700 [thread overview]
Message-ID: <xmqqv8uul2ea.fsf@gitster.g> (raw)
In-Reply-To: <a1dcac11-98ac-9fcd-8375-4fd1be9ace78@web.de> ("René Scharfe"'s message of "Wed, 27 Apr 2022 20:06:39 +0200")
René Scharfe <l.s.r@web.de> writes:
>> + if (prev_options_with_pathspec == options && !options->pathspec.nr)
>> + BUG("reused struct diff_options, potentially lost pathspec");
>> + if (options->pathspec.nr)
>> + prev_options_with_pathspec = options;
>
> This can report a false positive if a diffopt is reused with different
> pathspecs, and one of them is empty (match all). Which could be countered
> by using a fresh diffopt every time (e.g. pushing it into a loop).
The only use case to reset pathspec of a diffopt during iteration I
can think of is the hacky[*] version of "git log --follow" where the
pathspec is swapped when a rename of a single path being followed is
detected.
Side note: hacky because the way it swaps a single pathspec upon
seeing one rename means it does not work in a mergy-branchy
history where one branch renames and there are still commits
that need to be explored on the other branch that had the path
under its original name.
next prev parent reply other threads:[~2022-04-27 20:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-23 5:25 gitk regression in version 2.36.0 Matthias Aßhauer
2022-04-23 5:54 ` Junio C Hamano
2022-04-23 6:05 ` Junio C Hamano
2022-04-23 10:13 ` René Scharfe
2022-04-23 16:00 ` Junio C Hamano
2022-04-25 17:45 ` [PATCH] 2.36 gitk/diff-tree --stdin regression fix Junio C Hamano
2022-04-25 22:37 ` [PATCH] t4013: diff-tree --stdin with pathspec Junio C Hamano
2022-04-26 10:09 ` [PATCH] 2.36 gitk/diff-tree --stdin regression fix Phillip Wood
2022-04-26 13:45 ` Phillip Wood
2022-04-26 15:16 ` Junio C Hamano
2022-04-26 15:26 ` Junio C Hamano
2022-04-26 16:11 ` Junio C Hamano
2022-04-27 16:42 ` René Scharfe
2022-04-27 18:06 ` René Scharfe
2022-04-27 20:03 ` Junio C Hamano [this message]
2022-04-23 9:27 ` gitk regression in version 2.36.0 René Scharfe
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=xmqqv8uul2ea.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
--cc=mha1993@live.de \
--cc=phillip.wood123@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).