All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Frank Terbeck <ft@bewatermyfriend.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/6] more automation for cover letter generation
Date: Mon, 20 Apr 2009 23:32:13 -0400	[thread overview]
Message-ID: <20090421033213.GA14881@coredump.intra.peff.net> (raw)
In-Reply-To: <1240071381-25165-1-git-send-email-ft@bewatermyfriend.org>

On Sat, Apr 18, 2009 at 06:16:15PM +0200, Frank Terbeck wrote:

> I like cover letters, in fact I like them enough to always want
> --cover-letter to format-patch. The problem with that are patch "series"
> that are only one patch long, where a cover letter would feel silly.
> 
> For now, I solved that by using a shell function that wrapped around
> format-patch and did the trick for me.
> 
> With this series, format-patch can do it and do it better than my
> wrapper could.

That seems like a reasonable goal.

> The following setup would suit me pretty well:
> 
> [format]
>     coverletter = true
>     coveronepatch = false
>     overwritecoverletter = false

Something about "coveronepatch" seems a bit hack-ish to me. Perhaps it
should be "generate cover letter if there are more than N patches". You
could even just overload "format.coverletter" as:

  true - always generate cover letter
  false - never generate cover letter
  <number> - generate if there are at least <number> patches

?

> The series is based on master and doesn't seem to break anything
> within the test suite. It could maybe use own tests, but I must admit
> that I didn't look too closely at how git's test suite works and where
> to put in tests for this.

The tests below were not actually run (and you can see they are based on
what I proposed above, not your existing patches), but they should give
hopefully give you a headstart.

---
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 11061dd..9e13ee9 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -151,6 +151,27 @@ 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 'format.coverletter=true generates cover letter' '
+	rm -rf patches &&
+	git config core.coverletter true
+	git format-patch -o patches/ master &&
+	test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success 'format.coverletter=number generates cover letter' '
+	rm -rf patches &&
+	git config core.coverletter 3 &&
+	git format-patch -o patches/ master &&
+	test -f patches/0000-cover-letter.patch
+'
+
+test_expect_success 'format.coverletter respects minimum patchset size' '
+	rm -rf patches &&
+	git config core.coverletter 4 &&
+	git format-patch -o patches/ master &&
+	! test -f patches/0000-cover-letter.patch
+'
+
 check_threading () {
 	expect="$1" &&
 	shift &&

      parent reply	other threads:[~2009-04-21  3:33 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   ` [PATCH v2 3/4] Add tests for coverauto, coverletter and --cover-letter Frank Terbeck
2009-05-04  9:59   ` [PATCH v2 4/4] Documentation for format.coverletter " Frank Terbeck
2009-04-21  3:32 ` Jeff King [this message]

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=20090421033213.GA14881@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=ft@bewatermyfriend.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.