Compare commits

...
10 Commits
Author SHA1 Message Date
dependabot[bot] 93b87c9c9a chore(deps): bump semver (#14271)
Signed-off-by: dependabot[bot] <support@github.com>
2026-11-24 10:49:33 +01:00
dependabot[bot] 8a85fa2243 chore(deps): bump the gha-minor group with 3 updates (#14272)
Signed-off-by: dependabot[bot] <support@github.com>
2026-11-24 10:49:18 +01:00
Faris Basha TM 6c31a91a3e docs(jj): fix dead link to the template syntax docs (#14259)
The jj documentation moved from martinvonz.github.io/jj to
docs.jj-vcs.dev, and the old templates page now returns 404.
2026-11-23 16:33:06 -08:00
TINGyu123644 c52efbc756 docs(dotenv): fix dead 1Password Environments doc link (#14257)
The link to the 1Password Environments docs used the old singular
`/docs/environment/` path which now returns 404. 1Password moved the
page to the plural `/docs/environments/` path. Updates the single link
in the dotenv plugin README so readers reach the current docs.
2026-11-23 16:16:49 -08:00
Rasmus Skovgaard Lauritsen e35c9b4b67 feat(bitwarden): add completions for bw and bws (#14261)
* feat(bws): add completion plugin

* feat(bitwarden): unify bw and bws completions
2026-11-23 15:56:41 -08:00
Divya 87aa1a9b89 fix(changelog): hide reverted commits again after the switch to 12-char hashes (#14262)
* fix(changelog): hide reverted commits again after the switch to 12-char hashes

Since #12096 the commit list is read with `--abbrev=12`, so the `types`
array is keyed by 12-character hashes, but `commit:is-revert` still
returned the first 7 characters of the reverted hash. The lookup in
`display-release` never matched, and both a reverted commit and its
`Revert "..."` commit were listed in the changelog.

* test(changelog): cover hiding reverted commits
2026-11-22 10:18:48 -08:00
Divya ca0a63f0ee fix(jsontools): print JSON, not YAML, in pp_json with the ruby method (#14263)
* fix(jsontools): print JSON, not YAML, in `pp_json` with the ruby method

The ruby implementation of `pp_json` converted the parsed input to YAML
(`to_yaml`), while the node and python3 implementations, and the README,
pretty-print JSON. Use `JSON.pretty_generate` with the same 4-space
indent as the other methods.

* test(jsontools): cover the ruby method
2026-11-22 10:16:39 -08:00
Martino Pulici a7f4e49946 fix(alias-finder): avoid echo escape evaluation and xargs errors (#14264) 2026-11-22 10:12:23 -08:00
Julian Oes 3ecde00d94 fix(mortalscumbag): compare against the tracked branch, not origin (#14265)
The ahead/behind markers compared HEAD with `origin/<branch>`, so in a
fork where the branch tracks a different remote they reported the
difference to `origin` instead of to the branch's own upstream. Use
`@{upstream}`, like `git_commits_ahead`/`git_commits_behind` in
lib/git.zsh do. A branch without an upstream shows no marker.
2026-11-22 10:09:30 -08:00
Sainnhe Park 902761f897 feat(gcloud): support FreeBSD (#14268)
FreeBSD installs zsh completion def into `/usr/local/google-cloud-sdk/completion.zsh.inc`. This commit adds `/usr/local/google-cloud-sdk` to `search_locations` so the gcloud plugin can discover this file.
2026-11-22 09:55:06 -08:00
17 changed files with 199 additions and 21 deletions

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@ jobs:
contents: write # this is needed to push commits and branches
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit
@@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
- name: Authenticate as @ohmyzsh
id: generate-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
with:
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
@@ -3,5 +3,5 @@ charset-normalizer==3.5.2
idna==3.20
PyYAML==6.0.3
requests==2.34.2
semver==3.1.1
semver==3.1.2
urllib3==2.8.0
+2 -2
View File
@@ -26,7 +26,7 @@ jobs:
- macos-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit
@@ -47,7 +47,7 @@ jobs:
- test
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
if: github.repository == 'ohmyzsh/ohmyzsh'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit
+2 -2
View File
@@ -17,12 +17,12 @@ jobs:
if: github.repository == 'ohmyzsh/ohmyzsh'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit
- name: Authenticate as @ohmyzsh
id: generate-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
with:
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
+2 -2
View File
@@ -36,7 +36,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with:
egress-policy: audit
@@ -46,7 +46,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
with:
results_file: results.sarif
results_format: sarif
+8 -4
View File
@@ -19,11 +19,15 @@ alias-finder() {
zstyle -t ':omz:plugins:alias-finder' cheaper && cheaper=true
# format cmd for grep
## - replace newlines with spaces
## - replace newlines and multiple spaces with one space
## - trim both ends
## - replace multiple spaces with one space
## - add escaping character to special characters
cmd=$(echo -n "$cmd" | tr '\n' ' ' | xargs | tr -s '[:space:]' | sed 's/[].\|$(){}?+*^[]/\\&/g')
setopt localoptions extendedglob
cmd=${cmd//[[:space:]]##/ }
cmd=${cmd# }
cmd=${cmd% }
local esc_pattern='(#m)[][.\\|$(){}?+*^]' MATCH MBEGIN MEND
cmd=${cmd//${~esc_pattern}/\\$MATCH}
if [[ $longer == true ]]; then
wordEnd="" # remove wordEnd to find longer aliases
@@ -35,7 +39,7 @@ alias-finder() {
# make filter to find only shorter results than current cmd
if [[ $cheaper == true ]]; then
cmdLen=$(echo -n "$cmd" | wc -c)
cmdLen=${#cmd}
if [[ $cmdLen -le 1 ]]; then
return
fi
+16
View File
@@ -0,0 +1,16 @@
# Bitwarden plugin
This plugin adds Zsh completions for whichever Bitwarden CLIs are installed:
- [Bitwarden CLI (`bw`)](https://bitwarden.com/help/cli/)
- [Bitwarden Secrets Manager CLI (`bws`)](https://bitwarden.com/help/secrets-manager-cli/)
To enable it, add `bitwarden` to the plugins array in your `.zshrc`:
```zsh
plugins=(... bitwarden)
```
Each installed CLI generates and refreshes its own completion cache in the
background when the plugin loads. The cache files are
`$ZSH_CACHE_DIR/completions/_bw` and `$ZSH_CACHE_DIR/completions/_bws`.
+45
View File
@@ -0,0 +1,45 @@
# Autocompletion for the Bitwarden CLI (bw) and Secrets Manager CLI (bws).
() {
local cli completion cache_file
local -a generator_args
for cli in bw bws; do
completion="_$cli"
cache_file="$ZSH_CACHE_DIR/completions/$completion"
if (( ! $+commands[$cli] )); then
# compinit can register a cached completion after the CLI is removed.
if [[ -f "$cache_file" && ${_comps[$cli]-} == "$completion" ]]; then
unset "_comps[$cli]"
fi
continue
fi
case "$cli" in
bw)
generator_args=(completion --shell zsh)
# bw emits function definitions. Use ksh-style autoload to run _bw
# on the first Tab press as well as loading its helper functions.
autoload -Uk "$completion"
;;
bws)
generator_args=(completions zsh)
autoload -Uz "$completion"
;;
esac
# Register the completion if compinit hasn't picked it up yet.
if [[ -z ${_comps[$cli]-} ]]; then
_comps[$cli]=$completion
fi
() {
zmodload -F zsh/files b:zf_mv || return
local temp_file
temp_file=$(mktemp "${cache_file:h}/.$completion.XXXXXXXX") || return
if command "$cli" "$@" >| "$temp_file" && [[ -s "$temp_file" ]] &&
zf_mv -f -- "$temp_file" "$cache_file"; then
return
fi
rm -f -- "$temp_file"
} "${generator_args[@]}" &|
done
}
+1 -1
View File
@@ -100,7 +100,7 @@ takes preference, _i.e._ the .env file will never be sourced.
## Named Pipe (FIFO) Support
The plugin supports `.env` files provided as UNIX named pipes (FIFOs) in addition to regular files.
This is useful when secrets managers like [1Password Environments](https://developer.1password.com/docs/environment/)
This is useful when secrets managers like [1Password Environments](https://developer.1password.com/docs/environments/)
mount `.env` files as named pipes to inject secrets on-the-fly without writing them to disk.
No additional configuration is required — the plugin automatically detects and sources named pipes.
+1
View File
@@ -7,6 +7,7 @@ if [[ -z "${CLOUDSDK_HOME}" ]]; then
search_locations=(
"$HOME/google-cloud-sdk"
"/usr/local/share/google-cloud-sdk"
"/usr/local/google-cloud-sdk"
"/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
"/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
"/opt/homebrew/share/google-cloud-sdk"
+1 -1
View File
@@ -70,7 +70,7 @@ plugins=(... jj)
## Prompt usage
Because `jj` has a very powerful [template syntax](https://martinvonz.github.io/jj/latest/templates/), this
Because `jj` has a very powerful [template syntax](https://docs.jj-vcs.dev/latest/templates/), this
plugin only exposes a convenience function `jj_prompt_template` to read information from the current change.
It is basically the same as `jj log --no-graph -r @ -T $1`:
+1 -2
View File
@@ -86,8 +86,7 @@ print(unquote_plus(sys.stdin.read()))
function pp_json() {
ruby -e '
require "json"
require "yaml"
puts JSON.parse(STDIN.read).to_yaml
puts JSON.pretty_generate(JSON.parse(STDIN.read), indent: " ")
'
}
function is_json() {
@@ -0,0 +1,54 @@
#!/usr/bin/env zsh
# Run with: zsh -df plugins/jsontools/tests/jsontools-ruby.test.zsh
emulate -L zsh
setopt err_return
(( $+commands[ruby] )) || {
print -u2 'These tests require Ruby.'
exit 1
}
JSONTOOLS_METHOD=ruby
source "${0:A:h:h}/jsontools.plugin.zsh"
local test_dir=$(mktemp -d)
check_output() {
local tool=$1 description=$2 expected_status=${3:-0}
local -i result=0
$tool < "$test_dir/input" > "$test_dir/actual" || result=$?
if (( result != expected_status )) \
|| ! cmp -s "$test_dir/expected" "$test_dir/actual"; then
print -u2 -r -- "FAIL: $description ($tool exited $result)"
return 1
fi
print -r -- "PASS: $description"
}
{
# pp_json prints JSON with the same 4-space indent as the node and python3 methods.
print -rn -- '{"value":42}' > "$test_dir/input"
printf '{\n "value": 42\n}\n' > "$test_dir/expected"
check_output pp_json 'pretty-print a small document'
print -rn -- '{"list":[1,"two"],"nested":{"a":null,"b":true}}' > "$test_dir/input"
printf '{\n "list": [\n 1,\n "two"\n ],\n "nested": {\n "a": null,\n "b": true\n }\n}\n' \
> "$test_dir/expected"
check_output pp_json 'pretty-print a nested document'
printf '{"a":1}\n[2]\n' > "$test_dir/input"
printf '{\n "a": 1\n}\n[\n 2\n]\n' > "$test_dir/expected"
check_output pp_ndjson 'pretty-print NDJSON'
print -rn -- '{"value":42}' > "$test_dir/input"
print -r -- true > "$test_dir/expected"
check_output is_json 'validate a document'
print -rn -- '{invalid}' > "$test_dir/input"
print -r -- false > "$test_dir/expected"
check_output is_json 'reject invalid JSON' 1
print 'All jsontools Ruby tests passed.'
} always {
rm -rf -- "$test_dir"
}
+2 -2
View File
@@ -5,12 +5,12 @@ function my_git_prompt() {
STATUS=""
# is branch ahead?
if $(echo "$(git log origin/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
if $(echo "$(git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
# is branch behind?
if $(echo "$(git log HEAD..origin/$(git_current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
if $(echo "$(git log HEAD..@{upstream} 2> /dev/null)" | grep '^commit' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
+2 -1
View File
@@ -119,12 +119,13 @@ function parse-commit {
}
# Return truncated hash of the reverted commit
# (12 characters, to match the commit hashes from `git log --abbrev=12`)
function commit:is-revert {
local subject="$1" body="$2"
if [[ "$subject" = Revert* && \
"$body" =~ "This reverts commit ([^.]+)\." ]]; then
echo "${match[1]:0:7}"
echo "${match[1]:0:12}"
else
return 1
fi
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env zsh
# Run with: zsh -df tools/tests/changelog.test.zsh
emulate -L zsh
setopt err_return
local changelog="${0:A:h:h}/changelog.sh"
local test_dir=$(mktemp -d) original_dir=$PWD
# Isolate the test repository from the user's git configuration.
export GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1
export GIT_AUTHOR_NAME=test GIT_AUTHOR_EMAIL=test@example.com
export GIT_COMMITTER_NAME=test GIT_COMMITTER_EMAIL=test@example.com
# check_changelog <description> <until> <since> <patterns...>
# Each pattern must match a line of the output; a leading ! means no line may match it.
check_changelog() {
local description=$1 until=$2 since=$3 pattern
shift 3
local -a lines
lines=("${(@f)$(zsh -f "$changelog" "$until" "$since" --raw)}")
for pattern; do
if [[ $pattern = !* ]]; then
(( ! ${lines[(I)${~pattern#!}]} )) && continue
else
(( ${lines[(I)${~pattern}]} )) && continue
fi
print -u2 -r -- "FAIL: $description (pattern: $pattern)"
print -u2 -rl -- $lines
return 1
done
print -r -- "PASS: $description"
}
{
builtin cd "$test_dir"
command git init -q
command git commit -q --allow-empty -m 'chore: initial commit'
print demo > demo && command git add demo
command git commit -q -m 'feat(demo): add a demo feature'
print core > core && command git add core
command git commit -q -m 'fix(core): fix an unrelated bug'
command git revert --no-edit HEAD~1 >/dev/null
check_changelog 'hide a reverted commit and its revert' HEAD HEAD~3 \
'*Fix an unrelated bug' '!*Add a demo feature' '!*Revert *'
check_changelog 'keep a revert whose reverted commit is not in the range' HEAD HEAD~2 \
'*Fix an unrelated bug' '*Revert "feat\(demo\): add a demo feature"'
check_changelog 'keep a commit that has not been reverted yet' HEAD~1 HEAD~3 \
'*Add a demo feature' '*Fix an unrelated bug'
print 'All changelog tests passed.'
} always {
builtin cd "$original_dir"
rm -rf -- "$test_dir"
}