git-jira-shortcuts 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -79,6 +79,7 @@ Running `git-jira-shortcuts init` creates `~/.git-jira-shortcuts.env` with:
79
79
  |---------|-------|-------------|
80
80
  | `greset [file]` | `gr` | Reset a file with confirmation (interactive if no file given) |
81
81
  | `gdiff [branch]` | — | List files changed vs target branch + GitHub compare link |
82
+ | `gpr [branch]` | — | Open GitHub compare URL (current branch → target) |
82
83
  | `testJira` | `tj` | Test Jira API connection |
83
84
 
84
85
  ## Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-jira-shortcuts",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Git + Jira workflow shortcuts for zsh — interactive branch switching, auto-prefixed commits, Jira integration, and more.",
5
5
  "author": "chipallen2",
6
6
  "license": "MIT",
@@ -353,6 +353,7 @@ ghelp() { # ghelp | Show all git-jira-shortcuts commands
353
353
  gm [branch] Merge another branch INTO your current branch
354
354
  gmerge (same)
355
355
  gdiff [branch] Files changed vs target branch + GitHub compare link
356
+ gpr [branch] Open GitHub compare URL (current branch → target)
356
357
 
357
358
  ── File Operations ────────────────────────────────────────────
358
359
  gr [file] Reset a file with confirmation — picker if no file
@@ -440,6 +441,39 @@ gdiff() { # gdiff [*branch=m] | List files changed for PR to target branch + Git
440
441
  fi
441
442
  }
442
443
 
444
+ gpr() { # gpr [*branch=m] | Open GitHub compare URL from current branch to target branch
445
+ local target_input="${1:-m}"
446
+ local target
447
+ if ! target=$(_gjs_resolve_branch_input "$target_input" "any"); then
448
+ return 1
449
+ fi
450
+
451
+ local current_branch=$(git rev-parse --abbrev-ref HEAD)
452
+ local remote_url=$(git remote get-url origin 2>/dev/null)
453
+
454
+ if [[ -z "$remote_url" ]]; then
455
+ echo "❌ No remote 'origin' found."
456
+ return 1
457
+ fi
458
+
459
+ local repo_path
460
+ if [[ "$remote_url" == git@github.com:* ]]; then
461
+ repo_path="${remote_url#git@github.com:}"
462
+ elif [[ "$remote_url" == https://github.com/* ]]; then
463
+ repo_path="${remote_url#https://github.com/}"
464
+ fi
465
+ repo_path="${repo_path%.git}"
466
+
467
+ if [[ -z "$repo_path" ]]; then
468
+ echo "❌ Could not determine GitHub repo from remote URL: $remote_url"
469
+ return 1
470
+ fi
471
+
472
+ local url="https://github.com/${repo_path}/compare/${target}...${current_branch}?expand=1"
473
+ echo "$url"
474
+ open "$url" 2>/dev/null || xdg-open "$url" 2>/dev/null || echo "Open the URL above in your browser."
475
+ }
476
+
443
477
  glist() { # glist | List files pending in this branch
444
478
  git --no-pager status --short --untracked-files=all
445
479
  }