Git development
 help / color / mirror / Atom feed
* [PATCH 1/2] t9001-send-email: create a function replacing variable fields
@ 2015-06-01 14:14 Remi Lespinet
  2015-06-01 14:14 ` [PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc Remi Lespinet
  0 siblings, 1 reply; 7+ messages in thread
From: Remi Lespinet @ 2015-06-01 14:14 UTC (permalink / raw)
  To: git
  Cc: Remi Galan, Remi Lespinet, Guillaume Pages,
	Louis-Alexandre Stuber, Antoine Delaite, Matthieu Moy

Create a function which replaces Date, Message-Id and
X-Mailer lines generated by git-send-email by a specific string

Date:.*$       -> Date: DATE-STRING
Message-Id:.*$ -> Message-Id: MESSAGE-ID-STRING
X-Mailer:.*$   -> X-Mailer: X-MAILER-STRING

This is a preparatory for the next commit which uses this
function

Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
---
 t/t9001-send-email.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index a3663da..71968ee 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -519,6 +519,12 @@ Result: OK
 EOF
 "
 
+replace_variable_fields () {
+	sed	-e "s/^\(Date:\).*/\1 DATE-STRING/" \
+		-e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
+		-e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/"
+}
+
 test_suppression () {
 	git send-email \
 		--dry-run \
@@ -526,10 +532,7 @@ test_suppression () {
 		--from="Example <from@example.com>" \
 		--to=to@example.com \
 		--smtp-server relay.example.com \
-		$patches |
-	sed	-e "s/^\(Date:\).*/\1 DATE-STRING/" \
-		-e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
-		-e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \
+		$patches | replace_variable_fields \
 		>actual-suppress-$1${2+"-$2"} &&
 	test_cmp expected-suppress-$1${2+"-$2"} actual-suppress-$1${2+"-$2"}
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-06-02 17:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 14:14 [PATCH 1/2] t9001-send-email: create a function replacing variable fields Remi Lespinet
2015-06-01 14:14 ` [PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc Remi Lespinet
2015-06-01 15:12   ` Matthieu Moy
2015-06-01 15:19   ` Junio C Hamano
2015-06-01 16:52     ` Junio C Hamano
2015-06-02  8:26       ` Rémi Lespinet
2015-06-02 17:19         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox