[{"id":25415,"web_url":"https://patchwork.libcamera.org/comment/25415/","msgid":"<Y0frHB7jeik1SkQp@pendragon.ideasonboard.com>","date":"2022-10-13T10:40:28","subject":"Re: [libcamera-devel] [PATCH v4 3/3] utils: Provide a release script","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Thu, Oct 13, 2022 at 10:59:57AM +0100, Kieran Bingham wrote:\n> Support making releases of libcamera by introducing a helper script\n> which will facilitate the increment of any release version, along with\n> generating an associated tag.\n> \n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> v4\n>  - Set -e on script to stop on any errors\n>  - Use -e when creating the release commit to support the releaser\n>    adding notes\n>  - Take the commit message into the signed tag as the release message\n>    (No signoffs are stripped)\n\nThere's a git-interpret-trailers command, I wish there was a\ngit-remove-trailers, or a %B:trailers=false format string, or something\nsimilar. It shouldn't be too difficult to implement with awk, but that's\nreally bikeshedding, I won't insist :-)\n\n> v3\n>  - Improve error message\n>  - Remove redundant git add\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  utils/release.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 46 insertions(+)\n>  create mode 100755 utils/release.sh\n> \n> diff --git a/utils/release.sh b/utils/release.sh\n> new file mode 100755\n> index 000000000000..6b4e081ba179\n> --- /dev/null\n> +++ b/utils/release.sh\n> @@ -0,0 +1,46 @@\n> +#!/bin/sh\n> +\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +# Prepare a project release\n> +\n> +set -e\n> +\n> +# Abort if we are not within the project root or the tree is not clean.\n> +if [ ! -e utils/gen-version.sh ] || [ ! -e .git ]; then\n> +\techo \"This release script must be run from the root of libcamera git tree.\"\n> +\texit 1\n> +fi\n> +\n> +if ! git diff-index --quiet HEAD; then\n> +\techo \"Tree must be clean to release.\"\n> +\texit 1\n> +fi\n> +\n> +# Identify current version components\n> +version=$(./utils/gen-version.sh)\n> +\n> +# Decide if we are here to bump major, minor, or patch release.\n> +case $1 in\n> +\tmajor|minor|patch)\n> +\t\tbump=$1;\n> +\t\t;;\n> +\t*)\n> +\t\techo \"You must specify the version bump level: (major, minor, patch)\"\n> +\t\texit 1\n> +\t\t;;\n> +esac\n> +\n> +new_version=$(./utils/semver bump \"$bump\" \"$version\")\n> +\n> +echo \"Bumping $bump\"\n> +echo \"  Existing version is: $version\"\n> +echo \"  New version is : $new_version\"\n> +\n> +# Patch in the version to our meson.build\n> +sed -i -E \"s/ version : '.*',/ version : '$new_version',/\" meson.build\n> +\n> +# Commit the update\n> +git commit meson.build -esm \"libcamera v$new_version\"\n> +\n> +# Create a tag from that commit\n> +git show -s --format=%B | git tag \"v$new_version\" -as -F -\n\nDo you need -a for git-tag ? According to the man page,\n\n       -a, --annotate\n           Make an unsigned, annotated tag object\n\n       -s, --sign\n\t   Make a GPG-signed tag, using the default e-mail address’s\n\t   key. The default behavior of tag GPG-signing is controlled by\n\t   tag.gpgSign configuration variable if it exists, or disabled\n\t   otherwise. See git-config(1).\n\nI think -s is enough.","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 966ABC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Oct 2022 10:40:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6FFFA62DAB;\n\tThu, 13 Oct 2022 12:40:37 +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 BF95462D6B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Oct 2022 12:40:35 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1024C492;\n\tThu, 13 Oct 2022 12:40:34 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665657637;\n\tbh=9/kPJEcNgjN1hO/vvO1yDbDrlNxHPqiYPd/VxK6CzWk=;\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=C0PlYRvRV+eWxoz374+MB1pSdPl3raxvy/8hrba1pXG3TssggN+PLj12e7HdC9kWU\n\tW50clpYs73eyj0GU6m9/E0L3pm0pir9tUjdiy9d8AUA51RPpBxr954yuxu3LERuFID\n\tfgjif0UGfNaj84t7gyjMMlQTKULssE3xNV07IRr7Ofp8a3wWVBpOTDVf9ZyIsgqZ2D\n\tcX6EZWpBWgXD2SxgfDZGzCeHKn7RGaKbgci008VAELdRxbW54LIEteelT0QssmHkJL\n\tnwx56O33EeyKTme7gwSlYUPMyK2XYrnK4yxSpUDxY5qqLhqmc1IpLPtMlLVc2Eq9Vs\n\tCmG19YTDcekVA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665657635;\n\tbh=9/kPJEcNgjN1hO/vvO1yDbDrlNxHPqiYPd/VxK6CzWk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pi/jMLiiJSbHGPC4cVaMxpOz46JPl63gfr+tRN7r+zUq2ehVuAcGUi+umBDODWGkU\n\tASEcLemUU1a88q3zRGPBARHuljlhIvemwcwA2S0Dj9OPV2zdkRHaMRZrKttVZ7kC9U\n\tlQ9RHQwFhF2rVSLgZZyRTjW6TPUfvt7i6DdHaHSk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"pi/jMLii\"; dkim-atps=neutral","Date":"Thu, 13 Oct 2022 13:40:28 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<Y0frHB7jeik1SkQp@pendragon.ideasonboard.com>","References":"<20221013095957.1642901-1-kieran.bingham@ideasonboard.com>\n\t<20221013095957.1642901-4-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20221013095957.1642901-4-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 3/3] utils: Provide a release script","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25416,"web_url":"https://patchwork.libcamera.org/comment/25416/","msgid":"<166565998115.1683026.14215370396236630171@Monstersaurus>","date":"2022-10-13T11:19:41","subject":"Re: [libcamera-devel] [PATCH v4 3/3] utils: Provide a release script","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2022-10-13 11:40:28)\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Thu, Oct 13, 2022 at 10:59:57AM +0100, Kieran Bingham wrote:\n> > Support making releases of libcamera by introducing a helper script\n> > which will facilitate the increment of any release version, along with\n> > generating an associated tag.\n> > \n> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> > ---\n> > v4\n> >  - Set -e on script to stop on any errors\n> >  - Use -e when creating the release commit to support the releaser\n> >    adding notes\n> >  - Take the commit message into the signed tag as the release message\n> >    (No signoffs are stripped)\n> \n> There's a git-interpret-trailers command, I wish there was a\n> git-remove-trailers, or a %B:trailers=false format string, or something\n> similar. It shouldn't be too difficult to implement with awk, but that's\n> really bikeshedding, I won't insist :-)\n\nI'm going to leave this as is.\n\n> \n> > v3\n> >  - Improve error message\n> >  - Remove redundant git add\n> > \n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  utils/release.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 46 insertions(+)\n> >  create mode 100755 utils/release.sh\n> > \n> > diff --git a/utils/release.sh b/utils/release.sh\n> > new file mode 100755\n> > index 000000000000..6b4e081ba179\n> > --- /dev/null\n> > +++ b/utils/release.sh\n> > @@ -0,0 +1,46 @@\n> > +#!/bin/sh\n> > +\n> > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > +# Prepare a project release\n> > +\n> > +set -e\n> > +\n> > +# Abort if we are not within the project root or the tree is not clean.\n> > +if [ ! -e utils/gen-version.sh ] || [ ! -e .git ]; then\n> > +     echo \"This release script must be run from the root of libcamera git tree.\"\n> > +     exit 1\n> > +fi\n> > +\n> > +if ! git diff-index --quiet HEAD; then\n> > +     echo \"Tree must be clean to release.\"\n> > +     exit 1\n> > +fi\n> > +\n> > +# Identify current version components\n> > +version=$(./utils/gen-version.sh)\n> > +\n> > +# Decide if we are here to bump major, minor, or patch release.\n> > +case $1 in\n> > +     major|minor|patch)\n> > +             bump=$1;\n> > +             ;;\n> > +     *)\n> > +             echo \"You must specify the version bump level: (major, minor, patch)\"\n> > +             exit 1\n> > +             ;;\n> > +esac\n> > +\n> > +new_version=$(./utils/semver bump \"$bump\" \"$version\")\n> > +\n> > +echo \"Bumping $bump\"\n> > +echo \"  Existing version is: $version\"\n> > +echo \"  New version is : $new_version\"\n> > +\n> > +# Patch in the version to our meson.build\n> > +sed -i -E \"s/ version : '.*',/ version : '$new_version',/\" meson.build\n> > +\n> > +# Commit the update\n> > +git commit meson.build -esm \"libcamera v$new_version\"\n> > +\n> > +# Create a tag from that commit\n> > +git show -s --format=%B | git tag \"v$new_version\" -as -F -\n> \n> Do you need -a for git-tag ? According to the man page,\n> \n>        -a, --annotate\n>            Make an unsigned, annotated tag object\n> \n>        -s, --sign\n>            Make a GPG-signed tag, using the default e-mail address’s\n>            key. The default behavior of tag GPG-signing is controlled by\n>            tag.gpgSign configuration variable if it exists, or disabled\n>            otherwise. See git-config(1).\n> \n> I think -s is enough.\n\nAh, ok - I thought -a was the request to annotate it with a message. If\nthat's already implicit ... that's fine. It works with it anyway, but I\ncan drop it as long as it all still works.\n\n\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 568D0BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Oct 2022 11:19:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CDCFE62DAB;\n\tThu, 13 Oct 2022 13:19:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DCEB62D6B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Oct 2022 13:19:44 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D949D492;\n\tThu, 13 Oct 2022 13:19:43 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665659985;\n\tbh=fKxnmt0hXmt45F1wb3DflOmRyhNR91P400gfwukwlQs=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=g7c/VsM9HB8qn/qFs1MUwmUVGl9aWTYPtL3z1/3QytckzSbSjpVbwIIdLMN6UoVCQ\n\tIJXbb4E8qxFqvYbTXPT3fAWIo8zDKnXUYe3aEUll3cDw7c8B0RIZbNzI+ZfZL44xV6\n\tr1AFje//v+MxQnqbfa8hisOBQn/ISvOV6bPA8Iwq9zZkMa1IScgd+jWC7i+8r6koed\n\trzWSX80O5yd8tos7jjol56JUuwO3yZ3Cm+P1+5ucGIuVjM5ncWnlVdsMS60WgoMwKx\n\tz3z5thdHu8KH/qZ0BjsPe3/wsTyvmYT6EXwflSK8bTTWp+7SA5tv1LM3qgCMbEcdx6\n\tWCnAU7LrlvfBQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665659984;\n\tbh=fKxnmt0hXmt45F1wb3DflOmRyhNR91P400gfwukwlQs=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=mNwo72vfGCR2ETE0hFIQ1LnVhyI1c6I+2A38OuLETtfkgMhtS+EmbiwjQ1owKiVgz\n\tSFkGVLfxF3+POGJg/3nkKv3hTJk9dau0J4YyZpXR+qU7Q9wZ2RW82X8mzaLSyKYgfZ\n\txU91LCMcxP2lYldAbbKFtL7MqKoRRIKqqfVyFIVM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"mNwo72vf\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<Y0frHB7jeik1SkQp@pendragon.ideasonboard.com>","References":"<20221013095957.1642901-1-kieran.bingham@ideasonboard.com>\n\t<20221013095957.1642901-4-kieran.bingham@ideasonboard.com>\n\t<Y0frHB7jeik1SkQp@pendragon.ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Thu, 13 Oct 2022 12:19:41 +0100","Message-ID":"<166565998115.1683026.14215370396236630171@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v4 3/3] utils: Provide a release script","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]