* Unreleased, multi-lines git_filter_repo fix required to run b4 tests?
@ 2025-10-31 3:49 Marc Herbert
2025-10-31 14:00 ` Konstantin Ryabitsev
0 siblings, 1 reply; 3+ messages in thread
From: Marc Herbert @ 2025-10-31 3:49 UTC (permalink / raw)
To: tools
Hi,
I learned the really hard way that I need this multi-lines
git_filter_repo.py fix at the bottom to successfully run "uv run
pytest".
- 100% pass rate _with_ that fix applied on top of git_filter_repo.py v2.47
- 3 tests failing _without_ that fix:
FAILED src/tests/test_ez.py::test_trailers[trailers-thread-with-followups-None-None-trargs0-compareargs0-trailers-thread-with-followups-b4cfg0] - ValueError: dictionary update sequence element #35 has length 1; 2 is required
FAILED src/tests/test_ez.py::test_trailers[trailers-thread-with-cover-followup-None-None-trargs1-compareargs1-trailers-thread-with-cover-followup-b4cfg1] - ValueError: dictionary update sequence element #35 has length 1; 2 is required
FAILED src/tests/test_ez.py::test_trailers[trailers-thread-with-followups-trailers-with-tripledash-None-trargs3-compareargs3-trailers-thread-with-followups-and-tripledash-None] - ValueError: dictionary update sequence element #35 has length 1; 2 is required
These 3 tests fail because they do use a (very long) multi-line git config:
[branch "b4/pytest"]
b4-prep-cover-strategy = branch-description
description = "EDITME: cover title for pytest\n\n# Describe the pur...
^^^^
As found with "uv run pytest --pdb", they crash exactly where the fix is.
Unfortunately, this fix is part of git_filter_repo.py version... 2.48 which
is not released yet!?
https://pypi.org/project/git-filter-repo/#history
So what really baffles me is: how come no one else noticed this before?
Maybe some recent change in the default "git config --list" output
format? Reproduced with git --version 2.51 and today's b4 509f56ff5c24
in case that matters.
PS: if some `uv` expert knows how to hack the uv configuration to use a
local git_filter_repo version in the virtual environment, by all
means please share.
https://github.com/newren/git-filter-repo/commit/4697eeb37b7c3c30b
--- ./.venv/lib/python3.13/site-packages/git_filter_repo.py
+++ ./.venv/lib/python3.13/site-packages/git_filter_repo.py
@@ -1683,14 +1683,14 @@
def get_config_settings(repo_working_dir):
output = ''
try:
- output = subproc.check_output('git config --list'.split(),
+ output = subproc.check_output('git config --list --null'.split(),
cwd=repo_working_dir)
except subprocess.CalledProcessError as e: # pragma: no cover
raise SystemExit('fatal: {}'.format(e))
# FIXME: Ignores multi-valued keys, just let them overwrite for now
- return dict(line.split(b'=', maxsplit=1)
- for line in output.strip().split(b"\n"))
+ return dict(item.split(b'\n', maxsplit=1)
+ for item in output.strip().split(b"\0") if item)
@staticmethod
def get_blob_sizes(quiet = False):
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Unreleased, multi-lines git_filter_repo fix required to run b4 tests?
2025-10-31 3:49 Unreleased, multi-lines git_filter_repo fix required to run b4 tests? Marc Herbert
@ 2025-10-31 14:00 ` Konstantin Ryabitsev
2025-11-01 3:28 ` Marc Herbert
0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ryabitsev @ 2025-10-31 14:00 UTC (permalink / raw)
To: Marc Herbert; +Cc: tools
On Thu, Oct 30, 2025 at 08:49:01PM -0700, Marc Herbert wrote:
> So what really baffles me is: how come no one else noticed this before?
They have -- it's a recurring problem for packagers. I've been prodding
git-filter-repo to release a fixed version -- if more people tell them about
it, maybe this will actually happen?
This bug doesn't really affect real usage of b4, because this only manifests
itself when someone sets the cover letter strategy to use git branch
descriptions (which is what tests do).
-K
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Unreleased, multi-lines git_filter_repo fix required to run b4 tests?
2025-10-31 14:00 ` Konstantin Ryabitsev
@ 2025-11-01 3:28 ` Marc Herbert
0 siblings, 0 replies; 3+ messages in thread
From: Marc Herbert @ 2025-11-01 3:28 UTC (permalink / raw)
To: Konstantin Ryabitsev; +Cc: tools
Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
> On Thu, Oct 30, 2025 at 08:49:01PM -0700, Marc Herbert wrote:
>> So what really baffles me is: how come no one else noticed this before?
>
> They have -- it's a recurring problem for packagers.
Ha, then I was searching in the wrong place: here.
But wait... only packagers run tests? Not the people submitting b4
changes on this list!?
The "xfail" patch I just submitted should be enough to please packagers.
> I've been prodding git-filter-repo to release a fixed version -- if
> more people tell them about it, maybe this will actually happen?
Not sure what is a good stick there but for sure my xfail patch and the
corresponding effort should provide strong, additional evidence of how
painful this has been - whether you merge it or not. So... I've done my
share? :-)
> This bug doesn't really affect real usage of b4, because this only manifests
> itself when someone sets the cover letter strategy to use git branch
> descriptions (which is what tests do).
Good to know, thx.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-01 3:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 3:49 Unreleased, multi-lines git_filter_repo fix required to run b4 tests? Marc Herbert
2025-10-31 14:00 ` Konstantin Ryabitsev
2025-11-01 3:28 ` Marc Herbert
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).