All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH v3 2/2] get_maintainer: add ability to report Git Lab handle
Date: Wed, 15 Jul 2026 15:43:53 -0300	[thread overview]
Message-ID: <87pl0o3xg6.fsf@suse.de> (raw)
In-Reply-To: <20260715154029.1216464-3-berrange@redhat.com>

Daniel P. Berrangé <berrange@redhat.com> writes:

> With the GitLab mapping files from the previous commit, the
> get_manitainer.pl script is now able to report the gitlab
> handle for each maintainer/reviewer when displaying output.
>
> For example:
>
>   $ ./scripts/get_maintainer.pl -f hw/scsi/lsi53c895a.c
>   Paolo Bonzini <pbonzini@redhat.com> (supporter:SCSI, gitlab:@bonzini)
>   Fam Zheng <fam@euphon.net> (reviewer:SCSI, gitlab:@famzheng)
>   qemu-devel@nongnu.org (open list:All patches CC here)
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  scripts/get_maintainer.pl | 51 ++++++++++++++++++++++++++++++++++++---
>  1 file changed, 47 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> index 76be402e11..9679f27413 100755
> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl
> @@ -365,6 +365,31 @@ sub read_mailmap {
>      close($mailmap_file);
>  }
>  
> +my %gitlabmap;
> +
> +read_gitlabmap(".gitlab-map-auto");
> +read_gitlabmap(".gitlab-map-manual");
> +
> +sub read_gitlabmap {
> +    my $mapfile = shift;
> +    open MAP, "<$mapfile"
> +	or die "cannot open $mapfile: $!";
> +
> +    while (<MAP>) {
> +	next if /^#/;
> +	next if /^\s*$/;
> +
> +	if (/^(\S+)\t(.*)$/) {
> +	    my $handle = $1;
> +	    my $realname = $2;
> +
> +	    $gitlabmap{$realname} = $handle;
> +	}
> +    }
> +
> +    close MAP;
> +}
> +
>  ## use the filenames on the command line or find the filenames in the patchfiles
>  
>  my @files = ();
> @@ -1068,6 +1093,18 @@ sub email_inuse {
>      return 0;
>  }
>  
> +sub gitlab_handle {
> +    my $name = shift;
> +
> +    $name =~ s/"//g;
> +
> +    my $gitlab_handle;
> +    if (exists $gitlabmap{$name}) {
> +	return $gitlabmap{$name};
> +    }
> +    return undef;
> +}
> +
>  sub push_email_address {
>      my ($line, $role) = @_;
>  
> @@ -1077,10 +1114,12 @@ sub push_email_address {
>  	return 0;
>      }
>  
> +    my $gitlab_handle = gitlab_handle($name);
> +
>      if (!$email_remove_duplicates) {
> -	push(@email_to, [format_email($name, $address, $email_usename), $role]);
> +	push(@email_to, [format_email($name, $address, $email_usename), $role, $gitlab_handle]);
>      } elsif (!email_inuse($name, $address)) {
> -	push(@email_to, [format_email($name, $address, $email_usename), $role]);
> +	push(@email_to, [format_email($name, $address, $email_usename), $role, $gitlab_handle]);
>  	$email_hash_name{lc($name)}++ if ($name ne "");
>  	$email_hash_address{lc($address)}++;
>      }
> @@ -2026,10 +2065,14 @@ sub merge_email {
>      my %saw;
>  
>      for (@_) {
> -	my ($address, $role) = @$_;
> +	my ($address, $role, $gitlab_handle) = @$_;
>  	if (!$saw{$address}) {
>  	    if ($output_roles) {
> -		push(@lines, "$address ($role)");
> +		if (defined $gitlab_handle) {
> +		    push(@lines, "$address ($role, gitlab:\@$gitlab_handle)");
> +		} else {
> +		    push(@lines, "$address ($role)");
> +		}
>  	    } else {
>  		push(@lines, $address);
>  	    }

Reviewed-by: Fabiano Rosas <farosas@suse.de>


      reply	other threads:[~2026-07-15 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 15:40 [PATCH v3 0/2] Record maintainer/reviewer Git Lab handles Daniel P. Berrangé
2026-07-15 15:40 ` [PATCH v3 1/2] gitlab: introduce files mapping GitLab accounts to real names Daniel P. Berrangé
2026-07-15 18:38   ` Fabiano Rosas
2026-07-16 10:07     ` Daniel P. Berrangé
2026-07-15 15:40 ` [PATCH v3 2/2] get_maintainer: add ability to report Git Lab handle Daniel P. Berrangé
2026-07-15 18:43   ` Fabiano Rosas [this message]

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=87pl0o3xg6.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /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.