What problem does it solve?
It prevents Drupal issue worktrees from lingering in an unfinished state by guiding you to make a deliberate final decision (submit as MR, submit as patch, keep as WIP, or discard) with the right cleanup steps.
Core Features & Use Cases
- State assessment and safety checks: inspects uncommitted changes, commit differences from main, and whether DDEV is running so you finish from a known-good state.
- Deliberate end-of-session outcomes: supports four explicit paths—MR submission, patch generation, WIP parking, or full discard—so worktrees never drift indefinitely.
- Production-style cleanup and coordination: handles DDEV shutdown and provides user-facing commands (push/upload) while protecting agents from performing guarded git actions.
Use case example: You complete a Drupal fix in an issue worktree, run tests locally under DDEV, and now need to either create a drupal.org merge request with a ready-to-paste contribution comment or export a patch file for manual submission.
Quick Start
Run finish-issue when you’re done with issue worktree <ISSUE> and want to close it by submitting as an MR, patch, WIP, or discard while ensuring DDEV is stopped appropriately.