git-jira-shortcuts 1.0.11 → 1.0.13
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 +1 -0
- package/package.json +1 -1
- package/shell/git-extras.sh +35 -0
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
package/shell/git-extras.sh
CHANGED
|
@@ -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,40 @@ gdiff() { # gdiff [*branch=m] | List files changed for PR to target branch + Git
|
|
|
440
441
|
fi
|
|
441
442
|
}
|
|
442
443
|
|
|
444
|
+
unalias gpr 2>/dev/null
|
|
445
|
+
gpr() { # gpr [*branch=m] | Open GitHub compare URL from current branch to target branch
|
|
446
|
+
local target_input="${1:-m}"
|
|
447
|
+
local target
|
|
448
|
+
if ! target=$(_gjs_resolve_branch_input "$target_input" "any"); then
|
|
449
|
+
return 1
|
|
450
|
+
fi
|
|
451
|
+
|
|
452
|
+
local current_branch=$(git rev-parse --abbrev-ref HEAD)
|
|
453
|
+
local remote_url=$(git remote get-url origin 2>/dev/null)
|
|
454
|
+
|
|
455
|
+
if [[ -z "$remote_url" ]]; then
|
|
456
|
+
echo "❌ No remote 'origin' found."
|
|
457
|
+
return 1
|
|
458
|
+
fi
|
|
459
|
+
|
|
460
|
+
local repo_path
|
|
461
|
+
if [[ "$remote_url" == git@github.com:* ]]; then
|
|
462
|
+
repo_path="${remote_url#git@github.com:}"
|
|
463
|
+
elif [[ "$remote_url" == https://github.com/* ]]; then
|
|
464
|
+
repo_path="${remote_url#https://github.com/}"
|
|
465
|
+
fi
|
|
466
|
+
repo_path="${repo_path%.git}"
|
|
467
|
+
|
|
468
|
+
if [[ -z "$repo_path" ]]; then
|
|
469
|
+
echo "❌ Could not determine GitHub repo from remote URL: $remote_url"
|
|
470
|
+
return 1
|
|
471
|
+
fi
|
|
472
|
+
|
|
473
|
+
local url="https://github.com/${repo_path}/compare/${target}...${current_branch}?expand=1"
|
|
474
|
+
echo "$url"
|
|
475
|
+
open "$url" 2>/dev/null || xdg-open "$url" 2>/dev/null || echo "Open the URL above in your browser."
|
|
476
|
+
}
|
|
477
|
+
|
|
443
478
|
glist() { # glist | List files pending in this branch
|
|
444
479
|
git --no-pager status --short --untracked-files=all
|
|
445
480
|
}
|