Patch works
Do some tests before sending the patch to the community
- selftest and kvm unit test should be tested when submitting patch.
- queue is not the finish, upstream is.
Add name when sending email;
记着写那些东西?
- commit message 记着带上 sign-off-by,co-authored-by 等等;
- 生成 from 那一行。
Commit with author
you can commit with author
git commit --author="Author Name <email@address.com>"
or change a commit's author
git commit --amend --author="Author Name <email@address.com>"
Patch writing issue
Please note that several maintainers dislike using "we". This change is headed to the x86 area where maintainers specifically documented that changelogs should not impersonate code (see "Changelog" section of Documentation/process/maintainer-tip.rst).
Avoid using "this patch".
If it is a refactor code, you can add "No functional change intended" in the end of line.
Signed-off-by, Co-Developed-by, Reviewed-by
A Co-Developed-by: states that the patch was also created by another developer along with the original author. This is useful at times when multiple people work on a single patch. Note, this person also needs to have a Signed-off-by: line in the patch as well.
Reported-by
如果这个 bug 是有人提出来的,那么可以加一个 Reported-by。
根据这个 [PATCH] media: make RADIO_ADAPTERS tristate - Randy Dunlap 例子,它放在了 Signed-off-by 后面。
From:
From 后面的是这个 patch 的 author。
所谓 patch 的 author 指的就是:谁最早写的就是谁,如果有对他有一些修改可以加 co-developed-by,如果不是 code 完全不一样,一般 author 就不会去改了。
下面讨论的是 Example of a patch submitted by the From: author: 的情况:
<changelog>
Co-developed-by: First Co-Author <first@coauthor.example.org>
Signed-off-by: First Co-Author <first@coauthor.example.org>
Co-developed-by: Second Co-Author <second@coauthor.example.org>
Signed-off-by: Second Co-Author <second@coauthor.example.org>
Signed-off-by: From Author <from@author.example.org>
下面讨论的是 Example of a patch submitted by a Co-developed-by: author 的情况:
From: From Author <from@author.example.org>
<changelog>
Co-developed-by: Random Co-Author <random@coauthor.example.org>
Signed-off-by: Random Co-Author <random@coauthor.example.org>
Signed-off-by: From Author <from@author.example.org>
Co-developed-by: Submitting Co-Author <sub@coauthor.example.org>
Signed-off-by: Submitting Co-Author <sub@coauthor.example.org>
以上例子中,第一行的 From 是 git send-email 自动生成的(A from
line specifying the patch author, followed by an empty line (only needed if the person sending the patch is not the author,注意是 sending,不需要必须是 codeveloper).),第二个 From 是需要自己去写的。
这是一个例子:[PATCH V3] csky: Add C based string functions - guoren
submitted
这个就是邮件的发件人。
Patch Sending Process
git format-patch
git format-patch --cover-letter -o ~/patches --from -v 8 a5b6ca90bd2a53b90fcc30642ebbe76ad5e242f9^..f57d87b43305d5b6209f6cbc53f6774e59d44098
git format-patch -o ~/patches --from 571824f7c8^..2971342420
or if you already have **cover-letter**:
```bash
git format-patch -o ~/patches --from -v 8 0267eb5b8f0d^..56204bcd32b9
if only one commit and one patch:
git format-patch -o ~/patches --from -1 commit
checkpatch.pl
Checkpatch — The Linux Kernel documentation
Optional: get_maintainer.pl
perl scripts/get_maintainer.pl <patch>
linux/get_maintainer.pl at master · torvalds/linux
git send-email
for testing:
git send-email --to=yuan.yao@intel.com,xiaoyao.li@intel.com --cc=lei4.wang@intel.com --suppress-cc=all --thread ~/patches
git send-email --to="Paolo Bonzini <pbonzini@redhat.com>","Marcelo Tosatti <mtosatti@redhat.com>","Xin Li <xin3.li@intel.com>" --cc=qemu-devel@nongnu.org,kvm@vger.kernel.org,"Lei Wang <lei4.wang@intel.com>" --suppress-cc=all ~/fix/0001-target-i386-Raise-the-highest-index-value-used-for-a.patch
git send-email --to=lei4.wang@intel.com --suppress-cc=all ~/fix/0001-target-i386-Raise-the-highest-index-value-used-for-a.patch
SPR CPU model
git send-email --to=pbonzini@redhat.com --cc=qemu-devel@nongnu.org,imammedo@redhat.com,dgilbert@redhat.com,berrange@redhat.com,xiaoyao.li@intel.com,yang.zhong@linux.intel.com,lei4.wang@intel.com --suppress-cc=all --thread --dry-run ~/patches/
git send-email --to=qemu-devel@nongnu.org --cc=quintela@redhat.com,peterx@redhat.com,leobras@redhat.com,wei.w.wang@intel.com,lei4.wang@intel.com --suppress-cc=all --dry-run ~/patches/0001-multifd-Set-a-higher-backlog-default-value-for-liste.patch