[{"id":30723,"web_url":"https://patchwork.libcamera.org/comment/30723/","msgid":"<87a5hiw86e.fsf@redhat.com>","date":"2024-08-12T06:45:45","subject":"Re: [PATCH 3/3] utils: checkstyle.py: Add __repr__ method to Commit\n\tclass","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> When debugging issues with the Commit class, a __repr__ method proved to\n> be useful to quickly print all the parsed information about a commit. To\n> avoid reimplementing the method over and over again in the future, add\n> it to the class, even if it is not actually used.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  utils/checkstyle.py | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>\n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index 2b1e1f6c1b9e..c9e41d4149f7 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -248,6 +248,17 @@ class Commit:\n>                               stdout=subprocess.PIPE).stdout.decode('utf-8')\n>          self._files = [CommitFile(f) for f in ret.splitlines()]\n>  \n> +    def __repr__(self):\n> +        return '\\n'.join([\n> +            f'commit {self.commit}',\n> +            f'Author: {self.author}',\n> +            f'',\n> +            f'    {self.title}',\n> +            '',\n> +            '\\n'.join([line and f'    {line}' or '' for line in self._body]),\n> +            'Trailers:',\n> +        ] + self.trailers)\n> +\n>      def files(self, filter='AMR'):\n>          return [f.filename for f in self._files if f.status in filter]","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 B6B59C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 Aug 2024 06:45:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5043A633B9;\n\tMon, 12 Aug 2024 08:45:54 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DA2AB6338D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Aug 2024 08:45:52 +0200 (CEST)","from mail-lf1-f70.google.com (mail-lf1-f70.google.com\n\t[209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-249-GQmm4RVDPveMJGeRP2_3NQ-1; Mon, 12 Aug 2024 02:45:49 -0400","by mail-lf1-f70.google.com with SMTP id\n\t2adb3069b0e04-530c3e95c50so3631983e87.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 11 Aug 2024 23:45:49 -0700 (PDT)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t4fb4d7f45d1cf-5bd1a602da2sm2003971a12.93.2024.08.11.23.45.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 11 Aug 2024 23:45:46 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"TTxzg86E\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1723445151;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=zPH/wBlTLawVDsjhl0ftTkALwLJjdxZ2iRtQGR0z6BQ=;\n\tb=TTxzg86E6W4FHhiS6A8i3AWUYWUYvTw4Q4XcwEIHiEbLNdMSFO9qHMo898W4ZRx4rydAa1\n\tZRIj/WMEx1uOSl7jLGObe9zr96h21axH+CwbtRlbdW8gEQzrDorj7nGolR+4fN8x2laRG4\n\tt9DiyUSdT1m3OOTo+kexapb1WYhqMpA=","X-MC-Unique":"GQmm4RVDPveMJGeRP2_3NQ-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1723445148; x=1724049948;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=zPH/wBlTLawVDsjhl0ftTkALwLJjdxZ2iRtQGR0z6BQ=;\n\tb=hJlBg+yaJmHyQDn/wfIcbxLAubKIgXA+9OMI1TUhtygVPhLeNSbCbrER4SYv5mj4Ah\n\tNwzp3+7aLVlR3K3KtwQ90oVSlzJ0K9TfXzHu13Fg5jIAed5e91NWZPaTmsLbZ/wW4e5u\n\tAKu0nwg64qRmbu3chesLrefpGLjnuK0U+iJXGFEsq9u6Q15PWZqKsQtyw31jcHgYU4O4\n\tbOpNxFLufwdUqMoEpZAWlsXSSWZfcF9ooNz2RQxOVH9FxEwratKggw0xwB1gHFVXyVx6\n\tYtI1TPXYxeGBbtuAAkIf0gZx39qXPx2mIDmNpLC43YFAnMDBHycMSRtaDcK4uJQpEqnw\n\tgMPw==","X-Gm-Message-State":"AOJu0YzuTH2s8niRkLdiqCDyWT6Z0q7O3dW11QjdA5ens9MhA7o5/ywN\n\tN/h1mbRFMlXw30bPYcGtH/LS4dNPETSEsVTpTw5kCCelfPaxqD/b4QpLxGemWyRC7EMHrA+YWg7\n\tQyPghpLWN/iW1JqORyuQRwHn++WWuTbze2IPtmiEHMPgP+MwaVQGISkUs+e1koIfSXxYbx8h2xN\n\tFNsOYxzpXWrSjYuCVAIk9gz13EhwhLv8Yf5iOuiRWKIeBDO2FiZAA6WP0=","X-Received":["by 2002:a05:6512:398b:b0:52e:f907:1023 with SMTP id\n\t2adb3069b0e04-530ee9f3d2emr5403594e87.49.1723445147722; \n\tSun, 11 Aug 2024 23:45:47 -0700 (PDT)","by 2002:a05:6512:398b:b0:52e:f907:1023 with SMTP id\n\t2adb3069b0e04-530ee9f3d2emr5403555e87.49.1723445147108; \n\tSun, 11 Aug 2024 23:45:47 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IG/i4mTLF1ortQJj02L00qWNSD/IF07Yr6LWfV9jgX7i3n9K9kmBqpHfXCRFWW00u3WV+S9ow==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 3/3] utils: checkstyle.py: Add __repr__ method to Commit\n\tclass","In-Reply-To":"<20240810005840.20841-3-laurent.pinchart@ideasonboard.com>\n\t(Laurent Pinchart's message of \"Sat, 10 Aug 2024 03:58:40 +0300\")","References":"<20240810005840.20841-1-laurent.pinchart@ideasonboard.com>\n\t<20240810005840.20841-3-laurent.pinchart@ideasonboard.com>","Date":"Mon, 12 Aug 2024 08:45:45 +0200","Message-ID":"<87a5hiw86e.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30728,"web_url":"https://patchwork.libcamera.org/comment/30728/","msgid":"<89bba1c3-475c-4ad6-8b36-c9cbd3c1345b@ideasonboard.com>","date":"2024-08-12T10:47:18","subject":"Re: [PATCH 3/3] utils: checkstyle.py: Add __repr__ method to Commit\n\tclass","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Hi Laurent\n\nOn 10/08/2024 01:58, Laurent Pinchart wrote:\n> When debugging issues with the Commit class, a __repr__ method proved to\n> be useful to quickly print all the parsed information about a commit. To\n> avoid reimplementing the method over and over again in the future, add\n> it to the class, even if it is not actually used.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n\n\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n\n>   utils/checkstyle.py | 11 +++++++++++\n>   1 file changed, 11 insertions(+)\n>\n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index 2b1e1f6c1b9e..c9e41d4149f7 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -248,6 +248,17 @@ class Commit:\n>                                stdout=subprocess.PIPE).stdout.decode('utf-8')\n>           self._files = [CommitFile(f) for f in ret.splitlines()]\n>   \n> +    def __repr__(self):\n> +        return '\\n'.join([\n> +            f'commit {self.commit}',\n> +            f'Author: {self.author}',\n> +            f'',\n> +            f'    {self.title}',\n> +            '',\n> +            '\\n'.join([line and f'    {line}' or '' for line in self._body]),\n> +            'Trailers:',\n> +        ] + self.trailers)\n> +\n>       def files(self, filter='AMR'):\n>           return [f.filename for f in self._files if f.status in filter]\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 04BE8BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 Aug 2024 10:47:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0CB8B633BA;\n\tMon, 12 Aug 2024 12:47:24 +0200 (CEST)","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 0038363398\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Aug 2024 12:47:21 +0200 (CEST)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9769B6B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Aug 2024 12:46:25 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"t/n2gY4+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723459585;\n\tbh=AwgXpkML24ErvwbZa8AtUlTantEhHbxOeuezw3rVzr0=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=t/n2gY4+TNfnG0gm3l4Ie0YhugvsL/V5MavfjJkbs3cQnxfYNq18lRsP3Faq/4/AE\n\tJqr7tmggl76UtInlPzvMbw7lXyFrmDqNsELMSYbaBxaSKj3fpFvffeHOzCkePkLayT\n\tULOuATe5uMwZnyey9mh0LYLbOh3gZ5d+2QsPml/8=","Message-ID":"<89bba1c3-475c-4ad6-8b36-c9cbd3c1345b@ideasonboard.com>","Date":"Mon, 12 Aug 2024 11:47:18 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 3/3] utils: checkstyle.py: Add __repr__ method to Commit\n\tclass","To":"libcamera-devel@lists.libcamera.org","References":"<20240810005840.20841-1-laurent.pinchart@ideasonboard.com>\n\t<20240810005840.20841-3-laurent.pinchart@ideasonboard.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\txsFNBGLydlEBEADa5O2s0AbUguprfvXOQun/0a8y2Vk6BqkQALgeD6KnXSWwaoCULp18etYW\n\tB31bfgrdphXQ5kUQibB0ADK8DERB4wrzrUb5CMxLBFE7mQty+v5NsP0OFNK9XTaAOcmD+Ove\n\teIjYvqurAaro91jrRVrS1gBRxIFqyPgNvwwL+alMZhn3/2jU2uvBmuRrgnc/e9cHKiuT3Dtq\n\tMHGPKL2m+plk+7tjMoQFfexoQ1JKugHAjxAhJfrkXh6uS6rc01bYCyo7ybzg53m1HLFJdNGX\n\tsUKR+dQpBs3SY4s66tc1sREJqdYyTsSZf80HjIeJjU/hRunRo4NjRIJwhvnK1GyjOvvuCKVU\n\tRWpY8dNjNu5OeAfdrlvFJOxIE9M8JuYCQTMULqd1NuzbpFMjc9524U3Cngs589T7qUMPb1H1\n\tNTA81LmtJ6Y+IV5/kiTUANflpzBwhu18Ok7kGyCq2a2jsOcVmk8gZNs04gyjuj8JziYwwLbf\n\tvzABwpFVcS8aR+nHIZV1HtOzyw8CsL8OySc3K9y+Y0NRpziMRvutrppzgyMb9V+N31mK9Mxl\n\t1YkgaTl4ciNWpdfUe0yxH03OCuHi3922qhPLF4XX5LN+NaVw5Xz2o3eeWklXdouxwV7QlN33\n\tu4+u2FWzKxDqO6WLQGjxPE0mVB4Gh5Pa1Vb0ct9Ctg0qElvtGQARAQABzShEYW4gU2NhbGx5\n\tIDxkYW4uc2Nh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k7GcYxIeON4VzKqWM7hpkXZ47pkK0YodO+dRKM\n\tyMcoUWrTK0Uz6UzUGKoJVbxmSW/EJLEGoI5p3NWxWtScEVv8mO49gqQdrRIOheZycDmHnItt\n\t9Qjv00uFhEwv2YfiyGk6iGF2W40s2pH2t6oeuGgmiZ7g6d0MEK8Ql/4zPItvr1c1rpwpXUC1\n\tu1kQWgtnNjFHX3KiYdqjcZeRBiry1X0zY+4Y24wUU0KsEewJwjhmCKAsju1RpdlPg2kC","In-Reply-To":"<20240810005840.20841-3-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]