On 10/29/2026 9:44 AM, Pierrick Bouvier wrote:
> On 10/29/2026 9:26 AM, Alex Bennée wrote:
>> 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.
>>
> 
> I am aware that origin is the default remote.
> In my case, I always use "upstream" to reference the original project,
> and "origin" for my personal fork. As a result, origin/master does not
> always track upstream/master.
> 
> With git tracking branch, master can be setup to track whatever/master,
> and not origin/master.
> 
> I would be surprised if I'm the only dev with such a setup, it's fairly
> common for any fork based workflow, and why git has tracking branches.
> 
> This patch basically forces origin/master to be aligned with the
> upstream, and nowhere else we enforce that, even if commit message says
> the opposite.
> ```
> Given that origin/master should always be up to date (module the
> developer eschewing convention) lets use that in the test instead.
> ```
>

The current patch is fine, I would just prefer to see it uses tracked
remote branch for master, instead of hardcoding origin/master (see git
branch -vv).

>>>
>>>> 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);
>>>>                                    }
>>>>                            }
>>>>                    }
>>
> 


Reply via email to