get_maintainer: add subsystem to reviewer output
Reviewer output currently does not include the subsystem that matched. Add it. Miscellanea: o Add a get_subsystem_name routine to centralize this Cherry picked from Linux commit 2a7cb1dc82fc2a52e747b4c496c13f6575fb1790. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
		
							parent
							
								
									9ff3a5e677
								
							
						
					
					
						commit
						622e42a71f
					
				@ -896,6 +896,20 @@ sub find_ending_index {
 | 
				
			|||||||
    return $index;
 | 
					    return $index;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub get_subsystem_name {
 | 
				
			||||||
 | 
					    my ($index) = @_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my $start = find_starting_index($index);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my $subsystem = $typevalue[$start];
 | 
				
			||||||
 | 
					    if (length($subsystem) > 20) {
 | 
				
			||||||
 | 
						$subsystem = substr($subsystem, 0, 17);
 | 
				
			||||||
 | 
						$subsystem =~ s/\s*$//;
 | 
				
			||||||
 | 
						$subsystem = $subsystem . "...";
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return $subsystem;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub get_maintainer_role {
 | 
					sub get_maintainer_role {
 | 
				
			||||||
    my ($index) = @_;
 | 
					    my ($index) = @_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -904,12 +918,7 @@ sub get_maintainer_role {
 | 
				
			|||||||
    my $end = find_ending_index($index);
 | 
					    my $end = find_ending_index($index);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $role = "unknown";
 | 
					    my $role = "unknown";
 | 
				
			||||||
    my $subsystem = $typevalue[$start];
 | 
					    my $subsystem = get_subsystem_name($index);
 | 
				
			||||||
    if (length($subsystem) > 20) {
 | 
					 | 
				
			||||||
	$subsystem = substr($subsystem, 0, 17);
 | 
					 | 
				
			||||||
	$subsystem =~ s/\s*$//;
 | 
					 | 
				
			||||||
	$subsystem = $subsystem . "...";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for ($i = $start + 1; $i < $end; $i++) {
 | 
					    for ($i = $start + 1; $i < $end; $i++) {
 | 
				
			||||||
	my $tv = $typevalue[$i];
 | 
						my $tv = $typevalue[$i];
 | 
				
			||||||
@ -943,16 +952,7 @@ sub get_maintainer_role {
 | 
				
			|||||||
sub get_list_role {
 | 
					sub get_list_role {
 | 
				
			||||||
    my ($index) = @_;
 | 
					    my ($index) = @_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $i;
 | 
					    my $subsystem = get_subsystem_name($index);
 | 
				
			||||||
    my $start = find_starting_index($index);
 | 
					 | 
				
			||||||
    my $end = find_ending_index($index);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $subsystem = $typevalue[$start];
 | 
					 | 
				
			||||||
    if (length($subsystem) > 20) {
 | 
					 | 
				
			||||||
	$subsystem = substr($subsystem, 0, 17);
 | 
					 | 
				
			||||||
	$subsystem =~ s/\s*$//;
 | 
					 | 
				
			||||||
	$subsystem = $subsystem . "...";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ($subsystem eq "THE REST") {
 | 
					    if ($subsystem eq "THE REST") {
 | 
				
			||||||
	$subsystem = "";
 | 
						$subsystem = "";
 | 
				
			||||||
@ -1040,7 +1040,8 @@ sub add_categories {
 | 
				
			|||||||
		    }
 | 
							    }
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if ($email_reviewer) {
 | 
							if ($email_reviewer) {
 | 
				
			||||||
		    push_email_addresses($pvalue, 'reviewer');
 | 
							    my $subsystem = get_subsystem_name($i);
 | 
				
			||||||
 | 
							    push_email_addresses($pvalue, "reviewer:$subsystem");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	    } elsif ($ptype eq "T") {
 | 
						    } elsif ($ptype eq "T") {
 | 
				
			||||||
		push(@scm, $pvalue);
 | 
							push(@scm, $pvalue);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user