From: Junio C Hamano <gitster@pobox.com>
To: "Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Peter Colberg <pcolberg@redhat.com>,
Kristofer Karlsson <krka@spotify.com>
Subject: Re: [PATCH] revision: fix --no-walk path filtering regression
Date: Thu, 16 Jul 2026 10:59:53 -0700 [thread overview]
Message-ID: <xmqq4ihyhl2e.fsf@gitster.g> (raw)
In-Reply-To: <pull.2181.git.1784198879711.gitgitgadget@gmail.com> (Kristofer Karlsson via GitGitGadget's message of "Thu, 16 Jul 2026 10:47:58 +0000")
"Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> From: Kristofer Karlsson <krka@spotify.com>
>
> Since dd4bc01c0a (revision: use priority queue for non-limited
> streaming walks, 2026-05-27), "git rev-list --no-walk <commit>
> -- <path>" ignores the path arguments and outputs all commits
> regardless of whether they touch the given paths.
>
> That commit introduced a REV_WALK_NO_WALK enum value to separate
> --no-walk from the streaming walk in get_revision_1(). The new
> case skips process_parents(), which is correct for not enqueuing
> parents, but also skips try_to_simplify_commit() which
> process_parents() calls to evaluate whether each commit touches
> the given paths.
>
> Add a call to try_to_simplify_commit() for the
> REV_WALK_NO_WALK case, folding it into the existing
> REV_WALK_REFLOG case which already does the same.
>
> Add tests for --no-walk path filtering to t6017. The
> "single commit, match" test is defensive and passes without
> the fix, while the other two fail without it.
>
> Reported-by: Peter Colberg <pcolberg@redhat.com>
> Signed-off-by: Kristofer Karlsson <krka@spotify.com>
> ---
> revision: fix --no-walk path filtering regression
>
> Fix for a regression reported by Peter Colberg [1] where git rev-list
> --no-walk <commit> -- <path> ignores path arguments since dd4bc01c0a.
>
> Verified against linux.git with the exact example from the report:
>
> git rev-list --topo-order v7.0..v7.1 -- drivers/gpu/drm/ |
> git rev-list --stdin --no-walk=unsorted -- ':!drivers/gpu/drm/'
>
>
> Without fix: 2026 commits (all pass through unfiltered) With fix: 146
> commits (correctly filtered)
>
> [1]
> https://lore.kernel.org/git/CAL71e4NjDTHbKR8z7pSrPpzDrX19JOTR04sArm7P=m5ivqkskA@mail.gmail.com/T/#u
OK. Without this fix, a commit that applied this patch (which does
not touch Makefile) shows the commit message in
$ git show HEAD -- Makefile
but with this fix, just like Git 2.54 did, the command stays silent.
Will queue. Thanks.
next prev parent reply other threads:[~2026-07-16 17:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 10:47 [PATCH] revision: fix --no-walk path filtering regression Kristofer Karlsson via GitGitGadget
2026-07-16 17:59 ` Junio C Hamano [this message]
2026-07-16 19:35 ` Peter Colberg
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=xmqq4ihyhl2e.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=krka@spotify.com \
--cc=pcolberg@redhat.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