diff mbox series

[v2,2/3] t9001-send-email.sh: update alias list used for pine test

Message ID 20240813-jk-translate-alias-send-email-v2-2-912db4eb6846@gmail.com (mailing list archive)
State Accepted
Commit bbc04b0094621bdd6d1e60c1cd96c64d916d3339
Headers show
Series send-email: teach git send-email mode to translate aliases | expand

Commit Message

Jacob Keller Aug. 14, 2024, 12:05 a.m. UTC
From: Jacob Keller <jacob.keller@gmail.com>

The set of aliases used for the pine --dump-aliases test do not
perfectly mesh with the way the pine address book is defined. While
technically all valid, there are some oddities including bob's name
being partially split so that the actual address is returned as
"Bobbyton <bob@example.com". A strict reading of the pine documentation
indicates that the address should either be of the form
"address@domain" or a comma separated list of address, name/address
pairs, or other aliases enclosed by ().

The parsing implementation in git-send-email is not as strict, but it
makes sense to ensure the test data used is. Although the --dump-aliases
test does not make use of the address data, it is helpful to avoid
giving future developers the wrong impression of the file format.

Also add an alias which translates to multiple addresses using the ()
format.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
---
 t/t9001-send-email.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Junio C Hamano Aug. 14, 2024, 5:02 p.m. UTC | #1
Jacob Keller <jacob.e.keller@intel.com> writes:

> From: Jacob Keller <jacob.keller@gmail.com>
>
> The set of aliases used for the pine --dump-aliases test do not
> perfectly mesh with the way the pine address book is defined. While
> technically all valid, there are some oddities including bob's name
> being partially split so that the actual address is returned as
> "Bobbyton <bob@example.com".

With "partially split" bob's name, do you mean the HT between Robert
and Bobbyton in the original?  

I am asking to see if the closing angle-bracket ">" after the
address is deliberately omitted to illustrate a breakage coming from
a malformed entry in the original address book, or it is missing
merely by mistake.

> -	bob	Robert	Bobbyton <bob@example.com>
> +	bob	Robert Bobbyton	bob@example.com

Thanks.
Jacob Keller Aug. 14, 2024, 5:47 p.m. UTC | #2
On Wed, Aug 14, 2024 at 10:02 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Jacob Keller <jacob.e.keller@intel.com> writes:
>
> > From: Jacob Keller <jacob.keller@gmail.com>
> >
> > The set of aliases used for the pine --dump-aliases test do not
> > perfectly mesh with the way the pine address book is defined. While
> > technically all valid, there are some oddities including bob's name
> > being partially split so that the actual address is returned as
> > "Bobbyton <bob@example.com".
>
> With "partially split" bob's name, do you mean the HT between Robert
> and Bobbyton in the original?
>
> I am asking to see if the closing angle-bracket ">" after the
> address is deliberately omitted to illustrate a breakage coming from
> a malformed entry in the original address book, or it is missing
> merely by mistake.
>

It is missing as a mistake, I think. The main change here is the HT
between Robert and Bobbyton in the original was causing the fields to
be separated.in what seemed like an unintentional way to me. The
missing > was I think due to a copy-paste error where i failed to
select the final > when copying to paste into the commit log.

> > -     bob     Robert  Bobbyton <bob@example.com>
> > +     bob     Robert Bobbyton bob@example.com
>
> Thanks.
diff mbox series

Patch

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index aa36ace393b7..c96d6955b9f2 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -2093,13 +2093,15 @@  test_dump_aliases '--dump-aliases mailrc format' \
 test_dump_aliases '--dump-aliases pine format' \
 	'pine' \
 	'alice' \
+	'bcgrp' \
 	'bob' \
 	'chloe' \
 	'eve' <<-\EOF
-	alice	Alice W Land	<awol@example.com>
-	eve	Eve	<eve@example.com>
-	bob	Robert	Bobbyton <bob@example.com>
+	alice	Alice W Land	awol@example.com		Friend
+	eve	Eve	eve@example.com
+	bob	Robert Bobbyton	bob@example.com
 	chloe		chloe@example.com
+	bcgrp		(bob, chloe, Other <o@example.com>)
 	EOF
 
 test_dump_aliases '--dump-aliases gnus format' \