[{"id":25185,"web_url":"https://patchwork.libcamera.org/comment/25185/","msgid":"<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>","date":"2022-09-30T15:35:28","subject":"Re: [libcamera-devel] [PATCH 4/4] utils: Provide a release script","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Kieran\n\nOn Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> ---\n> This can later be extended to support or enforce adding an overview\n> changelog to the commit, and annotated tag.\n>\n>  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 48 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..c1c35dacab8e\n> --- /dev/null\n> +++ b/utils/release.sh\n> @@ -0,0 +1,48 @@\n> +#!/bin/sh\n> +\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +# Prepare a project release\n> +\n> +# Abort if we are not within the project root or the tree is not clean.\n> +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n> +\techo \"This release script must be run from the root of libcamera git clone.\"\n> +\texit 1\n> +fi\n> +\n> +if ! git diff-index --quiet HEAD; then\n\nTook me a while to validate this as --quite implies --exit-code which\nis documented as:\n\nMake the program exit with codes similar to diff(1). That is, it exits\nwith 1 if there were differences and 0 means no differences.\n\nBut in bash an exit code 0 mean success, so it's right to negate it\n\n\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:\"\n> +\t\techo \" - major\"\n> +\t\techo \" - minor\"\n> +\t\techo \" - 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 add meson.build\n> +git commit meson.build -m \"libcamera v$new_version\"\n> +\n> +# Create a tag\n> +git tag v$new_version -am \"libcamera v$new_version\"\n\nThe rest looks good\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> --\n> 2.34.1\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 D547EBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 15:35:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0656B623AA;\n\tFri, 30 Sep 2022 17:35:32 +0200 (CEST)","from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6DEF361F77\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Sep 2022 17:35:30 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id C33CAE0008;\n\tFri, 30 Sep 2022 15:35:29 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664552132;\n\tbh=qiOTE+Ilj66hUx4LbCmbi9OpEp7o6vTF7mI1YuAcvDw=;\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=wrbhshJWL1RgCkcyhW/B9MefGe8BVy74aEwVjo1qHzdbstAy5RKKzw6qMcAZ4QLdc\n\tGrGMHTNbp+TgKUcx8IdA9Rihadeuyyhimr3ATp8GcJFUQQeKp0RkrfkiRx8XIZbIDV\n\tl10QCAHsNbqhhni1bk/jQ3khh2oZqOpz9AOh3jCnp+I/vGPEWhq5OO2r3ztmJmjxnt\n\tJXFpkNprK7XWgaqj9pE+pQuvsdw7scWKVKjDxQ2bPTI2xA8suBNhXgepTBVju2oSQL\n\tAl5Woy5+XFrOZHRKFqoBEf4sBdq/afpCEGL7SuH1FngE/Zwepca9NF+3tGvozECjrX\n\t4aEat9L9s4PZQ==","Date":"Fri, 30 Sep 2022 17:35:28 +0200","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","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":25188,"web_url":"https://patchwork.libcamera.org/comment/25188/","msgid":"<166455261154.2677993.2054565267058488079@Monstersaurus>","date":"2022-09-30T15:43:31","subject":"Re: [libcamera-devel] [PATCH 4/4] 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 Jacopo Mondi (2022-09-30 16:35:28)\n> Hi Kieran\n> \n> On Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >\n> > ---\n> > This can later be extended to support or enforce adding an overview\n> > changelog to the commit, and annotated tag.\n> >\n> >  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 48 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..c1c35dacab8e\n> > --- /dev/null\n> > +++ b/utils/release.sh\n> > @@ -0,0 +1,48 @@\n> > +#!/bin/sh\n> > +\n> > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > +# Prepare a project release\n> > +\n> > +# Abort if we are not within the project root or the tree is not clean.\n> > +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n> > +     echo \"This release script must be run from the root of libcamera git clone.\"\n> > +     exit 1\n> > +fi\n> > +\n> > +if ! git diff-index --quiet HEAD; then\n> \n> Took me a while to validate this as --quite implies --exit-code which\n> is documented as:\n> \n> Make the program exit with codes similar to diff(1). That is, it exits\n> with 1 if there were differences and 0 means no differences.\n> \n> But in bash an exit code 0 mean success, so it's right to negate it\n\nYes, we use this in utils/gen-version.sh\n\n\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:\"\n> > +             echo \" - major\"\n> > +             echo \" - minor\"\n> > +             echo \" - 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 add meson.build\n> > +git commit meson.build -m \"libcamera v$new_version\"\n> > +\n> > +# Create a tag\n> > +git tag v$new_version -am \"libcamera v$new_version\"\n> \n> The rest looks good\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> Thanks\n>   j\n> \n> > --\n> > 2.34.1\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 3CFDCBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 15:43:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E2EBA623AF;\n\tFri, 30 Sep 2022 17:43:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CFF1623AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Sep 2022 17:43:34 +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 D9D9547C;\n\tFri, 30 Sep 2022 17:43:33 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664552615;\n\tbh=UfDa9f62CLIbJXffnCwEmDwZgSUX33ikhBacUKNSagw=;\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=QCvpRzxGxo3VABnybBZMa6gyjkUvWozWPpt53IgxztZRPnlrLmZBLNn6cKQFGpJcE\n\tQ4k3FzTFEUXhDFyU03roRSn+L/p/q4xTajnS8E1Hn8eGx7Ca3mswWILmMHluTC9xs0\n\teyKstpEgVjs2zFVUvHhTkiam4HPMDk7V4ZK0vLSUlUS9aVztFIF00q8SXsKs48w3i3\n\tfMFVO7rAyf3z31N49CBfaKIkTKWZ7dLhOnnZALxi92+GWyFm4MpzVM8JGZfoaOkR8b\n\t+5pe1wWIOfvlnMhxo3j4fYS2qE6DZWPNQUT68hc9ZJn9i/+kv9gb0MFe1QQF9YF/eO\n\tXhDkGNSOqis1g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664552614;\n\tbh=UfDa9f62CLIbJXffnCwEmDwZgSUX33ikhBacUKNSagw=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ca4W06ny7otzm9Q0YOziFnj+PNQEwFlrLR8aX6vSkPXtYQrb34fnNoMD59a3clns3\n\tC74YMrQuZb52fzWqxkwCYhhJuq3BWZtH8WRcl5pctFXN9fB/0s5LuKanOC2l0jcIsX\n\t8+1mDLGi+qBsWouwVZdS3exLNRaR/WvyZ/JsTGx8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ca4W06ny\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>\n\t<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>","To":"Jacopo Mondi <jacopo@jmondi.org>","Date":"Fri, 30 Sep 2022 16:43:31 +0100","Message-ID":"<166455261154.2677993.2054565267058488079@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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>"}},{"id":25199,"web_url":"https://patchwork.libcamera.org/comment/25199/","msgid":"<YzdTg5jobifnITeu@pendragon.ideasonboard.com>","date":"2022-09-30T20:37:23","subject":"Re: [libcamera-devel] [PATCH 4/4] 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 Fri, Sep 30, 2022 at 04:43:31PM +0100, Kieran Bingham via libcamera-devel wrote:\n> Quoting Jacopo Mondi (2022-09-30 16:35:28)\n> > On Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > >\n> > > ---\n> > > This can later be extended to support or enforce adding an overview\n> > > changelog to the commit, and annotated tag.\n> > >\n> > >  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n> > >  1 file changed, 48 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..c1c35dacab8e\n> > > --- /dev/null\n> > > +++ b/utils/release.sh\n> > > @@ -0,0 +1,48 @@\n> > > +#!/bin/sh\n> > > +\n> > > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > > +# Prepare a project release\n> > > +\n> > > +# Abort if we are not within the project root or the tree is not clean.\n> > > +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n\ngen-version.sh uses\n\n# Bail out if the directory isn't under git control\ngit_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n\nwhich makes sure that the .git directory contains something valid.\n\n> > > +     echo \"This release script must be run from the root of libcamera git clone.\"\n\ns/libcamera git clone/a libcamera git tree/\n\n> > > +     exit 1\n> > > +fi\n> > > +\n> > > +if ! git diff-index --quiet HEAD; then\n> > \n> > Took me a while to validate this as --quite implies --exit-code which\n> > is documented as:\n> > \n> > Make the program exit with codes similar to diff(1). That is, it exits\n> > with 1 if there were differences and 0 means no differences.\n> > \n> > But in bash an exit code 0 mean success, so it's right to negate it\n> \n> Yes, we use this in utils/gen-version.sh\n> \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\nHmmm... gen-version.sh retrieves the version from git tags only, and now\nwe're also bumping the project version in the root meson.build. With the\ncurrent implementation, the project version is used as a fallback only,\nif gen-version.sh fails. Is this something we need to revisit ? Do we\nneed to worry about a mismatch between the two ? It can be handling on\ntop, but I'd like to hear your opinion.\n\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:\"\n> > > +             echo \" - major\"\n> > > +             echo \" - minor\"\n> > > +             echo \" - patch\"\n\nThis could hold on one line:\n\n\t\techo \"You must specify the version bump level (major, minor, patch)\"\n\nUp to you.\n\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 add meson.build\n> > > +git commit meson.build -m \"libcamera v$new_version\"\n\nYou can drop meson.build here. I would also add -s to add a SoB line.\n\n> > > +\n> > > +# Create a tag\n> > > +git tag v$new_version -am \"libcamera v$new_version\"\n\nAnd here too, -s, to sign the tag.\n\n> > The rest looks good\n> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>","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 F0558BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 20:37:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8124D62844;\n\tFri, 30 Sep 2022 22:37:27 +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 1E9F361FB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Sep 2022 22:37:26 +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 5366147C;\n\tFri, 30 Sep 2022 22:37:25 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664570247;\n\tbh=eI3rwEr8xcMKLAFi74DuO8r17kSCo/zOjqwK80N40zo=;\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=E7STwHsFJn9gyvo/XZyPNsQiBvRyuNx7I5D0Y33R0o+LFJFz7Qynrs3hM+QnhU7si\n\tNswykKuxkJ/Gl65GgEgIaNeVy+bzmfMkqw/98pl72P0K/26+42c/hZy7niIlW9U5Lo\n\tNBpCf7PXhDoPDguaVXZ5mDlcXIj8QsWUtVtBBzzKMKOn8ELTVhvmahU430wAUzkjxn\n\td/ysfrLQSrq7iZx76EiopxD+3Om86XqkboZIAH84MMNWe4PT09f1QadXLrVfai1ts2\n\tP/nL/VcTyJ8zclHTLG9oRSqOAovwriQM2zA1CCjYnjU+nfUkNTDdmaB3v5cVSIgAAx\n\tBWgiiQNjts0ew==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664570245;\n\tbh=eI3rwEr8xcMKLAFi74DuO8r17kSCo/zOjqwK80N40zo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Vd1ZYi2LVdnF9mzfgRLrfaL17EIfUfNBHzpXvFlI4GH+2pilRpjALukDv2Wp44/5K\n\td+5unxM0wP/mYtmVJPMmHQ/o6L7dKgwAFXd/61lGkGrF6RMEjD7hPK34tirYcaymha\n\tkBuFm2u1yecVOWOD727Dt22SpX67faYxPF1F8+Wk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Vd1ZYi2L\"; dkim-atps=neutral","Date":"Fri, 30 Sep 2022 23:37:23 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YzdTg5jobifnITeu@pendragon.ideasonboard.com>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>\n\t<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>\n\t<166455261154.2677993.2054565267058488079@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<166455261154.2677993.2054565267058488079@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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":25204,"web_url":"https://patchwork.libcamera.org/comment/25204/","msgid":"<YzdY0LYYJmMi44rW@pendragon.ideasonboard.com>","date":"2022-09-30T21:00:00","subject":"Re: [libcamera-devel] [PATCH 4/4] 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":"Another comment.\n\nOn Fri, Sep 30, 2022 at 11:37:23PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Fri, Sep 30, 2022 at 04:43:31PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > Quoting Jacopo Mondi (2022-09-30 16:35:28)\n> > > On Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> > > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > >\n> > > > ---\n> > > > This can later be extended to support or enforce adding an overview\n> > > > changelog to the commit, and annotated tag.\n> > > >\n> > > >  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n> > > >  1 file changed, 48 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..c1c35dacab8e\n> > > > --- /dev/null\n> > > > +++ b/utils/release.sh\n> > > > @@ -0,0 +1,48 @@\n> > > > +#!/bin/sh\n> > > > +\n> > > > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > > > +# Prepare a project release\n> > > > +\n> > > > +# Abort if we are not within the project root or the tree is not clean.\n> > > > +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n> \n> gen-version.sh uses\n> \n> # Bail out if the directory isn't under git control\n> git_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n> \n> which makes sure that the .git directory contains something valid.\n> \n> > > > +     echo \"This release script must be run from the root of libcamera git clone.\"\n> \n> s/libcamera git clone/a libcamera git tree/\n> \n> > > > +     exit 1\n> > > > +fi\n> > > > +\n> > > > +if ! git diff-index --quiet HEAD; then\n> > > \n> > > Took me a while to validate this as --quite implies --exit-code which\n> > > is documented as:\n> > > \n> > > Make the program exit with codes similar to diff(1). That is, it exits\n> > > with 1 if there were differences and 0 means no differences.\n> > > \n> > > But in bash an exit code 0 mean success, so it's right to negate it\n> > \n> > Yes, we use this in utils/gen-version.sh\n> > \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> Hmmm... gen-version.sh retrieves the version from git tags only, and now\n> we're also bumping the project version in the root meson.build. With the\n> current implementation, the project version is used as a fallback only,\n> if gen-version.sh fails. Is this something we need to revisit ? Do we\n> need to worry about a mismatch between the two ? It can be handling on\n> top, but I'd like to hear your opinion.\n> \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:\"\n> > > > +             echo \" - major\"\n> > > > +             echo \" - minor\"\n> > > > +             echo \" - patch\"\n> \n> This could hold on one line:\n> \n> \t\techo \"You must specify the version bump level (major, minor, patch)\"\n> \n> Up to you.\n> \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\nMaybe I worry too much, but this could be made safer with\n\nsed -i -E \"0,/ version : '.*',/{s/ version : '.*',/ version : '$new_version',/}\" meson.build\n\nto only replace the first occurrence (credits go to\nhttps://stackoverflow.com/questions/148451/how-to-use-sed-to-replace-only-the-first-occurrence-in-a-file).\n\n> > > > +\n> > > > +# Commit the update\n> > > > +git add meson.build\n> > > > +git commit meson.build -m \"libcamera v$new_version\"\n> \n> You can drop meson.build here. I would also add -s to add a SoB line.\n> \n> > > > +\n> > > > +# Create a tag\n> > > > +git tag v$new_version -am \"libcamera v$new_version\"\n> \n> And here too, -s, to sign the tag.\n> \n> > > The rest looks good\n> > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>","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 4DA87C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 21:00:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A6C1B62848;\n\tFri, 30 Sep 2022 23:00:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 59A3C61FB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Sep 2022 23:00:03 +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 B071A47C;\n\tFri, 30 Sep 2022 23:00:02 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664571604;\n\tbh=bPkV4vMBlEu6f+WNDR3Boo5Algq4TBrmE8a/VRGw/Pk=;\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:\n\tFrom;\n\tb=pVvgQ64u+IvJxGEoqLrGrUwn9ARfXXnaTc92yV0wlbdDfqLUIQu2qh4xmcOqF0A/b\n\tE/7Wmj01jCfc7hd/l1MaD3VomUkI8mopwPA9Tv6BokoGAEZTvqGNhh/KHF3F5T8fCX\n\tGRwr4pKrLdkg79X/G0KB9o7wRG8al1wnZOSAjHNM2jSjSV4yJ4fQ1GTUfdx1GIcSfl\n\tPMO6dMug+vkIuZ9zXz+TgGiCA/98sh8N8xpakKVZgblG2pE756FmfWdqbk4x7gURbq\n\t/22Go/GBWd0URDxXbYnbrEiMLl+SeyG8oxCX40SfKICKRKRccilnTEwyu/txvM646z\n\tvcRWopAiz5WBA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664571602;\n\tbh=bPkV4vMBlEu6f+WNDR3Boo5Algq4TBrmE8a/VRGw/Pk=;\n\th=Date:From:To:Subject:References:In-Reply-To:From;\n\tb=mcOF76WAsPXhEXjXBfaYAo9HF55iEeHCdDw+Jcv2f3KtWnzYDQIegnDUh+HE1PRfo\n\t+z5twThulSzrxziAvMejetCN4t+MSEpObGnaIHQ5NeuuKqgs8jOy/5Z8fx7/VtQ/bS\n\tOGmpLADCqJrVdKFfvUR5yJWYh3k2b6EFkFvK1cK8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"mcOF76WA\"; dkim-atps=neutral","Date":"Sat, 1 Oct 2022 00:00:00 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<YzdY0LYYJmMi44rW@pendragon.ideasonboard.com>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>\n\t<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>\n\t<166455261154.2677993.2054565267058488079@Monstersaurus>\n\t<YzdTg5jobifnITeu@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YzdTg5jobifnITeu@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25206,"web_url":"https://patchwork.libcamera.org/comment/25206/","msgid":"<166457572636.4106166.11085235309867130328@Monstersaurus>","date":"2022-09-30T22:08:46","subject":"Re: [libcamera-devel] [PATCH 4/4] 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-09-30 21:37:23)\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Fri, Sep 30, 2022 at 04:43:31PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > Quoting Jacopo Mondi (2022-09-30 16:35:28)\n> > > On Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> > > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > >\n> > > > ---\n> > > > This can later be extended to support or enforce adding an overview\n> > > > changelog to the commit, and annotated tag.\n> > > >\n> > > >  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n> > > >  1 file changed, 48 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..c1c35dacab8e\n> > > > --- /dev/null\n> > > > +++ b/utils/release.sh\n> > > > @@ -0,0 +1,48 @@\n> > > > +#!/bin/sh\n> > > > +\n> > > > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > > > +# Prepare a project release\n> > > > +\n> > > > +# Abort if we are not within the project root or the tree is not clean.\n> > > > +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n> \n> gen-version.sh uses\n> \n> # Bail out if the directory isn't under git control\n> git_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n> \n> which makes sure that the .git directory contains something valid.\n\nI can't use that here. (And maybe we need to update gen-version).\n\nI want to be certain that we are within the git repository for\nlibcamera. Not an un-tracked sources (for example an extracted tar ball)\nthat has another parent directory which is controlled by git.\n\n\n> \n> > > > +     echo \"This release script must be run from the root of libcamera git clone.\"\n> \n> s/libcamera git clone/a libcamera git tree/\n> \n> > > > +     exit 1\n> > > > +fi\n> > > > +\n> > > > +if ! git diff-index --quiet HEAD; then\n> > > \n> > > Took me a while to validate this as --quite implies --exit-code which\n> > > is documented as:\n> > > \n> > > Make the program exit with codes similar to diff(1). That is, it exits\n> > > with 1 if there were differences and 0 means no differences.\n> > > \n> > > But in bash an exit code 0 mean success, so it's right to negate it\n> > \n> > Yes, we use this in utils/gen-version.sh\n> > \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> Hmmm... gen-version.sh retrieves the version from git tags only, and now\n> we're also bumping the project version in the root meson.build. With the\n> current implementation, the project version is used as a fallback only,\n> if gen-version.sh fails. Is this something we need to revisit ? Do we\n> need to worry about a mismatch between the two ? It can be handling on\n> top, but I'd like to hear your opinion.\n\nThat's why the meson version summary reports both.\n\n\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:\"\n> > > > +             echo \" - major\"\n> > > > +             echo \" - minor\"\n> > > > +             echo \" - patch\"\n> \n> This could hold on one line:\n> \n>                 echo \"You must specify the version bump level (major, minor, patch)\"\n> \n> Up to you.\n> \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 add meson.build\n> > > > +git commit meson.build -m \"libcamera v$new_version\"\n> \n> You can drop meson.build here. I would also add -s to add a SoB line.\n\nI wanted it to be explicit that /only/ meson.build is to be commited.\n\n> \n> > > > +\n> > > > +# Create a tag\n> > > > +git tag v$new_version -am \"libcamera v$new_version\"\n> \n> And here too, -s, to sign the tag.\n> \n> > > The rest looks good\n> > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\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 A7742C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 22:08:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1517062850;\n\tSat,  1 Oct 2022 00:08:50 +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 1398F62272\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Oct 2022 00:08:49 +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 6355359D;\n\tSat,  1 Oct 2022 00:08:48 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664575730;\n\tbh=sQ0gmQw9uao7D5Zh16JYNtFbkrSCePhFJOB3gBvxOEU=;\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=gWPFVMSVMGGb7PSYizlfPUQgsHQUbI3X99NXwV+7vitCtp75kpHVAxOK73gnO+kKF\n\tYf/s6nyKQGt5vomeQEjEEPKHPOgO/9hbquTUn9f5vNngGR3Vb1xdNXnLjsGdMrEunv\n\tXeYYtK4DdTlOM5QCLhDomdgpSKYLd81B8sFmvPTNUgzwZKwLO636j0no9Dg8PTbFaB\n\tf8P0K8aQSbR2ql1qgwLjpUhR+qWcJoDj4nlX+bmlqakb+bp/1HwCe0mZRCR9tX/0pX\n\trdCY9BN9EKr8ycdET09ePWw5++dMH8Wgya4IrW/MxnsPG+60EzNbQrr1q/CFrSQDrN\n\tDF7vsdXFNWv1g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664575728;\n\tbh=sQ0gmQw9uao7D5Zh16JYNtFbkrSCePhFJOB3gBvxOEU=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=onjPQ51tYA2sLB3vrMJDc8Pj5PMuHNLDt3xG9XgZufPcYRaxQrBZ98OLPjovSuPzy\n\th+kPQUo+8hKg8RzP+ZfSWi6RwP7mp26/2BnoYxECr43VgjL+gCf/Hs5awQ4uhNyOxI\n\tSDwDNx99TPG5R6LIUoytlXFtRtQxE473jDcauNtc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"onjPQ51t\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YzdTg5jobifnITeu@pendragon.ideasonboard.com>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>\n\t<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>\n\t<166455261154.2677993.2054565267058488079@Monstersaurus>\n\t<YzdTg5jobifnITeu@pendragon.ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Fri, 30 Sep 2022 23:08:46 +0100","Message-ID":"<166457572636.4106166.11085235309867130328@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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>"}},{"id":25207,"web_url":"https://patchwork.libcamera.org/comment/25207/","msgid":"<166457595065.4106166.13999558526233089549@Monstersaurus>","date":"2022-09-30T22:12:30","subject":"Re: [libcamera-devel] [PATCH 4/4] 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-09-30 22:00:00)\n> Another comment.\n> \n> On Fri, Sep 30, 2022 at 11:37:23PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > Hi Kieran,\n> > \n> > Thank you for the patch.\n> > \n> > On Fri, Sep 30, 2022 at 04:43:31PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > Quoting Jacopo Mondi (2022-09-30 16:35:28)\n> > > > On Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> > > > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > > >\n> > > > > ---\n> > > > > This can later be extended to support or enforce adding an overview\n> > > > > changelog to the commit, and annotated tag.\n> > > > >\n> > > > >  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n> > > > >  1 file changed, 48 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..c1c35dacab8e\n> > > > > --- /dev/null\n> > > > > +++ b/utils/release.sh\n> > > > > @@ -0,0 +1,48 @@\n> > > > > +#!/bin/sh\n> > > > > +\n> > > > > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > > > > +# Prepare a project release\n> > > > > +\n> > > > > +# Abort if we are not within the project root or the tree is not clean.\n> > > > > +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n> > \n> > gen-version.sh uses\n> > \n> > # Bail out if the directory isn't under git control\n> > git_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n> > \n> > which makes sure that the .git directory contains something valid.\n> > \n> > > > > +     echo \"This release script must be run from the root of libcamera git clone.\"\n> > \n> > s/libcamera git clone/a libcamera git tree/\n> > \n> > > > > +     exit 1\n> > > > > +fi\n> > > > > +\n> > > > > +if ! git diff-index --quiet HEAD; then\n> > > > \n> > > > Took me a while to validate this as --quite implies --exit-code which\n> > > > is documented as:\n> > > > \n> > > > Make the program exit with codes similar to diff(1). That is, it exits\n> > > > with 1 if there were differences and 0 means no differences.\n> > > > \n> > > > But in bash an exit code 0 mean success, so it's right to negate it\n> > > \n> > > Yes, we use this in utils/gen-version.sh\n> > > \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> > Hmmm... gen-version.sh retrieves the version from git tags only, and now\n> > we're also bumping the project version in the root meson.build. With the\n> > current implementation, the project version is used as a fallback only,\n> > if gen-version.sh fails. Is this something we need to revisit ? Do we\n> > need to worry about a mismatch between the two ? It can be handling on\n> > top, but I'd like to hear your opinion.\n> > \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:\"\n> > > > > +             echo \" - major\"\n> > > > > +             echo \" - minor\"\n> > > > > +             echo \" - patch\"\n> > \n> > This could hold on one line:\n> > \n> >               echo \"You must specify the version bump level (major, minor, patch)\"\n> > \n> > Up to you.\n> > \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> Maybe I worry too much, but this could be made safer with\n> \n> sed -i -E \"0,/ version : '.*',/{s/ version : '.*',/ version : '$new_version',/}\" meson.build\n\nIf another \" version : 'xxx',\" string gets added to this top level\nmeson.build then I'd expect it to be updated too. I can't see a reason\nto add such a line, and if one's added, I think it should be considered\nthen. So I'd actually rather it matched right now.\n\n\n> \n> to only replace the first occurrence (credits go to\n> https://stackoverflow.com/questions/148451/how-to-use-sed-to-replace-only-the-first-occurrence-in-a-file).\n> \n> > > > > +\n> > > > > +# Commit the update\n> > > > > +git add meson.build\n> > > > > +git commit meson.build -m \"libcamera v$new_version\"\n> > \n> > You can drop meson.build here. I would also add -s to add a SoB line.\n> > \n> > > > > +\n> > > > > +# Create a tag\n> > > > > +git tag v$new_version -am \"libcamera v$new_version\"\n> > \n> > And here too, -s, to sign the tag.\n> > \n> > > > The rest looks good\n> > > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\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 830EABD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 22:12:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C7CBB62852;\n\tSat,  1 Oct 2022 00:12:35 +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 09AE862272\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Oct 2022 00:12:34 +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 7C89D59D;\n\tSat,  1 Oct 2022 00:12:33 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664575955;\n\tbh=O6vvLE9V+gHCQpmhAPNMleYzAb5TfT0K4rZ9QKAy62Q=;\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:\n\tFrom;\n\tb=uDp3CQU+BQZyz5SqR3NPl4JuklOtKUYkixPZE6WTHPlVI97afPBRJ3N+eHOzTILMf\n\tUTGP2qxJ3KoJ1um8GAnqN1H1TMcVNII9VJ67OBudEQliDADceT7oZc0WcOTpB+N6nk\n\tbKk8Un/74BKZuOTDWWLtlSjAn7AgIB75k/WCyleEmzmnA/lw/icVKhwlCl9qogNZmC\n\trHPhhxnQI99NjUdHvcPK5+46HXO0KqRn5hwxQAFe9HZgoDMNXt6ksweptE3vZOCcCl\n\tvGyLKIs3Pqba4VO0aEXnJ4nOxP80n/CMITdn3CyzbE3v6r95dXidTYhW5qkUMorIIj\n\tjLbmInAoFwLzw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664575953;\n\tbh=O6vvLE9V+gHCQpmhAPNMleYzAb5TfT0K4rZ9QKAy62Q=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=szHhlpOt3E+5yzkgOmerM74UwExivy55oWZG8V5himvvdebz+NWZuvXxjysBGnoPR\n\tKUlO5o/UkSQRZUzC3IY4rFACRRJS0mG2Cfk4WYBNARnvx45/2EiMxC9D8wJimQvN8j\n\tFL5IUtKwH+eXmVT7I6wgW1i8iwrEeeTVmS3q31lw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"szHhlpOt\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YzdY0LYYJmMi44rW@pendragon.ideasonboard.com>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>\n\t<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>\n\t<166455261154.2677993.2054565267058488079@Monstersaurus>\n\t<YzdTg5jobifnITeu@pendragon.ideasonboard.com>\n\t<YzdY0LYYJmMi44rW@pendragon.ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Fri, 30 Sep 2022 23:12:30 +0100","Message-ID":"<166457595065.4106166.13999558526233089549@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25208,"web_url":"https://patchwork.libcamera.org/comment/25208/","msgid":"<YzdzOzGM/9kK87IX@pendragon.ideasonboard.com>","date":"2022-09-30T22:52:43","subject":"Re: [libcamera-devel] [PATCH 4/4] 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":"On Fri, Sep 30, 2022 at 11:12:30PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2022-09-30 22:00:00)\n> > On Fri, Sep 30, 2022 at 11:37:23PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > > On Fri, Sep 30, 2022 at 04:43:31PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > Quoting Jacopo Mondi (2022-09-30 16:35:28)\n> > > > > On Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> > > > > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > > > >\n> > > > > > ---\n> > > > > > This can later be extended to support or enforce adding an overview\n> > > > > > changelog to the commit, and annotated tag.\n> > > > > >\n> > > > > >  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n> > > > > >  1 file changed, 48 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..c1c35dacab8e\n> > > > > > --- /dev/null\n> > > > > > +++ b/utils/release.sh\n> > > > > > @@ -0,0 +1,48 @@\n> > > > > > +#!/bin/sh\n> > > > > > +\n> > > > > > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > > > > > +# Prepare a project release\n> > > > > > +\n> > > > > > +# Abort if we are not within the project root or the tree is not clean.\n> > > > > > +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n\nBy the way, I'm getting warnings from checkstyle.py:\n\n------------------------------------------------------------------------\n288cd54b98a5ff80a65022ce577081b0ebf9d12a utils: Provide a release script\n------------------------------------------------------------------------\n--- utils/release.sh\n+++ utils/release.sh\n#7:                                ^-- SC2166 (warning): Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.\n+if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n#48:          ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.\n+git tag v$new_version -am \"libcamera v$new_version\"\n\n> > > gen-version.sh uses\n> > > \n> > > # Bail out if the directory isn't under git control\n> > > git_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n> > > \n> > > which makes sure that the .git directory contains something valid.\n> > > \n> > > > > > +     echo \"This release script must be run from the root of libcamera git clone.\"\n> > > \n> > > s/libcamera git clone/a libcamera git tree/\n> > > \n> > > > > > +     exit 1\n> > > > > > +fi\n> > > > > > +\n> > > > > > +if ! git diff-index --quiet HEAD; then\n> > > > > \n> > > > > Took me a while to validate this as --quite implies --exit-code which\n> > > > > is documented as:\n> > > > > \n> > > > > Make the program exit with codes similar to diff(1). That is, it exits\n> > > > > with 1 if there were differences and 0 means no differences.\n> > > > > \n> > > > > But in bash an exit code 0 mean success, so it's right to negate it\n> > > > \n> > > > Yes, we use this in utils/gen-version.sh\n> > > > \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> > > Hmmm... gen-version.sh retrieves the version from git tags only, and now\n> > > we're also bumping the project version in the root meson.build. With the\n> > > current implementation, the project version is used as a fallback only,\n> > > if gen-version.sh fails. Is this something we need to revisit ? Do we\n> > > need to worry about a mismatch between the two ? It can be handling on\n> > > top, but I'd like to hear your opinion.\n> > > \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:\"\n> > > > > > +             echo \" - major\"\n> > > > > > +             echo \" - minor\"\n> > > > > > +             echo \" - patch\"\n> > > \n> > > This could hold on one line:\n> > > \n> > >               echo \"You must specify the version bump level (major, minor, patch)\"\n> > > \n> > > Up to you.\n> > > \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> > Maybe I worry too much, but this could be made safer with\n> > \n> > sed -i -E \"0,/ version : '.*',/{s/ version : '.*',/ version : '$new_version',/}\" meson.build\n> \n> If another \" version : 'xxx',\" string gets added to this top level\n> meson.build then I'd expect it to be updated too. I can't see a reason\n> to add such a line, and if one's added, I think it should be considered\n> then. So I'd actually rather it matched right now.\n\nIt's hard to predict what those other matches for the regexp would be,\nso both arguments can make sense. We'll see it anyway, so I'm fine with\nthis.\n\n> > to only replace the first occurrence (credits go to\n> > https://stackoverflow.com/questions/148451/how-to-use-sed-to-replace-only-the-first-occurrence-in-a-file).\n> > \n> > > > > > +\n> > > > > > +# Commit the update\n> > > > > > +git add meson.build\n> > > > > > +git commit meson.build -m \"libcamera v$new_version\"\n> > > \n> > > You can drop meson.build here. I would also add -s to add a SoB line.\n> > > \n> > > > > > +\n> > > > > > +# Create a tag\n> > > > > > +git tag v$new_version -am \"libcamera v$new_version\"\n> > > \n> > > And here too, -s, to sign the tag.\n> > > \n> > > > > The rest looks good\n> > > > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>","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 BD4B4C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 22:52:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 232C261F75;\n\tSat,  1 Oct 2022 00:52:48 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3644D61F75\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Oct 2022 00:52:47 +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 85B9059D;\n\tSat,  1 Oct 2022 00:52:46 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664578368;\n\tbh=AR7UHuN+oe3RUxFJNuimS0aB8g8E3vtBEMij/TqjuNQ=;\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=t95p/wrt3w1Lgg55LthziAT2zoceX3GvWh3WN7J6/zG9BUgzPFiwbViCnSQZQZgZD\n\t74Iwxz1+aliIVCXaqzULpmi7zBpMc7oo/N4l5wj7K+0umDVOMDCIlz+ilXsylpKECe\n\tLpdOia9GZHKOTkjsWVTtIw+HMOwgYIVxbzTqwj+QrFzg8mKjkOowaqZfYbrex4Rkt6\n\tUZ2kP+m3X/I4R0ZlyjFwFgAeYC8u0byyGyVponlxgl1fdA14o8DTFL00/7P5+62jZo\n\tEtyC1WFUHmlqQe/6C5Aa1WLxRU0aXOZFbJ3JhXXFsjFcj5Aw1GDFW3lzXpdP0bD1u8\n\toOSKon4qphSYA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664578366;\n\tbh=AR7UHuN+oe3RUxFJNuimS0aB8g8E3vtBEMij/TqjuNQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=iSkWw7RCPmCwU6vX56gG1ygtcHA+3xjzS/SERILCXe6yb5IuTDj0BkckMpP4MGIs7\n\tc7ZxmvnaPDBz4ZxyxyKmXQV9fomrd15pma0BMuITMgqpOKVPL+AsjZ8CPyRsCbwZdL\n\tvfse5FQHYrOcQBqI7dGe9YhsgKtsnHwdUnN+AG4g="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"iSkWw7RC\"; dkim-atps=neutral","Date":"Sat, 1 Oct 2022 01:52:43 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YzdzOzGM/9kK87IX@pendragon.ideasonboard.com>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>\n\t<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>\n\t<166455261154.2677993.2054565267058488079@Monstersaurus>\n\t<YzdTg5jobifnITeu@pendragon.ideasonboard.com>\n\t<YzdY0LYYJmMi44rW@pendragon.ideasonboard.com>\n\t<166457595065.4106166.13999558526233089549@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<166457595065.4106166.13999558526233089549@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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":25210,"web_url":"https://patchwork.libcamera.org/comment/25210/","msgid":"<Yzd9MzJbuAq/LKAz@pendragon.ideasonboard.com>","date":"2022-09-30T23:35:15","subject":"Re: [libcamera-devel] [PATCH 4/4] 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\nOn Fri, Sep 30, 2022 at 11:08:46PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2022-09-30 21:37:23)\n> > On Fri, Sep 30, 2022 at 04:43:31PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > Quoting Jacopo Mondi (2022-09-30 16:35:28)\n> > > > On Thu, Sep 29, 2022 at 03:36:26PM +0100, Kieran Bingham via libcamera-devel 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> > > > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > > >\n> > > > > ---\n> > > > > This can later be extended to support or enforce adding an overview\n> > > > > changelog to the commit, and annotated tag.\n> > > > >\n> > > > >  utils/release.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n> > > > >  1 file changed, 48 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..c1c35dacab8e\n> > > > > --- /dev/null\n> > > > > +++ b/utils/release.sh\n> > > > > @@ -0,0 +1,48 @@\n> > > > > +#!/bin/sh\n> > > > > +\n> > > > > +# SPDX-License-Identifier: GPL-2.0-or-later\n> > > > > +# Prepare a project release\n> > > > > +\n> > > > > +# Abort if we are not within the project root or the tree is not clean.\n> > > > > +if [ ! -e utils/gen-version.sh -o ! -e .git ]; then\n> > \n> > gen-version.sh uses\n> > \n> > # Bail out if the directory isn't under git control\n> > git_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n> > \n> > which makes sure that the .git directory contains something valid.\n> \n> I can't use that here. (And maybe we need to update gen-version).\n> \n> I want to be certain that we are within the git repository for\n> libcamera. Not an un-tracked sources (for example an extracted tar ball)\n> that has another parent directory which is controlled by git.\n\nHow wonder how far we need to go to catch such weird cases. What if\nwe're in a different directory, where someone has a different\nutils/gen-version.sh ? :-) Let's not forget that the release script will\nonly be used by maintainers, so I don't think we need to have as many\nsafeguards in place as for situations that could affect users (such as\ncloning the repository without tags, for instance).\n\n> > > > > +     echo \"This release script must be run from the root of libcamera git clone.\"\n> > \n> > s/libcamera git clone/a libcamera git tree/\n> > \n> > > > > +     exit 1\n> > > > > +fi\n> > > > > +\n> > > > > +if ! git diff-index --quiet HEAD; then\n> > > > \n> > > > Took me a while to validate this as --quite implies --exit-code which\n> > > > is documented as:\n> > > > \n> > > > Make the program exit with codes similar to diff(1). That is, it exits\n> > > > with 1 if there were differences and 0 means no differences.\n> > > > \n> > > > But in bash an exit code 0 mean success, so it's right to negate it\n> > > \n> > > Yes, we use this in utils/gen-version.sh\n> > > \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> > Hmmm... gen-version.sh retrieves the version from git tags only, and now\n> > we're also bumping the project version in the root meson.build. With the\n> > current implementation, the project version is used as a fallback only,\n> > if gen-version.sh fails. Is this something we need to revisit ? Do we\n> > need to worry about a mismatch between the two ? It can be handling on\n> > top, but I'd like to hear your opinion.\n> \n> That's why the meson version summary reports both.\n\nIf they're never supposed to be different, then we should fail at\nconfigure time. If they can be different, we need to correctly support\nthose cases. Let's discuss that in 1/4.\n\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:\"\n> > > > > +             echo \" - major\"\n> > > > > +             echo \" - minor\"\n> > > > > +             echo \" - patch\"\n> > \n> > This could hold on one line:\n> > \n> >                 echo \"You must specify the version bump level (major, minor, patch)\"\n> > \n> > Up to you.\n> > \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 add meson.build\n> > > > > +git commit meson.build -m \"libcamera v$new_version\"\n> > \n> > You can drop meson.build here. I would also add -s to add a SoB line.\n> \n> I wanted it to be explicit that /only/ meson.build is to be commited.\n\nThe script verifies that the tree is clean first, so nothing else will\nbe committed. I don't mind much, but if you want to keep the file name\nin the git commit command, then you can drop git add.\n\n> > > > > +\n> > > > > +# Create a tag\n> > > > > +git tag v$new_version -am \"libcamera v$new_version\"\n> > \n> > And here too, -s, to sign the tag.\n> > \n> > > > The rest looks good\n> > > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>","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 A6AE4C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Sep 2022 23:35:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD1F962856;\n\tSat,  1 Oct 2022 01:35:18 +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 BCAEA62851\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 Oct 2022 01:35:17 +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 F16F259D;\n\tSat,  1 Oct 2022 01:35:16 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664580918;\n\tbh=jObuWlkCqRmxCzZfiSRXu4MEUHz5fdYvTxnIMXDHv1U=;\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=JWgRDqcbMZ+AlOvqChGwzQ0EZTgAjy+9VHIEprT57Lyj2itVJxyatAIkN2YZlgbG1\n\tTwVZ2ZoBYXOi97ajSlA5Rjz+9aAS/qRPok0RKCzK6dzOEj6mvVmvdWnj64Qmqz+0rw\n\tA9WOUKbYeBuMzgmCsM+UzzIduK/eb2JEwSZVqlQFh7uPDGCG1vgeAdTuPLFMLBgnKH\n\tQAlR7sqRMhDCljAJwEthm5z4aTd+MijYwRcGW8C1SgupJpjXBGEOjgQyJde7twfrSw\n\tKkklYz0X7FntrtfWYFtJkg1dlOfO8xUiJeVf72wm1a1+Sp6tsBrgwMPfU9+0HnmhZK\n\tkg5vmE0LGWPvw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664580917;\n\tbh=jObuWlkCqRmxCzZfiSRXu4MEUHz5fdYvTxnIMXDHv1U=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=F4o789MIsf0RtjxIiEhjnpDumna0SA1T5SR97Kf9tE7xXEgRJ39T53L8i0WGdFdnQ\n\tyfo2J1ZFeSUlFrhGCXKSlh1RCiCkqXtfLL7vkO5dCdU5PLEpEvMwpGJ5/YGx3hh7tM\n\tt6boVUkhPS8DTscGD3Gqiocg0Ryjh4hjxAMcw66w="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"F4o789MI\"; dkim-atps=neutral","Date":"Sat, 1 Oct 2022 02:35:15 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<Yzd9MzJbuAq/LKAz@pendragon.ideasonboard.com>","References":"<20220929143626.3100668-1-kieran.bingham@ideasonboard.com>\n\t<20220929143626.3100668-5-kieran.bingham@ideasonboard.com>\n\t<20220930153528.4px2bj5fszw3pzkp@uno.localdomain>\n\t<166455261154.2677993.2054565267058488079@Monstersaurus>\n\t<YzdTg5jobifnITeu@pendragon.ideasonboard.com>\n\t<166457572636.4106166.11085235309867130328@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<166457572636.4106166.11085235309867130328@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH 4/4] 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>"}}]