The exec path added to the cache key in 6b789c8 came from
`git --exec-path`, which forked git on every startup, so a warm cache
was no faster than no cache at all.
Key the cache on ${commands[git]:A} (symlinks resolved) and its mtime
instead, which needs no fork. Shims that can dispatch to a different
git skip the cache and run `git version` as before: scripts (first two
bytes `#!`, e.g. asdf) and links that resolve to a binary not named
git (e.g. mise shims). macOS /usr/bin/git is an xcrun stub binary, so it
is cached on its own mtime; an xcode-select switch or CLT update is
picked up when the one-day cache expires.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`git version` was forked on every startup so that four aliases could be
picked according to the installed git. Cache the version in
$ZSH_CACHE_DIR for a day, keyed on the git binary's path and mtime, so a
different or upgraded git is picked up right away and the fork otherwise
happens once a day.
Measured on macOS arm64, zsh 5.9: git.plugin.zsh 9.2 ms -> 2.0 ms per
interactive start.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
BREAKING CHANGE: the following deprecated aliases have been removed:
gup, gupv, gupa, gupav, gupom, gupom. The following aliases have been
deprecated: ggpull, ggpur, ggpush. `current_branch` has also been
deprecated, in favor of `git_current_branch`.
- Rename `git push --force-with-lease ...` to `gpff`
- Add a y/n confirmation prompt to `gpf` before running `git push --force-with-lease ...`
BREAKING CHANGE: this change adds a confirmation prompt to the `gpf` alias before
running the potentially destructive `git push --force-with-lease` command. If you
want to force-run the command without having to confirm it, run `gpff`.
`gpristine` might be too much on several occasions, given that it removes all untracked files. This might not be ideal because it will delete important things like environment files and encryption keys.
With that in mind, this commit introduces `gwipe` as a way to get a "clean slate" but still have your dev environment working.
BREAKING CHANGE: The alias `gup` for `git pull --rebase` and its derivatives
are replaced by `gpr` for standardization. This means the previous aliases will
no longer be available after a few months. Meanwhile, the original aliases are
still working, with a deprecation notice.
See https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/README.md#deprecated-aliases
for the full list of deprecated aliases.
Fixes#11104Closes#11224
Co-authored-by: Marc Cornellà <marc@mcornella.com>