Re: [PATCH] get_maintainer: Add a couple more --self-test options
From: Joe Perches
Date: Mon Nov 06 2017 - 14:24:19 EST
On Mon, 2017-11-06 at 13:12 -0600, Tom Saeger wrote:
> Hi Joe,
> This is good! I had something similar cooking - specifically for SCM validation.
>
> My SCM attempt caught a few more issues:
> - check git branch if specified
> - check validitiy of "T:" entry, otherwise warn of malformed entry.
>
> Example malformed (current next has two instances):
>
> 9740 T: git://git.infradead.org/nvme.git
>
> Should be:
> 9740 T: git git://git.infradead.org/nvme.git
>
>
> Also - I believe you intended on warning on all bad SCM entries, not just newly discovered ones?
> Your change correctly finds a previously $isbad, however the print is enclosed in an else preventing output.
>
> I was going to inline these, but in my haste to understand in incorporate changes I sanitized whitespace
> (BTW - I see both tabs and spaces, which is preferred in this file?)
The indent in get_maintainers is supposed to be 4.
There is a mix of 8 char tabs and spaces, but there
shouldn't be any spaces followed by tabs.
> The below git branch special-casing is for these:
> 567:T: git git://people.freedesktop.org/~airlied/linux (part of drm maint)
> 3671:T: git git://git.linaro.org/people/vireshk/linux.git (For ARM Updates)
>
> See bottom for my suggestions.
[]
> Changed SCM portion to this, which picks up a few more warnings...
> Checks git branch on remote if specified.
> Perhaps a $ismalformed category or some other way to deal with malformed entries? Or just
> move up to first check of SCM?
>
> ## SCM reachability
> } elsif (($type eq "T") && ($self_test eq "" || $self_test =~ /\bscm\b/)) {
> next if (grep(m@^\Q$value\E$@, @good_links));
> my $isbad = 0;
> if (grep(m@^\Q$value\E$@, @bad_links)) {
> $isbad = 1;
> } else {
> if ($value !~ /^(?:git|quilt|hg)\s+\S/) {
> print("$x->{file}:$x->{linenr}: warning: malformed entry\t$x->{line}\n");
> } elsif ($value =~ /^git\s+(\S+)(\s+([^\(]+\S+))?/) {
This seems OK.
> my $url = $1;
> my $branch = "";
> $branch = $3 if $3;
>