From patchwork Mon Oct 23 16:07:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 1901 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CE1F327BBE2; Mon, 23 Oct 2023 17:08:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 88B1827BBE9 for ; Mon, 23 Oct 2023 17:08:41 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quxTn-00071G-6V; Mon, 23 Oct 2023 12:08:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quxTl-0006zx-HU for guix-patches@gnu.org; Mon, 23 Oct 2023 12:08:33 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxTl-0000qh-90 for guix-patches@gnu.org; Mon, 23 Oct 2023 12:08:33 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quxUE-0002Ty-8Q; Mon, 23 Oct 2023 12:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66704] [PATCH 0/1] patman depends on Git Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 23 Oct 2023 16:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66704 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66704@debbugs.gnu.org Cc: Simon Tournier , maxim.cournoyer@gmail.com X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: maxim.cournoyer@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.16980773349524 (code B ref -1); Mon, 23 Oct 2023 16:09:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Oct 2023 16:08:54 +0000 Received: from localhost ([127.0.0.1]:51408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quxU5-0002TX-TF for submit@debbugs.gnu.org; Mon, 23 Oct 2023 12:08:54 -0400 Received: from lists.gnu.org ([2001:470:142::17]:45170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quxU4-0002TL-2S for submit@debbugs.gnu.org; Mon, 23 Oct 2023 12:08:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quxTT-0006sY-PJ for guix-patches@gnu.org; Mon, 23 Oct 2023 12:08:15 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quxTR-0000mE-PV for guix-patches@gnu.org; Mon, 23 Oct 2023 12:08:15 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-408cd9660b8so4921115e9.1 for ; Mon, 23 Oct 2023 09:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698077292; x=1698682092; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TDJZQFU371sST6qREgSQ3LFRiSX21fXmJXux55jFOag=; b=EPpMIJYoE/gRQW8cF4HeQRFzcg1zqGzv5EhXffg6pOg+QGZ9JnZfgElkwxTQvpW2sx oBOz1sE44qYtV64YiDpSbodEW4KmvmYSQhnA74Zse1ZKFC1RcomBB7LVg/z3qhY82vx9 WjoTcYpUm3dh5B0yIb9glrRnD86sY4bN04H/xy6llL7syTwRccUaXC7b93wInelUYp8t 5mz1N8lymqq3xSX7WU0OdYf2iljj0WJkEYdJP0KOg3H5ouEHa27ktYiiurD8/C+sEXu7 UMJfGdzAK89pu0LYbYOeNhStpbsMcZ8IUQASQMCzZajWvw4Hc1SH50WExIVdPKT12gNa cxxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077292; x=1698682092; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TDJZQFU371sST6qREgSQ3LFRiSX21fXmJXux55jFOag=; b=MetpifuU0jYP3cl3mspzB7qVhxLjqRNHrT1aeoq4E/P5K7P0IG1V3Nxz36pVIeSuDI RSVBsaMfs5Cu/RBQORoDdMubmJlWA+e9e2tDt7UeWUMRQXBCaAcIr5E1E1PtE520VRZP Ei3iX4xeCr7WQ87ruX8QvS/mBamFMmsymvqH51hwqSxFWkVVsW6J1zuCphTQbLtqu4j0 Ka3Q65ZcCDwtk10VFNArsaMTfake9Hd5miU1zqcoA8KpcCQchWOFWnqNaHRflBYrmQft YmhAunNSdaV8IB5M86xLXiE4s82+PLXqaS6wYFEKDb/DzZc308tTl1qSouhznkpSbYZJ 75Mw== X-Gm-Message-State: AOJu0YxsQPZlmfFaUSVVTVbtJ8nehi6dV8gFbx8qU91syE6x/q48KBFN 8DKxHBoGoqi9vjlgK6ngvU8v+QiIRSQ= X-Google-Smtp-Source: AGHT+IEKYL5GTzvWSZ+jcc3dVtIZX7XRHn2tzxorqJIKZlw9h5Cvjv6uMvVdheALOiiJiLXEsEybpw== X-Received: by 2002:a05:600c:450a:b0:406:513d:738f with SMTP id t10-20020a05600c450a00b00406513d738fmr7345693wmo.2.1698077291700; Mon, 23 Oct 2023 09:08:11 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id bg34-20020a05600c3ca200b00402f713c56esm9919031wmb.2.2023.10.23.09.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 09:08:11 -0700 (PDT) From: Simon Tournier Date: Mon, 23 Oct 2023 18:07:56 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hi, Assume, I am running in some Git repository, e.g., $ git config --get branch.tmp.remote origin Then, I get this error: --8<---------------cut here---------------start------------->8--- $ guix shell -C patman -- patman -h Traceback (most recent call last): File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 95, in run_pipe last_pipe = cros_subprocess.Popen(cmd, cwd=cwd, **kwargs) File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/cros_subprocess.py", line 83, in __init__ super(Popen, self).__init__(args, stdin=stdin, File "/gnu/store/p4x29pa0qjb3r76v2bl0jvhld42l0lkq-python-3.10.7/lib/python3.10/subprocess.py", line 969, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/gnu/store/p4x29pa0qjb3r76v2bl0jvhld42l0lkq-python-3.10.7/lib/python3.10/subprocess.py", line 1845, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'git' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/bin/.patman-real", line 47, in parser.add_argument('-p', '--project', default=project.detect_project(), File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/lib/python3.10/site-packages/patman/project.py", line 19, in detect_project top_level = gitutil.get_top_level() File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/lib/python3.10/site-packages/patman/gitutil.py", line 627, in get_top_level return command.output_one_line('git', 'rev-parse', '--show-toplevel') File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 128, in output_one_line result = run_pipe([cmd], capture=True, oneline=True, File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 99, in run_pipe raise Exception("Error running '%s': %s" % (user_pipestr, str)) Exception: Error running 'git rev-parse --show-toplevel': --8<---------------cut here---------------end--------------->8--- That’s because ’patman’ runs ’git’ via the file gitutils.py, see: --8<---------------cut here---------------start------------->8--- -*- mode:grep; default-directory: "/tmp/u-boot-2023.07.02/tools/patman/" -*- 20 candidates: ./gitutil.py:29: cmd = ['git'] ./gitutil.py:87: pipe = ['git', 'name-rev', commit_hash] ./gitutil.py:139: remote = command.output_one_line('git', '--git-dir', git_dir, 'config', ./gitutil.py:141: merge = command.output_one_line('git', '--git-dir', git_dir, 'config', ./gitutil.py:231: pipe = ['git'] ./gitutil.py:252: pipe = ['git', 'clone', git_dir, '.'] ./gitutil.py:265: pipe = ['git'] ./gitutil.py:285: pipe = ['git', '--git-dir', git_dir, 'worktree', 'list'] ./gitutil.py:300: pipe = ['git', '--git-dir', git_dir, 'worktree', 'add', '.', '--detach'] ./gitutil.py:315: pipe = ['git', '--git-dir', git_dir, 'worktree', 'prune'] ./gitutil.py:337: cmd = ['git', 'format-patch', '-M'] ./gitutil.py:414: 'git', 'config', 'sendemail.suppresscc', raise_on_error=False) ./gitutil.py:496: git_config_to = command.output('git', 'config', 'sendemail.to', ./gitutil.py:511: cmd = ['git', 'send-email', '--annotate'] ./gitutil.py:627: return command.output_one_line('git', 'rev-parse', '--show-toplevel') ./gitutil.py:636: fname = command.output_one_line('git', 'config', 'sendemail.aliasesfile', ./gitutil.py:654: uname = command.output_one_line('git', 'config', '--global', 'user.name') ./gitutil.py:664: uemail = command.output_one_line('git', 'config', '--global', 'user.email') ./gitutil.py:675: 'git', 'config', 'format.subjectprefix', raise_on_error=False) ./gitutil.py:699: return command.output_one_line('git', 'show', '-s', '--pretty=format:%H') --8<---------------cut here---------------end--------------->8--- I propose to wrap ’patman’ with ’git’, see patch. WDYT? Cheers, simon Simon Tournier (1): gnu: patman: Wrap program with git. gnu/packages/bootloaders.scm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) base-commit: a25a492f2b8604de4ebc21298f24891a1a245161