From: Jakub Narebski <jnareb@gmail.com>
To: Jari Aalto <jari.aalto@cante.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-send-email.perl: add maildomain_sanitize()
Date: Thu, 15 Apr 2010 05:47:45 -0700 (PDT) [thread overview]
Message-ID: <m38w8og9w4.fsf@localhost.localdomain> (raw)
In-Reply-To: <87bpdnwpoh.fsf_-_@jondo.cante.net>
Jari Aalto <jari.aalto@cante.net> writes:
> Move duplicate maildomain checks to a single subroutine.
> Require that a FQDN contains at least one period.
>
> Signed-off-by: Jari Aalto <jari.aalto@cante.net>
> ---
Good idea.
[...]
> diff --git a/git-send-email.perl b/git-send-email.perl
> index ce569a9..0e8f18c 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -863,14 +863,28 @@ sub sanitize_address
> # This maildomain*() code is based on ideas in Perl library Test::Reporter
> # /usr/share/perl5/Test/Reporter/Mail/Util.pm ==> sub _maildomain ()
>
> +sub maildomain_sanitize
> +{
> + local $_ = shift;
> +
> + # On Mac, the the domain name is not necessarily in FQDN format
> + # Require a period in the string
> +
> + if ( $^O eq 'darwin' and /\.local$/ ) {
> + # Nope, pass this one.
> + }
> + elsif ( /\./ ) {
> + $_;
> + }
> +}
Style:
+sub maildomain_sanitize {
+ local $domain = shift;
+
+ # On Mac, the the domain name is not necessarily in FQDN format
+ # Require a period in the string
+
+ if ($^O eq 'darwin' && $domain =~ /\.local$/) {
+ # Nope, pass this one.
+ } elsif ($domain =~ /\./) {
+ return $domain;
+ }
+}
(probably fixed in new version of this series).
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2010-04-15 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-09 5:11 [PATCH 0/3] send-email: --smtp-domain improvements Brian Gernhardt
2010-04-09 5:11 ` [PATCH 1/3] send-email: Don't use FQDNs without a '.' Brian Gernhardt
2010-04-09 5:36 ` Junio C Hamano
2010-04-13 8:43 ` [PATCH] git-send-email.perl: Add sub maildomain_sanitize Jari Aalto
2010-04-13 11:35 ` [PATCH] git-send-email.perl: add maildomain_sanitize() Jari Aalto
2010-04-15 12:47 ` Jakub Narebski [this message]
2010-04-16 15:49 ` [PATCH v2] git-send-email.perl: Add sub maildomain_sanitize Jari Aalto
2010-04-16 16:11 ` Jakub Narebski
2010-04-16 17:00 ` Start encouraging English.pm (Was: [PATCH v2] git-send-email.perl: Add sub maildomain_sanitize) Jari Aalto
2010-04-09 5:11 ` [PATCH 2/3] Document send-email --smtp-domain Brian Gernhardt
2010-04-09 5:11 ` [PATCH 3/3] send-email: Add sendemail.smtpdomain Brian Gernhardt
2010-04-09 6:56 ` Jakub Narebski
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=m38w8og9w4.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=jari.aalto@cante.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 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.