breaks on dry cherry-picking for multiple branches
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 65
- 派生
- 47
- 平均合并
- 5 分钟
- 30 天内合并 PR
- 1
描述
This happened to me on the freshly upgraded openSUSE/Tumbleweed:
tumbleweed-pkg~/r/cpython (3.9)$ python3 -mpip install -U cherry_picker@git+https://github.com/python/cherry-picker.git
Defaulting to user installation because normal site-packages is not writeable
Collecting cherry_picker@ git+https://github.com/python/cherry-picker.git
Cloning https://github.com/python/cherry-picker.git to /tmp/pip-install-jzzbsfql/cherry-picker_cfe6f82ef02c43ad8cc54ccd332ba7e4
Running command git clone --filter=blob:none --quiet https://github.com/python/cherry-picker.git /tmp/pip-install-jzzbsfql/cherry-picker_cfe6f82ef02c43ad8cc54ccd332ba7e4
Resolved https://github.com/python/cherry-picker.git to commit 3e48d193d8ae19001883a25ccb825c39a7f36522
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: click>=6.0 in /usr/lib/python3.11/site-packages (from cherry_picker@ git+https://github.com/python/cherry-picker.git) (8.1.3)
Requirement already satisfied: gidgethub in /home/matej/.local/lib/python3.11/site-packages (from cherry_picker@ git+https://github.com/python/cherry-picker.git) (5.3.0)
Requirement already satisfied: requests in /usr/lib/python3.11/site-packages (from cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.31.0)
Requirement already satisfied: uritemplate>=3.0.1 in /usr/lib/python3.11/site-packages (from gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (4.1.1)
Requirement already satisfied: PyJWT[crypto]>=2.4.0 in /usr/lib/python3.11/site-packages (from gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.7.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2023.5.7)
Requirement already satisfied: charset_normalizer<4,>=2 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3.11/site-packages (from requests->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.0.3)
Requirement already satisfied: cryptography>=3.4.0 in /usr/lib64/python3.11/site-packages (from PyJWT[crypto]>=2.4.0->gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (41.0.1)
Requirement already satisfied: cffi>=1.12 in /usr/lib64/python3.11/site-packages (from cryptography>=3.4.0->PyJWT[crypto]>=2.4.0->gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (1.15.1)
Requirement already satisfied: pycparser in /usr/lib/python3.11/site-packages (from cffi>=1.12->cryptography>=3.4.0->PyJWT[crypto]>=2.4.0->gidgethub->cherry_picker@ git+https://github.com/python/cherry-picker.git) (2.21)
tumbleweed-pkg~/r/cpython (3.9)$ cherry_picker --dry-run 18dfbd035775c15533d13a98e56b1d2bf5c65f00 3.9 3.10 3.11
🐍 🍒 ⛏
Dry run requested, listing expected command sequence
dry-run: git remote get-url upstream
dry-run: git fetch upstream --no-tags
Now backporting '18dfbd035775c15533d13a98e56b1d2bf5c65f00' into '3.11'
dry-run: git remote get-url upstream
dry-run: git checkout -b backport-18dfbd0-3.11 upstream/3.11
dry-run: git cherry-pick -x 18dfbd035775c15533d13a98e56b1d2bf5c65f00
dry-run: git show -s --format=%B 18dfbd035775c15533d13a98e56b1d2bf5c65f00
Traceback (most recent call last):
File "/home/matej/.bin/cherry_picker", line 8, in <module>
sys.exit(cherry_pick_cli())
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 645, in cherry_pick_cli
cherry_picker.backport()
File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 387, in backport
commit_message = self.amend_commit_message(cherry_pick_branch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 269, in amend_commit_message
updated_commit_message = f"""{commit_prefix}{self.get_commit_message(self.commit_sha1)}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matej/.local/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 211, in get_commit_message
message = self.run_cmd(cmd).strip()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'strip'
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
失败出在 cherry_picker/cherry_picker.py:backport() 调用 amend_commit_message(),而后者会在 --dry-run 期间到达 get_commit_message()。首先使用显示的多分支命令跟踪这条路径;完成标准是 dry run 在没有 NoneType traceback 的情况下完成,并列出预期的命令。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100