diff mbox series

[b4,v2] send: generate patches with --no-mailmap

Message ID 20240923-send-mailmap-v2-1-e2c62f1de79b@kernel.org (mailing list archive)
State New
Headers show
Series [b4,v2] send: generate patches with --no-mailmap | expand

Commit Message

Matthieu Baerts (NGI0) Sept. 23, 2024, 4:04 p.m. UTC
b4 uses 'git show' to generate patches. By default, this command will
use the mailmap file to convert author and committer names and email
addresses if there is a match.

That's good to display the last identity when looking at old commits in
the history, but it doesn't sound like a good idea when sending patches.
'git format-patch' doesn't use the mailmap file, it currently doesn't
even support it, and it is not planned to support it apparently [1].
Note that 'git send-email' might support a new '--mailmap' option, but
it looks like this option will not be enabled by default [2].

In my case, I had to send some patches, including one from someone else
who has to use the email address from his company, but has an entry in
the mailmap file to his @kernel.org email address. When I sent his
patch, b4 seamlessly converted his email address, and caused checkpatch
to complain, because the From and the SoB entries were different.

Here, we ensure the conversion is not done, to avoid any surprise once
the emails are sent.

Link: https://lore.kernel.org/all/20240813-jk-support-mailmap-git-format-patch-v1-1-1aea690ea5dd@gmail.com/ [1]
Link: https://lore.kernel.org/all/20240827-jk-send-email-mailmap-support-v3-0-bec5ba9be391@gmail.com/ [2]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Changes in v2:
- Rebased and resolved conflicts.
- Link to v1: https://patch.msgid.link/20240820-send-mailmap-v1-1-7f35789be4b1@kernel.org
---
 src/b4/__init__.py | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: dedf88cb947bab87c418b49d975df11f83621692
change-id: 20240820-send-mailmap-ef8ba398450f

Best regards,
diff mbox series

Patch

diff --git a/src/b4/__init__.py b/src/b4/__init__.py
index 811bbcaf028d78224242433eac9fdbeb03a306b3..a650d114bcc1d0fb534fda3735101458062a8386 100644
--- a/src/b4/__init__.py
+++ b/src/b4/__init__.py
@@ -3463,6 +3463,7 @@  def git_range_to_patches(gitdir: Optional[str], start: str, end: str,
                 '--binary',
                 '--patch-with-stat',
                 '--encoding=utf-8',
+                '--no-mailmap',
                 commit,
             ],
             decode=False,