Skip to contentSkip to conversation

Ensure patches show moves rather than add/delete

PATCH In review Rob Herring (Arm) 3 participants 3 messages Dec 17, 2024 – Jan 22, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Ensure patches show moves rather than add/delete

Don't rely of users' gitconfig when generating patches with a move. The default now for gitconfig is this is enabled, but I'm pretty sure it used to be disabled by default. In any case, users mess with long time defaults like threading for no good reason.

---
Maybe we want -C and -B too? Those don't happen too often compared to moves.

---
 src/b4/__init__.py | 1 +
 1 file changed, 1 insertion(+)
src/b4/__init__.py +1 -0
index bb93656d8ad7..a63520792df5 100644
@@ -3464,6 +3464,7 @@ def git_range_to_patches(gitdir: Optional[str], start: str, end: str,
             gitdir,
             [
                 'show',
+                '-M',
                 '--format=email',
                 '--full-index',
                 '--binary',
Signature · 1 line
2.45.2
#1 lore raw
Quoted 17 lines · Rob Herring (Arm)

Don't rely of users' gitconfig when generating patches with a move. The default now for gitconfig is this is enabled, but I'm pretty sure it used to be disabled by default. In any case, users mess with long time defaults like threading for no good reason.

---
Maybe we want -C and -B too? Those don't happen too often compared to moves.

---
 src/b4/__init__.py | 1 +
 1 file changed, 1 insertion(+)
src/b4/__init__.py +0 -0
index bb93656d8ad7..a63520792df5 100644

src/b4/__init__.py def git_range_to_patches(gitdir: Optional[str], start: str, end: str, · line 3467

Quoted 4 lines
src/b4/__init__.py +1 -0
@@ -3464,6 +3464,7 @@ def git_range_to_patches(gitdir: Optional[str], start: str, end: str,
             gitdir,
             [
                 'show',
+                '-M',

I think for consistency with the other options it would be better to use the long form "--find-renames" here.

Quoted 5 lines
src/b4/__init__.py +0 -0
                 '--format=email',
                 '--full-index',
                 '--binary',
Signature · 1 line
2.45.2
#2 lore raw
Quoted 4 lines · Christian Heusel
Quoted 4 lines
src/b4/__init__.py +0 -0
index bb93656d8ad7..a63520792df5 100644
Quoted 8 lines

src/b4/__init__.py def git_range_to_patches(gitdir: Optional[str], start: str, end: str, · line 3467

Quoted 5 lines
src/b4/__init__.py +1 -0
@@ -3464,6 +3464,7 @@ def git_range_to_patches(gitdir: Optional[str], start: str, end: str,
             gitdir,
             [
                 'show',
+                '-M',

I think for consistency with the other options it would be better to use the long form "--find-renames" here.

I didn't take this patch directly, since that code has already changed a bit, but I gave you both credit.

https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=764bbf5525f4894c5482753ed73a19dbbd7a2564

-K