From: "Michael Montalbo via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Matthew Hughes" <matthewhughes934@gmail.com>,
"SZEDER Gábor" <szeder.dev@gmail.com>,
"Michael Montalbo" <mmontalbo@gmail.com>
Subject: [PATCH v2 0/2] line-log: fix -L with pickaxe options
Date: Wed, 04 Mar 2026 19:21:29 +0000 [thread overview]
Message-ID: <pull.2061.v2.git.1772652091.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2061.git.1772651484.gitgitgadget@gmail.com>
This series fixes a crash in git log -L when combined with pickaxe options
(-G, -S, or --find-object) on a history involving renames, reported in [1].
The crash bisects to a2bb801f6a (line-log: avoid unnecessary full tree
diffs, 2019-08-21). Before that commit, the same combination silently
truncated history at rename boundaries rather than crashing. The root cause
is that diffcore_std() runs diffcore_pickaxe(), which may discard diff pairs
needed for rename detection.
Patch 1 fixes the crash by calling diffcore_rename() directly instead of
diffcore_std(), and adds tests including known-breakage markers showing that
the pickaxe options are silently ignored by -L.
Patch 2 explicitly rejects the unsupported combination with die(), replacing
the known-breakage tests with rejection tests.
[1] https://lore.kernel.org/git/aac-QdjY1ohAqgw_@desktop/
Michael Montalbo (2):
line-log: fix crash when combined with pickaxe options
log: reject pickaxe options when combined with -L
builtin/log.c | 4 ++++
line-log.c | 8 +++++++-
t/t4211-line-log.sh | 15 +++++++++++++++
3 files changed, 26 insertions(+), 1 deletion(-)
base-commit: 67ad42147a7acc2af6074753ebd03d904476118f
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2061%2Fmmontalbo%2Ffix-line-log-G-crash-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2061/mmontalbo/fix-line-log-G-crash-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2061
Range-diff vs v1:
1: 6e97d88993 ! 1: 273ebf640d line-log: fix crash when combined with pickaxe options
@@ Commit message
Before a2bb801f6a (line-log: avoid unnecessary full tree diffs,
2019-08-21), diffcore_std() was only invoked when a rename was already
suspected, so the pickaxe interference was unlikely in practice. That
- commit made the diffcore_std() call unconditional, and with
- filter_diffs_for_paths() now framing that call, a queue pruned by
- pickaxe violates filter_diffs_for_paths()'s expectation that diff
- pairs correspond to tracked paths, triggering an assertion failure.
+ commit restructured queue_diffs() to gate both diffcore_std() and the
+ surrounding filter_diffs_for_paths() calls behind
+ diff_might_be_rename(). When pickaxe breaks rename following at one
+ commit, a later commit may produce a deletion pair that bypasses this
+ gate entirely, reaching process_diff_filepair() with an invalid
+ filespec and triggering an assertion failure.
Fix this by calling diffcore_rename() directly instead of
diffcore_std(). The line-log machinery only needs rename detection
2: ae5269af0b = 2: 81cb521401 log: reject pickaxe options when combined with -L
--
gitgitgadget
next prev parent reply other threads:[~2026-03-04 19:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 19:11 [PATCH 0/2] line-log: fix -L with pickaxe options Michael Montalbo via GitGitGadget
2026-03-04 19:11 ` [PATCH 1/2] line-log: fix crash when combined " Michael Montalbo via GitGitGadget
2026-03-04 20:01 ` Junio C Hamano
2026-03-04 22:33 ` Michael Montalbo
2026-03-04 19:11 ` [PATCH 2/2] log: reject pickaxe options when combined with -L Michael Montalbo via GitGitGadget
2026-03-04 19:21 ` Michael Montalbo via GitGitGadget [this message]
2026-03-04 19:21 ` [PATCH v2 1/2] line-log: fix crash when combined with pickaxe options Michael Montalbo via GitGitGadget
2026-03-04 19:21 ` [PATCH v2 2/2] log: reject pickaxe options when combined with -L Michael Montalbo via GitGitGadget
2026-03-04 21:02 ` Junio C Hamano
2026-03-04 22:36 ` Michael Montalbo
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=pull.2061.v2.git.1772652091.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=matthewhughes934@gmail.com \
--cc=mmontalbo@gmail.com \
--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