From: Patrick Steinhardt <ps@pks.im>
To: Dominik Maier <dmnk@google.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Grant Moyer <dev@grantmoyer.com>,
Michele Locati <michele@locati.it>,
dmnk+artist@google.com
Subject: Re: [PATCH v2] filter-branch: check hex oids in state-branch map
Date: Tue, 1 Dec 2026 08:27:30 +0100 [thread overview]
Message-ID: <aw524rac0_Wez8m0@pks.im> (raw)
In-Reply-To: <20261130162211.3369007-1-dmnk@google.com>
On Mon, Nov 30, 2026 at 05:22:11PM +0100, Dominik Maier wrote:
> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index 9aa07be6e..fbf7882a7 100755
> --- a/git-filter-branch.sh
> +++ b/git-filter-branch.sh
> @@ -298,13 +298,23 @@ then
>
> git show "$state_commit:filter.map" >"$tempdir"/filter-map ||
> die "Unable to load state from $state_branch:filter.map"
> - while read line
> + while IFS= read -r line
> do
> case "$line" in
> *:*)
> from_commit=${line%:*}
> to_commit=${line#*:}
> - echo "$to_commit" >../map/"$from_commit";;
> + case "$from_commit" in
> + "" | *[!0-9a-f]*)
Nit, not blocking: it's rather uncustomary to have spaces around "|" in
our codebase.
> + die "Unable to load state from $state_branch:filter.map"
> + ;;
> + esac
> + case "$to_commit" in
> + *[!0-9a-f\ ]*)
> + die "Unable to load state from $state_branch:filter.map"
> + ;;
> + esac
Tiny nit, not blocking: this would be easier to read if there were some
blank lines around the case statements.
> + printf '%s\n' "$to_commit" >../map/"$from_commit";;
Why do you convert this from an echo to a printf?
Thanks!
Patrick
prev parent reply other threads:[~2026-12-01 7:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 19:23 [PATCH] filter-branch: check hex oids in state-branch map Dominik Maier
2026-11-24 19:19 ` Junio C Hamano
2026-11-30 16:22 ` [PATCH v2] " Dominik Maier
2026-12-01 7:27 ` Patrick Steinhardt [this message]
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=aw524rac0_Wez8m0@pks.im \
--to=ps@pks.im \
--cc=dev@grantmoyer.com \
--cc=dmnk+artist@google.com \
--cc=dmnk@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=michele@locati.it \
/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