From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: 66704@debbugs.gnu.org
Subject: [bug#66704] [PATCH 0/1] patman depends on Git
Date: Mon, 23 Oct 2023 21:05:50 -0400 [thread overview]
Message-ID: <87jzrc6d8x.fsf@gmail.com> (raw)
In-Reply-To: <cover.1698076987.git.zimon.toutoune@gmail.com> (Simon Tournier's message of "Mon, 23 Oct 2023 18:07:56 +0200")
Hi Simon,
Simon Tournier <zimon.toutoune@gmail.com> writes:
> Hi,
>
> Assume, I am running in some Git repository, e.g.,
>
> $ git config --get branch.tmp.remote
> origin
>
> Then, I get this error:
>
> $ 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 <module>
> 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': <class 'str'>
>
>
> That’s because ’patman’ runs ’git’ via the file gitutils.py, see:
>
> -*- 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')
>
> I propose to wrap ’patman’ with ’git’, see patch.
I see 'git send-email' in the above, so you'll also want to wrap with
`(,git "send-email"). Did you test that this suffices to get a fully
self-contained working patman? Maybe you can send a v2 with patman.
You can add these 'Series-*' git trailers to your commit:
--8<---------------cut here---------------start------------->8---
Change-Id: xxxxxxx
[...]
Series-to: 66704@debbugs.gnu.org
Series-version: 2
Series-changes: 2
- Also add 'send-email' output of git to wrapper
--8<---------------cut here---------------end--------------->8---
Then to send, you simply do:
$ patman
And it'll annotate the patch for you and you don't need to remember
tracking the '--to' value.
--
Thanks,
Maxim
next prev parent reply other threads:[~2023-10-24 1:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 16:07 [bug#66704] [PATCH 0/1] patman depends on Git Simon Tournier
2023-10-23 16:26 ` [bug#66704] [PATCH 1/1] gnu: patman: Wrap program with git Simon Tournier
2023-10-24 1:05 ` Maxim Cournoyer [this message]
2024-07-23 17:59 ` [bug#66704] [PATCH v2] " Simon Tournier
2024-09-14 13:01 ` bug#66704: " Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzrc6d8x.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=66704@debbugs.gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.