Home | Index | Back | Next |
---|
To see how to use git send-email
, visit here.
Note: Anything wirtten after #
is a comment. Even, terminal commands written after it are also comments. This may be used to display outputs in code blocks or to explain the usage of a commnd, in this case the output in your terminal will obviously will not contain #
, it is just for presentation.
Normally, when we create patch, for example
git format-patch -2
It means to create patches of last two commits. Here,
- [PATCH 1/2] - Means second last commit.
- [PATCH 2/2] - Means last commit.
But when we use --cover-letter
option, it creates:
- [PATCH 0/2] - For Cover Letter.
To create patch series with a cover letter. For ex:
git format-patch -3 -v2 --cover-letter -o ~/development/PATCH/linux
Thus three files will be created inside
~/development/PATCH/linux
.
ls
# v2-0000-cover-letter.patch
# v2-0001-pcnet32-Convert-to-generic-power-management.patch
# v2-0002-amd8111e-Convert-to-generic-power-management.patch
# v2-0003-amd-xgbe-Convert-to-generic-power-management.patch
The cover letter looks like this:
vim v2-0000-cover-letter.patch
# From 5292d5c4bd0acb101dd2c2b47e131cc8650bb59c Mon Sep 17 00:00:00 2001
# From: Vaibhav Gupta <[email protected]>
# Date: Mon, 22 Jun 2020 16:32:53 +0530
# Subject: [PATCH v2 0/3] *** SUBJECT HERE ***
#
# *** BLURB HERE ***
#
# Vaibhav Gupta (3):
# pcnet32: Conver.....
You can edit the Cover letter there. You can also include "To:" and "CC:" in the cover letter, so you don't have to mention it in commandline while sending them. For ex:
# From 5292d5c4bd0acb101dd2c2b47e131cc8650bb59c Mon Sep 17 00:00:00 2001
# From: Vaibhav Gupta <[email protected]>
# To: Bjorn Helgaas <[email protected]>
# To: "David S. Miller" <[email protected]>
# Cc: [email protected]
# Cc: [email protected]
# Date: Mon, 22 Jun 2020 16:32:53 +0530
# Subject: [PATCH v2 0/3] ethernet: amd: Convert to generic power management
# Linux Kernel
git send-email --to-cover --cc-cover ~/development/PATCH/linux/*.patch
Now, when I edited cover letter, I included 'To :' and 'Cc :' in it.
-
--to-cover
: If this is set, emails found in To: headers in the first patch of the series (typically the cover letter) are added to the to list for each email set. -
--cc-cover
: If this is set, emails found in Cc: headers in the first patch of the series (typically the cover letter) are added to the cc list for each email set.
To create patch series with a cover letter. For ex:
git send-email -2 -v1 --cover-letter --to="[email protected]" --cc="[email protected]"
But this throws error:
# Refusing to send because the patch
# /tmp/ffNzhikwdO/v1-0000-cover-letter.patch
# has the template subject '*** SUBJECT HERE ***'. Pass --force if you really want to send.
So, use --force
option.
git send-email -2 -v1 --cover-letter --to="[email protected]" --cc="[email protected]" --force
It will ask for various options before sending it. Enter e
to edit the cover letter.
The editing of cover letter is similar as it was done in 1.