[{"id":26146,"web_url":"https://patchwork.libcamera.org/comment/26146/","msgid":"<Y6ZAE97XFYdLkHgV@pyrite.rasen.tech>","date":"2022-12-23T23:56:03","subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Add commit\n\ttitle checker","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Thu, Dec 22, 2022 at 12:12:37AM +0200, Laurent Pinchart via libcamera-devel wrote:\n> Add a commit checker to ensure that commit titles start with a prefix.\n> The commit issue message lists prefix candidates retrieved from the git\n> log.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n> Changes since v1:\n> \n> - Reduce indentation\n> ---\n>  utils/checkstyle.py | 62 +++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 62 insertions(+)\n> \n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index a11d95cc5808..364e13d6533d 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -352,6 +352,68 @@ class HeaderAddChecker(CommitChecker):\n>          return issues\n>  \n>  \n> +class TitleChecker(CommitChecker):\n> +    prefix_regex = re.compile(r'[0-9a-f]+ (([a-zA-Z0-9_.-]+: )+)')\n\nAh, the first chunk is for the commit ID...\n\n> +    release_regex = re.compile(r'libcamera v[0-9]+\\.[0-9]+\\.[0-9]+')\n> +\n> +    @classmethod\n> +    def check(cls, commit, top_level):\n> +        title = commit.title\n> +\n> +        # Ignore release commits, they don't need a prefix.\n> +        if TitleChecker.release_regex.fullmatch(title):\n> +            return []\n> +\n> +        prefix_pos = title.find(': ')\n> +        if prefix_pos != -1 and prefix_pos != len(title) - 2:\n> +            return []\n> +\n> +        # Find prefix candidates by searching the git history\n> +        msgs = subprocess.run(['git', 'log', '--no-decorate', '--oneline', '-n100', '--'] + commit.files(),\n> +                              stdout=subprocess.PIPE).stdout.decode('utf-8')\n> +        prefixes = {}\n> +        prefixes_count = 0\n> +        for msg in msgs.splitlines():\n> +            prefix = TitleChecker.prefix_regex.match(msg)\n> +            if not prefix:\n> +                continue\n> +\n> +            prefix = prefix.group(1)\n> +            if prefix in prefixes:\n> +                prefixes[prefix] += 1\n> +            else:\n> +                prefixes[prefix] = 1\n> +\n> +            prefixes_count += 1\n> +\n> +        if not prefixes:\n> +            return [CommitIssue('Commit title is missing prefix')]\n> +\n> +        # Sort the candidates by number of occurrences and pick the best ones.\n> +        # When multiple prefixes are possible without a clear winner, we want to\n> +        # display the most common options to the user, but without the most\n> +        # unlikely options to avoid too long messages. As a heuristic, select\n> +        # enough candidates to cover at least 2/3 of the possible prefixes, but\n> +        # never more than 4 candidates.\n> +        prefixes = list(prefixes.items())\n> +        prefixes.sort(key=lambda x: x[1], reverse=True)\n> +\n> +        candidates = []\n> +        candidates_count = 0\n> +        for prefix in prefixes:\n> +            candidates.append(f\"`{prefix[0]}'\")\n> +            candidates_count += prefix[1]\n> +            if candidates_count >= prefixes_count * 2 / 3 or \\\n> +               len(candidates) == 4:\n> +                break\n> +\n> +        candidates = candidates[:-2] + [' and '.join(candidates[-2:])]\n\nimo, s/and/or/\n\n> +        candidates = ', '.join(candidates)\n\nAlso I feel like surrounding each candidate in quotes might be helpful.\n\nOtherwise,\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> +\n> +        return [CommitIssue('Commit title is missing prefix, '\n> +                            'possible candidates are ' + candidates)]\n> +\n> +\n>  # ------------------------------------------------------------------------------\n>  # Style Checkers\n>  #\n> \n> base-commit: f66a5c447b65bce774a1bc2d01034f437bf764b5\n> prerequisite-patch-id: 55c457bf621237f99229898adb78e18b259ab74b","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0E849C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 Dec 2022 23:56:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 64A3C61507;\n\tSat, 24 Dec 2022 00:56:11 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9977661507\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 24 Dec 2022 00:56:09 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2604:2d80:ad8a:9000:1bf9:855b:22de:3645])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 821E74DD;\n\tSat, 24 Dec 2022 00:56:08 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1671839771;\n\tbh=v92FGKRTm5s+0QM2KWM6PGZAkTpqmoUE2+lYWNMinoQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=HbKoCBW8Ix4HpQ3qfF2QR+ah6DktIaWDeHylSQ12bXKPsH5aGXiQMbdTkEd2VdzCF\n\tof0FuKQVo+sMQonYpVv/CF1uFJBw5S4sDrQAnu7E65z1PNOTH981v+xHIsCpMN5s1c\n\t5XpdCI+61t5NPCFIww89vmiM38cSZxmEovX2AFuS4mT6Cy4ABaZKPoPewILDOW6Ln+\n\tzwv/38UV4ppPoOMo4hcmOW7Rwhofe/k4+4wTrxZjHkERB2mgZ0yecubxnfpAT6Gm02\n\t76VBVvhQKbvMlUZJvQaj2DhCL2Exqn5rcjAvY+7U5HyUaJw8QPE+muEMQF2D1ocMvS\n\t3NcQbKljMUFjw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1671839769;\n\tbh=v92FGKRTm5s+0QM2KWM6PGZAkTpqmoUE2+lYWNMinoQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sAc/H4axQg0BmJV7EwGe8V1y8YswZx++rnxc+xn9+q5YvbPPF7qoFN6AA5MgUXJ1Q\n\tQpuG8ZNIQyY0YZgiDUD0ZBiBafGUwFYNgfU3m3ECGtL38AJyMesNeaGs9zQNkL95jh\n\tNPYs3IFkwnTBhq8yI5Vwd0F68ZCPQrCr8nTkZS8w="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"sAc/H4ax\"; dkim-atps=neutral","Date":"Fri, 23 Dec 2022 17:56:03 -0600","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<Y6ZAE97XFYdLkHgV@pyrite.rasen.tech>","References":"<20221221221237.3094-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20221221221237.3094-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Add commit\n\ttitle checker","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26148,"web_url":"https://patchwork.libcamera.org/comment/26148/","msgid":"<Y6ZDllX0NxmaLvb3@pendragon.ideasonboard.com>","date":"2022-12-24T00:11:02","subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Add commit\n\ttitle checker","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nOn Fri, Dec 23, 2022 at 05:56:03PM -0600, Paul Elder wrote:\n> On Thu, Dec 22, 2022 at 12:12:37AM +0200, Laurent Pinchart via libcamera-devel wrote:\n> > Add a commit checker to ensure that commit titles start with a prefix.\n> > The commit issue message lists prefix candidates retrieved from the git\n> > log.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> > Changes since v1:\n> > \n> > - Reduce indentation\n> > ---\n> >  utils/checkstyle.py | 62 +++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 62 insertions(+)\n> > \n> > diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> > index a11d95cc5808..364e13d6533d 100755\n> > --- a/utils/checkstyle.py\n> > +++ b/utils/checkstyle.py\n> > @@ -352,6 +352,68 @@ class HeaderAddChecker(CommitChecker):\n> >          return issues\n> >  \n> >  \n> > +class TitleChecker(CommitChecker):\n> > +    prefix_regex = re.compile(r'[0-9a-f]+ (([a-zA-Z0-9_.-]+: )+)')\n> \n> Ah, the first chunk is for the commit ID...\n\nThat's right.\n\n> > +    release_regex = re.compile(r'libcamera v[0-9]+\\.[0-9]+\\.[0-9]+')\n> > +\n> > +    @classmethod\n> > +    def check(cls, commit, top_level):\n> > +        title = commit.title\n> > +\n> > +        # Ignore release commits, they don't need a prefix.\n> > +        if TitleChecker.release_regex.fullmatch(title):\n> > +            return []\n> > +\n> > +        prefix_pos = title.find(': ')\n> > +        if prefix_pos != -1 and prefix_pos != len(title) - 2:\n> > +            return []\n> > +\n> > +        # Find prefix candidates by searching the git history\n> > +        msgs = subprocess.run(['git', 'log', '--no-decorate', '--oneline', '-n100', '--'] + commit.files(),\n> > +                              stdout=subprocess.PIPE).stdout.decode('utf-8')\n> > +        prefixes = {}\n> > +        prefixes_count = 0\n> > +        for msg in msgs.splitlines():\n> > +            prefix = TitleChecker.prefix_regex.match(msg)\n> > +            if not prefix:\n> > +                continue\n> > +\n> > +            prefix = prefix.group(1)\n> > +            if prefix in prefixes:\n> > +                prefixes[prefix] += 1\n> > +            else:\n> > +                prefixes[prefix] = 1\n> > +\n> > +            prefixes_count += 1\n> > +\n> > +        if not prefixes:\n> > +            return [CommitIssue('Commit title is missing prefix')]\n> > +\n> > +        # Sort the candidates by number of occurrences and pick the best ones.\n> > +        # When multiple prefixes are possible without a clear winner, we want to\n> > +        # display the most common options to the user, but without the most\n> > +        # unlikely options to avoid too long messages. As a heuristic, select\n> > +        # enough candidates to cover at least 2/3 of the possible prefixes, but\n> > +        # never more than 4 candidates.\n> > +        prefixes = list(prefixes.items())\n> > +        prefixes.sort(key=lambda x: x[1], reverse=True)\n> > +\n> > +        candidates = []\n> > +        candidates_count = 0\n> > +        for prefix in prefixes:\n> > +            candidates.append(f\"`{prefix[0]}'\")\n> > +            candidates_count += prefix[1]\n> > +            if candidates_count >= prefixes_count * 2 / 3 or \\\n> > +               len(candidates) == 4:\n> > +                break\n> > +\n> > +        candidates = candidates[:-2] + [' and '.join(candidates[-2:])]\n> \n> imo, s/and/or/\n\nThey are all candidates, but I'm happy to use \"or\" if that's preferred.\n\n> > +        candidates = ', '.join(candidates)\n> \n> Also I feel like surrounding each candidate in quotes might be helpful.\n\nDone already, see\n\n            candidates.append(f\"`{prefix[0]}'\")\n\nabove.\n\n> Otherwise,\n> \n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> > +\n> > +        return [CommitIssue('Commit title is missing prefix, '\n> > +                            'possible candidates are ' + candidates)]\n> > +\n> > +\n> >  # ------------------------------------------------------------------------------\n> >  # Style Checkers\n> >  #\n> > \n> > base-commit: f66a5c447b65bce774a1bc2d01034f437bf764b5\n> > prerequisite-patch-id: 55c457bf621237f99229898adb78e18b259ab74b","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9071CBD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 24 Dec 2022 00:11:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5A6BF61507;\n\tSat, 24 Dec 2022 01:11:11 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6A51961507\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 24 Dec 2022 01:11:10 +0100 (CET)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B4F44DD;\n\tSat, 24 Dec 2022 01:11:09 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1671840671;\n\tbh=7D6ba8wCkgTgh9evIJ/cGpFzbrI4Uto/i2jqXWLwzMo=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=4UpSb66RjE0TRx6lkBUF37Yc7YRQ8yWZJqvCZNjGhNDvi9QmG4Z1/8/ZLC33ZXekL\n\tiZNb6YuqOxbXtK1g4VKQA8vxrzxDnJVL31MkhcFvsqiKffm7kJd200W7B5skwiSkZ3\n\tgbV3eGC6qpboIOkS9+FIhvQCg0wcrwvRzql8n2x2gAf0rUnSci3DeI6HjkLRNi/65f\n\tBZCz6PcYkS5pmh/Fv2SDkenze/QVYBMsSPK43Y4GCDC3OQcqtCh464JBDymx4Dav/d\n\tYInlzJ2c6c3dpFEwEH+nNCjFMjKccwBl6n7BwKoABrQo+sP+pvTq5tHwfjGK5TFxmj\n\ts6/86ZEl4C+wQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1671840670;\n\tbh=7D6ba8wCkgTgh9evIJ/cGpFzbrI4Uto/i2jqXWLwzMo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=lTRqY51v1PF6Uaqa1NPnAKS+FI5Nykihqc+c3GOx00U6ecUopecoVuVTRdUdWhGKv\n\ta+EbTCLhy48YBr8IJh1MAh3ikclzS86klZu1PBidRQRALgI/got1jRkujpKq9nHQ0K\n\tWm5iqCqegK4G3Qw8crDOcxlSjP7OmSPrWMkgxP60="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"lTRqY51v\"; dkim-atps=neutral","Date":"Sat, 24 Dec 2022 02:11:02 +0200","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<Y6ZDllX0NxmaLvb3@pendragon.ideasonboard.com>","References":"<20221221221237.3094-1-laurent.pinchart@ideasonboard.com>\n\t<Y6ZAE97XFYdLkHgV@pyrite.rasen.tech>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<Y6ZAE97XFYdLkHgV@pyrite.rasen.tech>","Subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Add commit\n\ttitle checker","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26201,"web_url":"https://patchwork.libcamera.org/comment/26201/","msgid":"<20230110081748.bq42naryzwnvpfrn@uno.localdomain>","date":"2023-01-10T08:17:48","subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Add commit\n\ttitle checker","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"I don't really understand python but it seems ok to me\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nOn Thu, Dec 22, 2022 at 12:12:37AM +0200, Laurent Pinchart via libcamera-devel wrote:\n> Add a commit checker to ensure that commit titles start with a prefix.\n> The commit issue message lists prefix candidates retrieved from the git\n> log.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n> Changes since v1:\n>\n> - Reduce indentation\n> ---\n>  utils/checkstyle.py | 62 +++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 62 insertions(+)\n>\n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index a11d95cc5808..364e13d6533d 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -352,6 +352,68 @@ class HeaderAddChecker(CommitChecker):\n>          return issues\n>\n>\n> +class TitleChecker(CommitChecker):\n> +    prefix_regex = re.compile(r'[0-9a-f]+ (([a-zA-Z0-9_.-]+: )+)')\n> +    release_regex = re.compile(r'libcamera v[0-9]+\\.[0-9]+\\.[0-9]+')\n> +\n> +    @classmethod\n> +    def check(cls, commit, top_level):\n> +        title = commit.title\n> +\n> +        # Ignore release commits, they don't need a prefix.\n> +        if TitleChecker.release_regex.fullmatch(title):\n> +            return []\n> +\n> +        prefix_pos = title.find(': ')\n> +        if prefix_pos != -1 and prefix_pos != len(title) - 2:\n> +            return []\n> +\n> +        # Find prefix candidates by searching the git history\n> +        msgs = subprocess.run(['git', 'log', '--no-decorate', '--oneline', '-n100', '--'] + commit.files(),\n> +                              stdout=subprocess.PIPE).stdout.decode('utf-8')\n> +        prefixes = {}\n> +        prefixes_count = 0\n> +        for msg in msgs.splitlines():\n> +            prefix = TitleChecker.prefix_regex.match(msg)\n> +            if not prefix:\n> +                continue\n> +\n> +            prefix = prefix.group(1)\n> +            if prefix in prefixes:\n> +                prefixes[prefix] += 1\n> +            else:\n> +                prefixes[prefix] = 1\n> +\n> +            prefixes_count += 1\n> +\n> +        if not prefixes:\n> +            return [CommitIssue('Commit title is missing prefix')]\n> +\n> +        # Sort the candidates by number of occurrences and pick the best ones.\n> +        # When multiple prefixes are possible without a clear winner, we want to\n> +        # display the most common options to the user, but without the most\n> +        # unlikely options to avoid too long messages. As a heuristic, select\n> +        # enough candidates to cover at least 2/3 of the possible prefixes, but\n> +        # never more than 4 candidates.\n> +        prefixes = list(prefixes.items())\n> +        prefixes.sort(key=lambda x: x[1], reverse=True)\n> +\n> +        candidates = []\n> +        candidates_count = 0\n> +        for prefix in prefixes:\n> +            candidates.append(f\"`{prefix[0]}'\")\n> +            candidates_count += prefix[1]\n> +            if candidates_count >= prefixes_count * 2 / 3 or \\\n> +               len(candidates) == 4:\n> +                break\n> +\n> +        candidates = candidates[:-2] + [' and '.join(candidates[-2:])]\n> +        candidates = ', '.join(candidates)\n> +\n> +        return [CommitIssue('Commit title is missing prefix, '\n> +                            'possible candidates are ' + candidates)]\n> +\n> +\n>  # ------------------------------------------------------------------------------\n>  # Style Checkers\n>  #\n>\n> base-commit: f66a5c447b65bce774a1bc2d01034f437bf764b5\n> prerequisite-patch-id: 55c457bf621237f99229898adb78e18b259ab74b\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CAD4CC322E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 Jan 2023 08:17:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 38F3F625DE;\n\tTue, 10 Jan 2023 09:17:53 +0100 (CET)","from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D2D861F05\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 Jan 2023 09:17:50 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 0E3A51C0009;\n\tTue, 10 Jan 2023 08:17:49 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1673338673;\n\tbh=E999lQPmEsJFzm2NHl9bUPAya6EJ+s6CJvur/kwMl+Q=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=JQFlLrzEJX2Kh2B9fH0nYMEtL/kkVoUdzSxckXEAdn3ydjlBcBdmluMNpkhPqvdh1\n\tA5xsaN26JbJvqESPUan7G6bPs4//NEJAnILif4xGRrIbQu4ZY10/y6tW2cZVbPcdsT\n\tfh4N7DOI4XiZBWg9pPjYNmcKEQZn1pPX15pomlx+DAtUw4ZqyIRFYwFj4lbRyITyzV\n\tywSQqOprXwYgQLjJYLgFT6VmQOUOm0zIDviY1UBd1FKxp5yDZvJSXXg1eY/0Syro77\n\tqLas8htFD7CXfCuqPREDfwyI0RO16JTAVe62wWlC61WtR2sCECx3ZIrSjBNGbdwnYr\n\t+bzei8sFC/oHg==","Date":"Tue, 10 Jan 2023 09:17:48 +0100","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20230110081748.bq42naryzwnvpfrn@uno.localdomain>","References":"<20221221221237.3094-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221221221237.3094-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Add commit\n\ttitle checker","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]