Pierrick Bouvier <[email protected]> writes:

> On 10/29/2026 8:13 AM, Alex Bennée wrote:
>> The current check for a referenced fix commit relies on the developer
>> keeping their master branch up to date which is not always grunted. If
>> you create your branches directly from origin/master this will keep
>> failing.
>> 
>> Given that origin/master should always be up to date (module the
>> developer eschewing convention) lets use that in the test instead.
>> 
>> checkpatch complains about the line lengths but this seems to be
>> standard for the perl script so I didn't try and fix it.
>>
>
> Or... you can use something else as origin, with origin/master not being
> updated, and master as a tracking branch to upstream/master, and in this
> case, this patch doesn't work.
>
> Using master instead of origin/master has the advantage to not hardcode
> what your remotes should be.

origin is the default when you clone a repo. We could get really complex
and query the tracking remote for the current branch. But if your deeply
forked then that obviates the test.

>
>> Signed-off-by: Alex Bennée <[email protected]>
>> ---
>>  scripts/checkpatch.pl | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index 82f62f60212..60e8b6bf7bc 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -1913,9 +1913,9 @@ sub process {
>>                              }
>>                              if (which("git") ne "" && -e "$gitroot") {
>>                                      my $hash = defined($cid) ? $cid : 
>> $orig_commit;
>> -                                    `git merge-base --is-ancestor $hash 
>> master 2>/dev/null`;
>> +                                    `git merge-base --is-ancestor $hash 
>> origin/master 2>/dev/null`;
>>                                      if ($? != 0) {
>> -                                            WARN("Fixes: commit $hash is 
>> not an ancestor of master\n" . $herecurr);
>> +                                            WARN("Fixes: commit $hash is 
>> not an ancestor of origin/master\n" . $herecurr);
>>                                      }
>>                              }
>>                      }

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

Reply via email to