Upstream Patch with Git
Send patch using git send-email and msmtp
- msmtp setup and config (using intel.com as example)
$ apt-get install msmtp
$ cat ~/.msmtprc
defaults
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
account intel
host smtp.intel.com
port 25
protocol smtp
auth off
from {username}@intel.com
tls off
account default: intel
$ git config --global sendemail.smtpencryption tls
$ git config --global sendemail.confirm auto
$ cat ~/.gitconfig
[user]
email = {email}
name = {name}
[sendemail]
from = {name} <{email}>
smtpuser =
smtpserver = "/usr/bin/msmtp"
smtpencryption = tls
chainreplyto = false
confirm = auto
- get a list of maintainers and mailing list
$ ./scripts/get_maintainer.pl /path/to/patch
$ git send-email -to="xxx" -cc="yyy" -cc="zzz" /path/to/patch
Amend and Resend patch
- We usually use [PATCH vN] to indicate the amended patch is the Nth version.
git format-patch
has an option -v
to add the version number.
- Besides,
git format-patch
has an option -s
to add the S-o-b
(Signed-off-by)
- The changelog is usually not included in the commit message. Only the last version patch will be committed to the repo, so the changelog in commit message does not make much sense. It is used to ease reviewer's work. You can move the changelog to a section between
S-o-b
and diff
.
...commit message...
[Signed-off-by]
---
Changes since v1:
* ...
* ...
---
...diff info...