Re: [PATCH 0/6] more automation for cover letter generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 &&
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]