From patchwork Tue Feb 8 03:49:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Russell X-Patchwork-Id: 3395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEC29C433F5 for ; Tue, 8 Feb 2022 03:50:07 +0000 (UTC) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by mx.groups.io with SMTP id smtpd.web08.6847.1644292207282931831 for ; Mon, 07 Feb 2022 19:50:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BugCl3mj; spf=pass (domain: gmail.com, ip: 209.85.219.51, mailfrom: bkylerussell@gmail.com) Received: by mail-qv1-f51.google.com with SMTP id k4so13091744qvt.6 for ; Mon, 07 Feb 2022 19:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6HDa/cnoKjIHkSbrW2yIyl6cggatzlv00eka7y76Wyc=; b=BugCl3mjHZWkYsvABxpnxx5/h+1nlZKJqXIpSy3kOV4kqpunkz2AIDbXyiIMh31ggA RqFQFL3FFezWmFwKNEvo+0AvqUmR/X38f96WCa7PqG0rOAD99i51oPly95pXRXiySFzQ iAmsARM5g5kULBJyXYMLWOa+59fTDzJXx1jdfZEIiO5Ql4/D3F9+tas8KNnpt5KxAFya FVZq+7KlebyZ4Uz7cYjjwLPpHwuAHslTnyUpoTpdfxgim4LiSAuw7eby0xa4THlkjQ+/ 4nT78gPKe7/liO+BDkx8vxt+CWBVLQNDbJmhL0sKRuiocvWYpwjAnVrJr/ibFPCQ6MBZ /9Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6HDa/cnoKjIHkSbrW2yIyl6cggatzlv00eka7y76Wyc=; b=B+OJVyZrI/UTkaa31O8kgNgTQMHoV8vS6n8lHc95oh7/qYSSCAHKWaQRyP7fTr6N/p St/4Cy40sBE8+7pXpDUJ/egSih/CW0ShG4MoSTBQasJpnSlDY2V39Psb23Q6MQZHvvJl TIFu7IotG/WGz/m9pEUleT+5G4FnNs0SEARgdAI5A0EHaMX6EMsdfHzv5N/0qjJB/O8W sJ06TXDNqkwFIdIwq1wOTHZP7opp+V27Sr6vFKqzSycB7Mk+657W5Dih8XZK1WMFRpkT ke5rjoAmESdKOKWQPLry4f+tCatBdftnNj4QXs0yQ8kkTYgRm/lR+pbiSyDAyksodAo4 ko4Q== X-Gm-Message-State: AOAM5303RKZTjcXuKD2BHPPH4J6U52dVD1D95WmKdLq+1DcQ6WYxW7z1 6U4a3cFMTIzAw4lOM4MLdWPpt1dVmHzXKA== X-Google-Smtp-Source: ABdhPJwuNWpa+bKX/ODRUon6CLo9fba6oM/nr3DRsNGYwrlpdHgryDmbQHbI57fzt0FbQ2BQuC1HWw== X-Received: by 2002:ad4:4ea6:: with SMTP id ed6mr1904472qvb.113.1644292206254; Mon, 07 Feb 2022 19:50:06 -0800 (PST) Received: from hercule.localdomain (cpe-74-138-104-174.kya.res.rr.com. [74.138.104.174]) by smtp.gmail.com with ESMTPSA id h9sm6685378qkn.121.2022.02.07.19.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 19:50:05 -0800 (PST) From: Kyle Russell To: openembedded-core@lists.openembedded.org Cc: Kyle Russell Subject: [PATCH 1/2] devtool: get hooks directory path from git rev-parse Date: Mon, 7 Feb 2022 22:49:59 -0500 Message-Id: <20220208035000.400632-1-bkylerussell@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 08 Feb 2022 03:50:07 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/161473 Ask git rev-parse to provide the path to the repo's hooks directory. This allows devtool to support git submodules, where only the superproject contains a .git directory. git submodules contain .git files pointing to their parent repo, which confuses devtool when it tries to modify the commit hooks by a manually constructed path. --- meta/lib/oe/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 950fe723dc..976a966083 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -510,7 +510,7 @@ class GitApplyTree(PatchTree): reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip() if not reporoot: raise Exception("Cannot get repository root for directory %s" % self.dir) - hooks_dir = os.path.join(reporoot, '.git', 'hooks') + hooks_dir = runcmd("git rev-parse --git-path hooks".split()) hooks_dir_backup = hooks_dir + '.devtool-orig' if os.path.lexists(hooks_dir_backup): raise Exception("Git hooks backup directory already exists: %s" % hooks_dir_backup) From patchwork Tue Feb 8 03:50:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Russell X-Patchwork-Id: 3396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9BDCC433F5 for ; Tue, 8 Feb 2022 03:50:10 +0000 (UTC) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by mx.groups.io with SMTP id smtpd.web12.6789.1644292209986598673 for ; Mon, 07 Feb 2022 19:50:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=k7WzE8lD; spf=pass (domain: gmail.com, ip: 209.85.219.50, mailfrom: bkylerussell@gmail.com) Received: by mail-qv1-f50.google.com with SMTP id g3so8486542qvb.8 for ; Mon, 07 Feb 2022 19:50:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RiOTCBcQUCtOYA/Io2QHveEjGsZ4j/riLL9ws/mW5tY=; b=k7WzE8lDuYcecZeyo0pM5JmP1uYE/ieHpHoPTDQGfmhgTViix4Vo8VP+leJxbuZV02 NCIU7b5EmwRgUS1OftFVrw3PJSrKrDKsbKyesX9j9B7uhP7/eUo2evyMtUSqLKunYhRY D8EdFhjvwwhMVuWBAAzRF8VZigpNahGO0EPexzeec2KYFQxt6RmDk4mslZOTUS1sb/tp eziHMbs3D3g3VuyrYrjzjYVL0XLctHWJ+HsLTKr7gBnThTZpV6FqtFxf2ffQm46Q0TFX GnlUotaDjFWMW4eJ8dvAmeK5R5QuOQPHRbSQKrCvC/ZmCnJoJ5xDhuYFZgRzxOiP5VSY 8vmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RiOTCBcQUCtOYA/Io2QHveEjGsZ4j/riLL9ws/mW5tY=; b=E4YXHwc7c3aY2FWVyQC0brr5JoFFJa7/R5smaifc3ChOLsMLRkCoQ3SWYG/XqpLhkH a6Bh6QQiIWsx9HGQtjBYtxQ6tQWIv1JD5b51Fs4qlwJjxBGQiXG8MADWvf9Uby+Q6TPu dgQ2unL7FkS7xDQpaJMmf3oaRkOOMnkl0hcQPIsJX4rkcfWlTY4TfdAXu2fij3AR2Mdo MNwLjJtAtsVRQ0PurcRWnU+yUSoliEU8iDh+TdLcMxk/zlB00iJW66g0Jh0+BG0Ok/9Q 19I2ZIX1mTubvs2up0Qi4WznQuw1FkIogm6FaFKoXldXk6QuRHPo90hoffPdwuR7SSBg rwaQ== X-Gm-Message-State: AOAM532GtufKHF1pJwLZOmMJThJjULTbIXR62A+N6ttldlvkf/Ac3L1C njBjmPXsZMui6XUR9GMyrcx275/5xm243Q== X-Google-Smtp-Source: ABdhPJwERYxgk31aVKcfa01fsIiI1tkl2Fxcu/Neks604bYWKAH7p6i65lJ5LxBcVOpT3IFL1T6yDA== X-Received: by 2002:a05:6214:2608:: with SMTP id gu8mr1856050qvb.35.1644292209029; Mon, 07 Feb 2022 19:50:09 -0800 (PST) Received: from hercule.localdomain (cpe-74-138-104-174.kya.res.rr.com. [74.138.104.174]) by smtp.gmail.com with ESMTPSA id h9sm6685378qkn.121.2022.02.07.19.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 19:50:08 -0800 (PST) From: Kyle Russell To: openembedded-core@lists.openembedded.org Cc: Kyle Russell Subject: [PATCH 2/2] devtool: don't exec patch commit task funcs for git submodules Date: Mon, 7 Feb 2022 22:50:00 -0500 Message-Id: <20220208035000.400632-2-bkylerussell@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208035000.400632-1-bkylerussell@gmail.com> References: <20220208035000.400632-1-bkylerussell@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 08 Feb 2022 03:50:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/161474 When applying a patch directly to a submodule, devtool doesn't need to generate commits for updated submodule revisions, which may differ each time a patch is applied to a devtool workspace. (submodule revision commits would be effectively useless unless the patch is pushed to a remote repo from devtool, at which time a commit should be generated by the user anyway.) Additionally, attempting to commit new submodule revisions in the parent repo may error with "no changes added to commit" if the patched module is nested within multiple submodules below the parent repo. (Devtool doesn't and shouldn't recusively create commits on each submodule.) --- scripts/lib/devtool/standard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 01fb5ad96f..5282253ac4 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -569,7 +569,8 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works f.write('DEVTOOL_DEVBRANCH = "%s"\n' % devbranch) if not is_kernel_yocto: f.write('PATCHTOOL = "git"\n') - f.write('PATCH_COMMIT_FUNCTIONS = "1"\n') + if not 'gitsm' in d.getVar('SRC_URI'): + f.write('PATCH_COMMIT_FUNCTIONS = "1"\n') if extra_overrides: f.write('DEVTOOL_EXTRA_OVERRIDES = "%s"\n' % ':'.join(extra_overrides)) f.write('inherit devtool-source\n')