mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 00:55:56 +00:00
contrib/checkpatch: recognize git subtree merges
Make checkpatch.pl identify subtree merges in "git am"-formatted patches and reconstruct the full path names based in the subtree root. This fixes some spurious warnings for parts of the tree that use different coding style from what we usually do. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/989
This commit is contained in:
parent
e81c2baf70
commit
ae4412b2fc
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/perl -n
|
#!/usr/bin/perl -n
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
#
|
#
|
||||||
# Copyright (C) 2018 Red Hat, Inc.
|
# Copyright (C) 2018,2021 Red Hat, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
# $ perldoc checkpatch.pl for eye-pleasing view of the manual:
|
# $ perldoc checkpatch.pl for eye-pleasing view of the manual:
|
||||||
|
@ -50,6 +50,7 @@ our $line_no;
|
||||||
our $indent;
|
our $indent;
|
||||||
our $check_is_todo;
|
our $check_is_todo;
|
||||||
our $expect_spdx;
|
our $expect_spdx;
|
||||||
|
our $subdir;
|
||||||
|
|
||||||
sub new_hunk
|
sub new_hunk
|
||||||
{
|
{
|
||||||
|
@ -61,7 +62,8 @@ sub new_file
|
||||||
{
|
{
|
||||||
$expect_spdx = 0;
|
$expect_spdx = 0;
|
||||||
$check_is_todo = 1;
|
$check_is_todo = 1;
|
||||||
$filename = shift;
|
$filename = $subdir // '';
|
||||||
|
$filename .= shift;
|
||||||
@functions_seen = ();
|
@functions_seen = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,6 +142,7 @@ if ($is_patch) {
|
||||||
/^(Reverts|Fixes): *(.*)/ and check_commit ($2, 1);
|
/^(Reverts|Fixes): *(.*)/ and check_commit ($2, 1);
|
||||||
/This reverts commit/ and next;
|
/This reverts commit/ and next;
|
||||||
/cherry picked from/ and next;
|
/cherry picked from/ and next;
|
||||||
|
/^git-subtree-dir: (.*)/ and $subdir = "$1/";
|
||||||
/\bcommit (.*)/ and check_commit ($1, 0);
|
/\bcommit (.*)/ and check_commit ($1, 0);
|
||||||
next;
|
next;
|
||||||
} else {
|
} else {
|
||||||
|
@ -291,7 +294,7 @@ F<CONTRIBUTING>
|
||||||
|
|
||||||
=head1 COPYRIGHT
|
=head1 COPYRIGHT
|
||||||
|
|
||||||
Copyright (C) 2018 Red Hat
|
Copyright (C) 2018,2021 Red Hat
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
Loading…
Reference in a new issue