Git development
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Glen Choo <chooglen@google.com>,
	Bagas Sanjaya <bagasdotme@gmail.com>
Subject: [PATCH v3] Documentation: specify base point when generating MyFirstContribution patchset
Date: Mon, 18 Oct 2021 19:41:06 +0700	[thread overview]
Message-ID: <20211018124106.542050-1-bagasdotme@gmail.com> (raw)

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


             reply	other threads:[~2021-10-18 12:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 12:41 Bagas Sanjaya [this message]
2021-10-18 17:09 ` [PATCH v3] Documentation: specify base point when generating MyFirstContribution patchset Junio C Hamano
2021-10-18 17:32   ` Glen Choo
2021-10-18 20:08     ` Re* " Junio C Hamano
2021-10-19  4:36       ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211018124106.542050-1-bagasdotme@gmail.com \
    --to=bagasdotme@gmail.com \
    --cc=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox