tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* 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

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).