git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3] Documentation: specify base point when generating MyFirstContribution patchset

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Oct 18, 2021, 12:41 UTC
Message-ID
<20211018124106.542050-1-bagasdotme@gmail.com>

Specifying base point (commit hash) can help reviewers and testers interested on the patchset. Mention how to record it with `--base` option to `format-patch`.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
---
 Changes since v3 [1]:
     - rewording (suggested by Glen)
 I don't apply Junio's suggestion that use `--base=auto`, because in
 most cases invocations of the option requires full hash of base object
 and AFAIK people just do `git checkout -b` without specifying the
 tracking option (`-t`).
 [1]: https://lore.kernel.org/git/xmqqo87q6whk.fsf@gitster.g/T/#t
 Documentation/MyFirstContribution.txt | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
index b20bc8e914..1c4cd092ee 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -902,10 +902,19 @@ is out of scope for the context of this tutorial.
 === Preparing Initial Patchset
 
 Sending emails with Git is a two-part process; before you can prepare the emails
-themselves, you'll need to prepare the patches. Luckily, this is pretty simple:
+themselves, you'll need to prepare the patches. Luckily, this is pretty simple.
+First, we need to get hash of the commit the patchset is based on. We call
+this commit the `<base>`:
 
 ----
-$ git format-patch --cover-letter -o psuh/ master..psuh
+$ git show -s --format="%H" master
+----
+
+Now generate the patchset, passing the hash of `<base>` to the `--base`
+parameter:
+
+----
+$ git format-patch --cover-letter --base=<base> -o psuh/ master..psuh
 ----
 
 The `--cover-letter` parameter tells `format-patch` to create a cover letter
@@ -916,6 +925,10 @@ The `-o psuh/` parameter tells `format-patch` to place the patch files into a
 directory. This is useful because `git send-email` can take a directory and
 send out all the patches from there.
 
+The `--base=<base>` parameter tells `format-patch` to embed base commit
+hash to the cover letter. Reviewers and testers interested in the patchset
+can create branch based on the specifed base commit in order to apply it.
+
 `master..psuh` tells `format-patch` to generate patches for the difference
 between `master` and `psuh`. It will make one patch file per commit. After you
 run, you can go have a look at each of the patches with your favorite text
@@ -1046,7 +1059,7 @@ reviewer comments. Once the patch series is ready for submission, generate your
 patches again, but with some new flags:
 
 ----
-$ git format-patch -v2 --cover-letter -o psuh/ --range-diff master..psuh-v1 master..
+$ git format-patch -v2 --cover-letter -o psuh/ --base=<base> --range-diff master..psuh-v1 master..
 ----
 
 The `--range-diff master..psuh-v1` parameter tells `format-patch` to include a

base-commit: f443b226ca681d87a3a31e245a70e6bc2769123c
-- 
An old man doll... just what I always wanted! - Clara
Next: Junio C Hamano
Message 1 of 5 in “Documentation: specify base point when generating MyFirstContribution patchset”
  1. Documentation: specify base point when generating MyFirstContribution patchsetBagas Sanjaya, Oct 18, 2021
  2. Junio C HamanoOct 18, 2021
  3. Glen ChooOct 18, 2021
  4. Re* [PATCH v3] Documentation: specify base point when generating MyFirstContribution patchsetJunio C Hamano, Oct 18, 2021
  5. Eric SunshineOct 19, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.