git: add realName inside From field

We currently have no way of specifying the sender's name inside the
From field, making a patch sent through `git send-email` appear as
coming from "xxx@domain.com".

In this commit we make this field follow the standard

    realName <email>

format.
This commit is contained in:
Léo DUBOIN 2024-05-06 08:17:53 +02:00 committed by GitHub
parent 3dfe05aa9b
commit 2b87a11125
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 10 deletions

View file

@ -7,6 +7,7 @@ with lib;
config = {
accounts.email.accounts."hm@example.com".msmtp.enable = true;
programs.git = {
enable = true;
package = pkgs.gitMinimal;
@ -33,8 +34,8 @@ with lib;
assertFileContent home-files/.config/git/config \
${./git-with-msmtp-expected.conf}
assertGitConfig "sendemail.hm@example.com.from" "hm@example.com"
assertGitConfig "sendemail.hm-account.from" "hm@example.org"
assertGitConfig "sendemail.hm@example.com.from" "H. M. Test <hm@example.com>"
assertGitConfig "sendemail.hm-account.from" "H. M. Test Jr. <hm@example.org>"
assertGitConfig "sendemail.hm@example.com.smtpServer" "${pkgs.msmtp}/bin/msmtp"
assertGitConfig "sendemail.hm@example.com.envelopeSender" "auto"
'';