[{"id":11897,"web_url":"https://patchwork.libcamera.org/comment/11897/","msgid":"<20200805192340.GB27976@pendragon.ideasonboard.com>","date":"2020-08-05T19:23:40","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: Add build time to\n\tversion string for dirty builds","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Wed, Aug 05, 2020 at 08:47:38PM +0200, Niklas Söderlund wrote:\n> Having the build time in the version string is useful when building from\n> a dirty worktree and deploying to targets as a quick way to identify the\n> binary have been deployed successfully.\n\ns/have/has/\n\n> \n> Before this change the version string is reported as\n> \n>     libcamera v0.0.0+1692-aaff196a-dirty\n> \n> While with this change the version string is reported as\n> \n>     libcamera v0.0.0+1692-aaff196a-dirty 2020-08-05T12:55:11+00:00\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  utils/gen-version.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/gen-version.sh b/utils/gen-version.sh\n> index 7f7872ceba7b038a..7536429c25bf3f18 100755\n> --- a/utils/gen-version.sh\n> +++ b/utils/gen-version.sh\n> @@ -26,7 +26,7 @@ if [ -z \"$build_dir\" ] || (echo \"$build_dir\" | grep -q \"$src_dir\")\n>  then\n>  \tgit update-index --refresh > /dev/null 2>&1\n>  fi\n> -git diff-index --quiet HEAD || version=\"$version-dirty\"\n> +git diff-index --quiet HEAD || version=\"$version-dirty $(date --iso-8601=seconds --utc)\"\n\nI'd go for\n\ngit diff-index --quiet HEAD || version=\"$version-dirty ($(date --iso-8601=seconds --utc))\"\n\nand maybe we should go for local timestamps as it makes it easier to\ncompare them to the wall clock without having to mentally handle the TZ\noffset. Unless your wall clock is in UTC of course :-)\n\nWith or without the time zone change,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  # Replace first '-' with a '+' to denote build metadata, strip the 'g' in from\n>  # of the git SHA1 and remove the initial 'v'.","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 0351DBD87A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Aug 2020 19:23:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7B6746071B;\n\tWed,  5 Aug 2020 21:23:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 79EEF6039D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Aug 2020 21:23:52 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DCC372C0;\n\tWed,  5 Aug 2020 21:23:51 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LsgzH0BW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1596655432;\n\tbh=VEnYQI1pAF/4Ws9Qp5DiJeQRVx//2kgVNIcTqVwGBDY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LsgzH0BW9W5nOLWrs4CbOErGQOUehqwY/1Jg4RpMzNhhCuUUbwhNyDs1/KdqcKifo\n\tyI4G1DQiBn9WQzsfp0MTuty3QaMQZnu6pUkCZAM62dzg9kgdXLUdUaEkoBQSYRKU+w\n\tFfraee9oASsHhNKnPVkjnFf1y0ZjHjsodmJNBpkM=","Date":"Wed, 5 Aug 2020 22:23:40 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200805192340.GB27976@pendragon.ideasonboard.com>","References":"<20200805184738.2478292-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200805184738.2478292-1-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: Add build time to\n\tversion string for dirty builds","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]