git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	Frank Terbeck <ft@bewatermyfriend.org>
Subject: [PATCH v2 3/4] Add tests for coverauto, coverletter and --cover-letter
Date: Mon,  4 May 2009 11:59:01 +0200	[thread overview]
Message-ID: <1241431142-8444-4-git-send-email-ft@bewatermyfriend.org> (raw)
In-Reply-To: <7v8wlxx18c.fsf@gitster.siamese.dyndns.org>

Very much based on Jeff King's suggestion from
<20090421033213.GA14881@coredump.intra.peff.net>

This change also makes sure that one major user of --stdout
(git-rebase.sh) works with format.coverauto set to true.

Signed-off-by: Frank Terbeck <ft@bewatermyfriend.org>
---
 t/t3400-rebase.sh       |    1 +
 t/t4014-format-patch.sh |   58 +++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 6e391a3..48d8360 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -15,6 +15,7 @@ export GIT_AUTHOR_EMAIL
 test_expect_success \
     'prepare repository with topic branches' \
     'git config core.logAllRefUpdates true &&
+     git config format.coverauto true &&
      echo First > A &&
      git update-index --add A &&
      git commit -m "Add A." &&
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 11061dd..3f431ff 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -151,6 +151,60 @@ 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 '--cover-letter generates cover letter' '
+
+	rm -rf patches &&
+	git config format.coverletter 1
+	git format-patch --cover-letter -o patches/ master &&
+	test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success 'format.coverletter=number > 1 generates cover letter' '
+
+	rm -rf patches &&
+	git config format.coverletter 3 &&
+	git format-patch --cover-letter -o patches/ master &&
+	test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success 'format.coverletter respects minimum patchset size' '
+
+	rm -rf patches &&
+	git config format.coverletter 4 &&
+	git format-patch --cover-letter -o patches/ master &&
+	! test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success '--cover-letter=never disables cover letters' '
+
+	rm -rf patches &&
+	git config format.coverletter 2 &&
+	git format-patch --cover-letter=never -o patches/ master &&
+	! test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success '--cover-letter=always forces cover letters' '
+
+	rm -rf patches &&
+	git format-patch --cover-letter=always -o patches/ master &&
+	test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success 'format.coverauto works (1)' '
+
+	rm -rf patches &&
+	git config format.coverauto true &&
+	git format-patch -1 -o patches/ master &&
+	! test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success 'format.coverauto works (2)' '
+
+	rm -rf patches &&
+	git format-patch -2 -o patches/ master &&
+	test -f patches/0000-cover-letter.patch
+'
+
 check_threading () {
 	expect="$1" &&
 	shift &&
@@ -405,9 +459,9 @@ test_expect_success 'cover-letter inherits diff options' '
 
 	git mv file foo &&
 	git commit -m foo &&
-	git format-patch --cover-letter -1 &&
+	git format-patch --cover-letter=always -1 &&
 	! grep "file => foo .* 0 *$" 0000-cover-letter.patch &&
-	git format-patch --cover-letter -1 -M &&
+	git format-patch --cover-letter=always -1 -M &&
 	grep "file => foo .* 0 *$" 0000-cover-letter.patch
 
 '
-- 
1.6.2.2.446.gfbdc0

  parent reply	other threads:[~2009-05-04  9:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-18 16:16 [PATCH 0/6] more automation for cover letter generation Frank Terbeck
2009-04-18 16:16 ` [PATCH 1/6] format-patch: add cover{letter,onepatch} options Frank Terbeck
2009-04-18 16:16 ` [PATCH 2/6] Add documentation for format-patch's --cover-one-patch Frank Terbeck
2009-04-18 16:16 ` [PATCH 3/6] Document format.coverletter and format.coveronepatch Frank Terbeck
2009-04-18 16:16 ` [PATCH 4/6] format-patch: introduce overwritecoverletter option Frank Terbeck
2009-04-18 16:16 ` [PATCH 5/6] Add documentation for --cover-overwrite Frank Terbeck
2009-04-18 16:16 ` [PATCH 6/6] Document format.overwritecoverletter Frank Terbeck
2009-04-18 18:31 ` [PATCH 0/6] more automation for cover letter generation Junio C Hamano
2009-05-04  9:58   ` [PATCH v2 0/4] " Frank Terbeck
2009-05-04  9:58   ` [PATCH v2 1/4] Add format.coverletter option Frank Terbeck
2009-05-04  9:59   ` [PATCH v2 2/4] Add format.coverauto boolean Frank Terbeck
2009-05-04 18:39     ` Stephen Boyd
2009-05-04 21:41       ` Frank Terbeck
2009-05-04 23:20     ` Junio C Hamano
2009-05-05  8:49       ` Frank Terbeck
2009-05-05 10:41         ` Junio C Hamano
2009-05-05 13:29           ` Frank Terbeck
2009-05-05 15:23             ` Frank Terbeck
2009-05-04  9:59   ` Frank Terbeck [this message]
2009-05-04  9:59   ` [PATCH v2 4/4] Documentation for format.coverletter and --cover-letter Frank Terbeck
2009-04-21  3:32 ` [PATCH 0/6] more automation for cover letter generation Jeff King

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=1241431142-8444-4-git-send-email-ft@bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).