Skip to content

Add remaining git abbreviations from oh-my-zsh and fish plugin-git - #1298

Merged
fdncred merged 1 commit into
nushell:mainfrom
DavSanchez:feat/git-abbreviations-port-gaps
Oct 21, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
DavSanchez:feat/git-abbreviations-port-gaps

Conversation

@DavSanchez

@DavSanchez DavSanchez commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

aliases/git and abbreviations/git are ports of the oh-my-zsh git plugin,
but a few names never made it across, and the fish
plugin-git package (a port of the
same alias set, plus extras) has more that are worth having. This adds all of
them to both files.

Dropped by the oh-my-zsh port (8)

name expansion
g git
ggsup git branch --set-upstream-to origin/<current>
glom git log --oneline --decorate <main>..
grbmi / grbmia git rebase <main> --interactive [--autosquash]
grbom git fetch origin <main>; git rebase FETCH_HEAD
gsuri git submodule update --recursive --init
gwtrm git worktree remove

From fish plugin-git (26)

area names
commit gcav, gcav!, gcfx, gcv, gscam
diff gdg, gdsc, gdto, gdwc
fetch + merge gfm
current branch ggl, ggp, ggp!, ggpnp, ggu
rebase grbdi, grbdia, grbomi, grbomia
reset / clean gclean!, grhpa, grpo
worktree gwtlo, gwtpr, gwtulo
submodule gsur

gwta is added to the abbreviation file only, where the alias was already
present.

Deliberately left out: names that only restate an existing one with a
different flag (gp! = gpf, gmt = gmtl, gpo, glr = gup, gloo,
gcod = gcd, gcom = gcm, gban = gbnm), the git flow family, and
the GitLab merge-request push aliases.

Implementation notes:

  • grbom/grbomi/grbomia and gfm fetch the default branch and then
    rebase or merge FETCH_HEAD, instead of using a possibly stale
    origin/<main>. Say the word if you would rather have literal oh-my-zsh
    parity.
  • glom uses string interpolation because (git_main_branch).. is parsed by
    nushell as an integer range, not as a git revision range.
  • gfm, ggpnp and the grbom* names are defs because they run two
    commands.
  • The single-letter g is the only one I am unsure about; happy to drop it.

Tested in a throwaway repo (diverged branch, autosquash, force-with-lease,
worktree lock/prune, remote prune, --fixup) on nushell 0.116.1. Both files
pass toolkit check pr.

@fdncred

fdncred commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

sounds good. ping me when you're ready

`aliases/git` and `abbreviations/git` are ports of the oh-my-zsh git
plugin, but a few names never made it across; the fish `plugin-git`
(a port of the same alias set with extras) has more that are useful.

From oh-my-zsh, which the port dropped:

    g  ggsup  glom  grbmi  grbmia  grbom  gsuri  gwtrm

From fish `plugin-git`:

    gcav  gcav!  gcfx  gcv  gscam
    gdg  gdsc  gdto  gdwc
    gfm  ggl  ggp  ggp!  ggpnp  ggu
    gclean!  grbdia  grbdi  grbomi  grbomia  grhpa  grpo
    gsur  gwtlo  gwtpr  gwtulo

Both files get the same set, since they are meant to stay in sync;
`gwta` is added to the abbreviation file only, where the alias already
existed. Names that only restate an existing one with a different flag
(`gp!`, `gmt`, `gpo`, `glr`, `gloo`, `gcod`, `gcom`, `gban`) are left
out to avoid duplicate spellings, as are the `git flow` and GitLab
merge request aliases.

Three implementation notes:

- `grbom`/`grbomi`/`grbomia` and `gfm` fetch the default branch and then
  rebase/merge `FETCH_HEAD`, rather than using a possibly stale
  `origin/<main>`.
- `glom` uses string interpolation because `(git_main_branch)..` is
  parsed by nushell as an integer range, not as a git revision range.
- `gfm`, `ggpnp` and the `grbom*` names are `def`s, as they run two
  commands.
@DavSanchez
DavSanchez force-pushed the feat/git-abbreviations-port-gaps branch from 73cf5e3 to 7e8cd9f Compare October 21, 2026 17:30
@DavSanchez DavSanchez changed the title Add git abbreviations left out of the oh-my-zsh port Add remaining git abbreviations from oh-my-zsh and fish plugin-git Oct 21, 2026
@DavSanchez
DavSanchez marked this pull request as ready for review October 21, 2026 17:30
@fdncred
fdncred merged commit ec79e43 into nushell:main Oct 21, 2026
1 check passed
@fdncred

fdncred commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Thanks

@DavSanchez
DavSanchez deleted the feat/git-abbreviations-port-gaps branch October 21, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants