Skip to contentSkip to conversation

Create patches with --default-prefix

PATCH Applied Matt Johnston 2 participants 2 messages Oct 19, 2024 – Jan 22, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Create patches with --default-prefix

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

---
 src/b4/__init__.py | 1 +
 1 file changed, 1 insertion(+)
src/b4/__init__.py +1 -0
index 5115a9cd9b8746f84eb104a2be69fe121724167e..7ecff36005149300d8ae716a3d4a7da813a01b51 100644
@@ -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,

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

Best regards,

Signature · 1 line
Matt Johnston <[email protected]>
#1 lore raw
Quoted 8 lines · Matt Johnston

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

[...]

Applied, thanks!

[1/1] Create patches with --default-prefix

      commit: 71916edb52594131affa0402f89722d33d8ab90f

Best regards,

Signature · 1 line
Konstantin Ryabitsev <[email protected]>