diff mbox series

[b4] Create patches with --default-prefix

Message ID 20241019-pr-diff-prefix-v1-1-435e6c256e2f@codeconstruct.com.au (mailing list archive)
State New
Headers show
Series [b4] Create patches with --default-prefix | expand

Commit Message

Matt Johnston Oct. 19, 2024, 3:44 a.m. UTC
This matches the behaviour of `git format-patch` to ignore diff.noprefix
config (added in git 2.41.0 [1]). Otherwise b4 generated patches will
be missing the top level a/ b/ prefix when diff.noprefix config is set.

[1] https://github.com/git/git/commit/c169af8f7ab521cc47b59f104db78847e324a3cb

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
---
 src/b4/__init__.py | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: 2a6338e451a0c1e81f214f48c820c1e52d76b2f1
change-id: 20241019-pr-diff-prefix-bc3dff956a20

Best regards,
diff mbox series

Patch

diff --git a/src/b4/__init__.py b/src/b4/__init__.py
index 5115a9cd9b8746f84eb104a2be69fe121724167e..7ecff36005149300d8ae716a3d4a7da813a01b51 100644
--- a/src/b4/__init__.py
+++ b/src/b4/__init__.py
@@ -3469,6 +3469,7 @@  def git_range_to_patches(gitdir: Optional[str], start: str, end: str,
                 '--binary',
                 '--patch-with-stat',
                 '--encoding=utf-8',
+                '--default-prefix',
                 commit,
             ],
             decode=False,