git-jira-shortcuts 1.0.15 → 1.0.17

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
@@ -81,7 +81,7 @@ git config --global core.excludesfile ~/.gitignore_global
81
81
  ### Branching
82
82
  | Command | Alias | Description |
83
83
  |---------|-------|-------------|
84
- | `gswitch [branch]` | `gw` | Switch branches with interactive picker (↑/↓ arrows) |
84
+ | `gswitch [branch] [--force]` | `gw` | Switch branches with interactive picker (↑/↓). `--force` skips uncommitted and unpushed guards. |
85
85
  | `gstart <branch\|ticket#>` | `gt`, `gcreate` | Create or switch to branch, auto-names from Jira |
86
86
  | `gdelete [branch]` | `gdel` | Delete feature branch if clean and pushed |
87
87
  | `gmerge [branch]` | `gm` | Merge branch into current if no conflicts |
@@ -152,6 +152,12 @@ When `GJS_BRANCH_ALIASES` is set, the defaults are replaced entirely — so incl
152
152
  npm update -g git-jira-shortcuts
153
153
  ```
154
154
 
155
+ After upgrading, open a new terminal session or reload your current shell:
156
+
157
+ ```bash
158
+ source ~/.zshrc
159
+ ```
160
+
155
161
  ## Reconfigure
156
162
 
157
163
  ```bash
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ console.log(`
4
+ git-jira-shortcuts installed/updated.
5
+
6
+ Remember to start a new terminal session before using gw, gs, ghelp, etc.
7
+ Existing terminals keep the old shell functions in memory.
8
+
9
+ Or reload your current shell with:
10
+ source ~/.zshrc
11
+ `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-jira-shortcuts",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
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",
@@ -11,6 +11,9 @@
11
11
  "bin": {
12
12
  "git-jira-shortcuts": "./bin/cli.js"
13
13
  },
14
+ "scripts": {
15
+ "postinstall": "node ./bin/postinstall.js"
16
+ },
14
17
  "files": [
15
18
  "bin/",
16
19
  "shell/",
@@ -377,7 +377,7 @@ ghelp() { # ghelp | Show all git-jira-shortcuts commands
377
377
 
378
378
  ── Branching ──────────────────────────────────────────────────
379
379
  gw [branch] Switch branches — arrow-key picker if no branch given
380
- gswitch (same, also accepts --force / -f)
380
+ gswitch (same, also accepts --force / -f to skip dirty or unpushed guards)
381
381
  gt <branch|ticket#> Create or switch to a branch — auto-names from Jira
382
382
  gstart, gcreate (same)
383
383
  gdel [branch] Delete a branch — interactive picker, safety checks
@@ -596,7 +596,7 @@ greset() { # greset [*file] | Reset a specific file with confirmation (interacti
596
596
  }
597
597
  alias gr='greset' # greset [*file] | Alias for greset
598
598
 
599
- gswitch() { # gswitch [*branch] [--force|-f] | Switch branches (optionally bypass local-dirty guard)
599
+ gswitch() { # gswitch [*branch] [--force|-f] | Switch branches (bypass dirty tree / unpushed guards with --force)
600
600
  local force_switch=0
601
601
  local -a positional=()
602
602
  local arg
@@ -623,8 +623,9 @@ gswitch() { # gswitch [*branch] [--force|-f] | Switch branches (optionally bypas
623
623
  local unpushed
624
624
  unpushed=$(git log origin/"$branch"..HEAD --oneline 2>/dev/null)
625
625
 
626
- if [[ -n "$unpushed" ]]; then
626
+ if [[ $force_switch -eq 0 && -n "$unpushed" ]]; then
627
627
  echo "🚫 You have commits on '$branch' not pushed to origin. Push them first."
628
+ echo " Use 'gw --force [branch]' to switch anyway."
628
629
  return 1
629
630
  fi
630
631