Skip to content

Instantly share code, notes, and snippets.

@ryan-williams
Last active November 8, 2025 23:45
Show Gist options
  • Select an option

  • Save ryan-williams/2cfad991afe939a7b54f4a740df6cfbc to your computer and use it in GitHub Desktop.

Select an option

Save ryan-williams/2cfad991afe939a7b54f4a740df6cfbc to your computer and use it in GitHub Desktop.

runsascoded/ghpr#5 Improve create and init workflows

This PR includes several improvements to the create and init commands, making the PR/Issue creation workflow more robust and user-friendly.

Key Changes

Template and Workflow

  1. Remove placeholder confusion - Templates now use plain # Title format; link-references added automatically after PR/Issue creation
  2. Interactive web editor support - Default mode opens browser, waits for user confirmation, then fetches PR info and updates file

create Command Improvements

  1. Support user-namespaced branches - Auto-detects remote branch names when local branch differs (e.g., local ws3 → remote m/rw/ws3)
  2. Better parent repo detection - Uses git rev-parse --show-toplevel to properly find parent repo when running from nested gh/new/ directory
  3. Flexible opening behavior - New -y/--yes count flag:
    • Default (no flag): Opens web editor during creation (interactive, waits for Enter)
    • -y once: Creates PR then views result
    • -yy twice: Creates silently without opening

init Command Improvements

  1. Complete workflow setup - Creates initial commit and configures gist mirror automatically, eliminating manual force-push
  2. Plain template - No more [owner/repo#XXXX] placeholders to confuse users

Commits

  • Fix create to use remote branch name for PRs
  • Fix create to use git to find parent repo root
  • Add -y/--yes count flag to control opening behavior in create
  • Fix placeholder link handling in create
  • Make init create initial commit and set up gist mirror
  • Remove placeholder format, use plain titles until PR created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment