Git development
 help / color / mirror / Atom feed
From: Grant Moyer <dev@grantmoyer.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Michele Locati <michele@locati.it>
Subject: Re: [PATCH] fiter-branch: fix commit map init from state branch
Date: Wed, 30 Sep 2026 11:48:25 -0400	[thread overview]
Message-ID: <c6d3deb4-088b-476e-921c-c2ee788fb309@grantmoyer.com> (raw)
In-Reply-To: <ar0fRtN8XMG-fyis@pks.im>

On September 30, 2026 10:40:06 AM EDT, Patrick Steinhardt <ps@pks.im> wrote:
>Okay. A simpler fix could've been the following diff:
>
>- echo "${line%:*}" >../map/"${line#*:}";;
>+ echo "${line#*:}" >../map/"${line%:*}";;

Yep, that's equivalent and was my first version, but I decided to err on 
the side of clearer intent. Plus, the more verbose version mirrors how 
the state branch is constructed further down in the script.

>So... does this mean that we don't have test coverage for this case at
>all?

Yeah, the test for this case was broken.

>>  test_expect_success 'using --state-branch to skip already rewritten commits' '
>>  test_when_finished git reset --hard $V &&
>>  git reset --hard $V &&
>> - git filter-branch --state-branch state -f --tree-filter "touch file || :" HEAD &&
>> + git filter-branch --state-branch state -f --tree-filter "exit 1" HEAD &&
>>  test_cmp_rev $W HEAD
>>  '
>
>So does this now detect the issue? If so, it feels somewhat roundabout.

The current test seemingly intends to check if the --tree-filter filter 
was run on already processed commits, but it only checks that the filter 
produces the same final result. Since the filter is deterministic, the 
final result is the same whether or not the filter is re-run on already 
processed commits.

The proposed change makes the test fail immediately if the tree-filter
is re-run. I looked around other tests for a test_* command or
conventions to fail with a message, but I didn't find anything. I've
checked that the test fails without the filter-branch change, and passes
with it.

>Nit: pointed out by Michele: the subject has a typo in "fiter-branch".

I'm new here. Is this something I should fix by submitting a new version 
of the patch, or will the maintainer fix it  up if/when they merge the 
patch?


Grant

  reply	other threads:[~2026-09-30 15:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01  3:31 [PATCH] fiter-branch: fix commit map init from state branch Grant Moyer
2026-09-29 14:31 ` Michele Locati
2026-09-30 14:40 ` Patrick Steinhardt
2026-09-30 15:48   ` Grant Moyer [this message]
2026-09-30 16:08     ` Patrick Steinhardt
2026-09-30 20:38   ` Michele Locati
2026-10-01  1:23 ` [PATCH v2] filter-branch: " Grant Moyer
2026-10-01  5:36   ` Patrick Steinhardt
2026-10-01  6:33     ` Michele Locati
2026-10-01 16:10   ` Junio C Hamano
2026-10-03  1:01   ` [PATCH v3] " Grant Moyer
2026-10-05  6:11     ` Patrick Steinhardt

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=c6d3deb4-088b-476e-921c-c2ee788fb309@grantmoyer.com \
    --to=dev@grantmoyer.com \
    --cc=git@vger.kernel.org \
    --cc=michele@locati.it \
    --cc=ps@pks.im \
    /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