From: Eric Wong <normalperson@yhbt.net>
To: Andy Whitcroft <apw@shadowen.org>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: git-svn: expand handling of From: and Signed-off-by:
Date: Thu, 13 Dec 2007 08:32:53 -0800 [thread overview]
Message-ID: <20071213163253.GC18433@soma> (raw)
In-Reply-To: <20071213065815.GH30608@shadowen.org>
Andy Whitcroft <apw@shadowen.org> wrote:
> The current parsing for From: and Signed-off-by: lines handles fully
> specified names:
>
> From: Full Name <email@address>
>
> Expand this to include the raw email addresses and straight "names":
>
> From: email@address -> email <email@address>
> From: Full Name -> Full Name <unknown>
>
> Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Some minor whitespace damage (which Junio can fix up), but
Acked-by: Eric Wong <normalperson@yhbt.net>
Thanks Andy.
> ---
> git-svn.perl | 17 +++++++++++++----
> 1 files changed, 13 insertions(+), 4 deletions(-)
> diff --git a/git-svn.perl b/git-svn.perl
> index 54d7844..058f8e9 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -2363,11 +2363,20 @@ sub make_log_entry {
>
> my ($commit_name, $commit_email) = ($name, $email);
> if ($_use_log_author) {
> - if ($log_entry{log} =~ /From:\s+(.*?)\s+<(.*)>\s*\n/) {
> - ($name, $email) = ($1, $2);
> - } elsif ($log_entry{log} =~
> - /Signed-off-by:\s+(.*?)\s+<(.*)>\s*\n/) {
> + my $name_field;
> + if ($log_entry{log} =~ /From:\s+(.*\S)\s*\n/i) {
> + $name_field = $1;
> + } elsif ($log_entry{log} =~ /Signed-off-by:\s+(.*\S)\s*\n/i) {
> + $name_field = $1;
> + }
> + if (!defined $name_field) {
> + #
> + } elsif ($name_field =~ /(.*?)\s+<(.*)>/) {
> ($name, $email) = ($1, $2);
> + } elsif ($name_field =~ /(.*)@/) {
^ spaces before tab here
> + ($name, $email) = ($1, $name_field);
> + } else {
> + ($name, $email) = ($name_field, 'unknown');
> }
> }
> if (defined $headrev && $self->use_svm_props) {
--
Eric Wong
next prev parent reply other threads:[~2007-12-13 16:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-13 6:58 git-svn: expand handling of From: and Signed-off-by: Andy Whitcroft
2007-12-13 16:32 ` Eric Wong [this message]
2007-12-14 8:21 ` Junio C Hamano
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=20071213163253.GC18433@soma \
--to=normalperson@yhbt.net \
--cc=apw@shadowen.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).