`land` should exit gracefully when there are non-submitted changes, now it crashes
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 569
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
Repro:
- make change
zzz stack-pr export- make change
ppp stack-pr view:
VIEW
Stack:
* 3344c73c (no PR, 'ZolotukhinM/stack/133' -> 'ZolotukhinM/stack/132'): ppp
* a7883442 (#139, 'ZolotukhinM/stack/132' -> 'main'): zzz
stack-pr land
LAND
Traceback (most recent call last):
File "/Users/mvz/.local/bin/stack-pr", line 7, in <module>
sys.exit(main())
~~~~^^
File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 1659, in main
command_land(common_args)
~~~~~~~~~~~~^^^^^^^^^^^^^
File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 1241, in command_land
set_base_branches(st, args.target)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 483, in set_base_branches
e.base, prev_branch = prev_branch, e.head
^^^^^^
File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 300, in head
raise ValueError("head is not set")
ValueError: head is not set
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in stack_pr/cli.py at command_land and set_base_branches, following the traceback and reproducing the listed stack-pr export, view, and land sequence. Done means stack-pr land handles the non-submitted change gracefully instead of raising ValueError: head is not set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100