modular / modular/stack-pr

`land` should exit gracefully when there are non-submitted changes, now it crashes

Open
#107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
569
Forks
43
PR merge metrics
No merged PRs in 30d

Description

Repro:

  1. make change zzz
  2. stack-pr export
  3. make change ppp
  4. stack-pr view:
VIEW
Stack:
   * 3344c73c (no PR, 'ZolotukhinM/stack/133' -> 'ZolotukhinM/stack/132'): ppp
   * a7883442 (#139, 'ZolotukhinM/stack/132' -> 'main'): zzz
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.