git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 1/2] format-patch: document and test --reroll-count
Date: Wed,  2 Jan 2013 14:42:04 -0800	[thread overview]
Message-ID: <1357166525-12188-1-git-send-email-gitster@pobox.com> (raw)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * This comes on top of the 7 patches that have been cooking on 'pu'
   (http://thread.gmane.org/gmane.comp.version-control.git/212036),
   and I am planning to squash this to 7/7 that adds --reroll-count
   option to the code.  This is sent as a separate patch to keep
   reviewing easier.

 Documentation/git-format-patch.txt | 10 +++++++++-
 t/t4014-format-patch.sh            |  8 ++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 6d43f56..736d8bf 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -18,7 +18,7 @@ SYNOPSIS
 		   [--start-number <n>] [--numbered-files]
 		   [--in-reply-to=Message-Id] [--suffix=.<sfx>]
 		   [--ignore-if-in-upstream]
-		   [--subject-prefix=Subject-Prefix]
+		   [--subject-prefix=Subject-Prefix] [--reroll-count <n>]
 		   [--to=<email>] [--cc=<email>]
 		   [--cover-letter] [--quiet]
 		   [<common diff options>]
@@ -166,6 +166,14 @@ will want to ensure that threading is disabled for `git send-email`.
 	allows for useful naming of a patch series, and can be
 	combined with the `--numbered` option.
 
+--reroll-count=<n>::
+	Mark the series as the <n>-th iteration of the topic. The
+	output filenames have `v<n>` pretended to them, and the
+	subject prefix ("PATCH" by default, but configurable via the
+	`--subject-prefix` option) has ` v<n>` appended to it.  E.g.
+	`--reroll-count=4` may produce `v4-0001-add-makefile.patch`
+	file that has "Subject: [PATCH v4 1/20] Add makefile" in it.
+
 --to=<email>::
 	Add a `To:` header to the email headers. This is in addition
 	to any configured headers, and may be used multiple times.
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 959aa26..0ff9958 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -237,6 +237,14 @@ test_expect_success 'multiple files' '
 	ls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
 '
 
+test_expect_success 'reroll count' '
+	rm -fr patches &&
+	git format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&
+	! grep -v "^patches/v4-000[0-3]-" list &&
+	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
+	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
+'
+
 check_threading () {
 	expect="$1" &&
 	shift &&
-- 
1.8.0.9.g5e84801

             reply	other threads:[~2013-01-02 22:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-02 22:42 Junio C Hamano [this message]
2013-01-02 22:42 ` [PATCH 2/2] format-patch: give --reroll-count a short synonym -v Junio C Hamano
2013-01-03 23:21   ` Philip Oakley
2013-01-04  0:00     ` Junio C Hamano
2013-01-04  1:28       ` Junio C Hamano

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=1357166525-12188-1-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).