From 48a62a9f713449a014d66b01afd99a4fcf1911fe Mon Sep 17 00:00:00 2001 From: Kapil Pau Date: Fri, 13 Oct 2023 23:11:47 +0100 Subject: [PATCH 01/29] feat(span): Introducing Snapcraft CLI plugin (#9357) --- plugins/snap/README.md | 18 ++++++++++++++++++ plugins/snap/snap.plugin.zsh | 10 ++++++++++ 2 files changed, 28 insertions(+) create mode 100644 plugins/snap/README.md create mode 100644 plugins/snap/snap.plugin.zsh diff --git a/plugins/snap/README.md b/plugins/snap/README.md new file mode 100644 index 000000000..75c5ec19a --- /dev/null +++ b/plugins/snap/README.md @@ -0,0 +1,18 @@ +# snap plugin + +This plugin sets up aliases for the common [snap](https://snapcraft.io/docs/getting-started) commands + +## Aliases + +| Alias | Full command | +| --- | ---| +| sv | snap version | +| sf | snap find | +| si | snap install | +| sin | snap info | +| sr | snap remove | +| sref | snap refresh | +| srev | snap revert | +| sl | snap list | +| sd | snap disable | +| se | snap enable | diff --git a/plugins/snap/snap.plugin.zsh b/plugins/snap/snap.plugin.zsh new file mode 100644 index 000000000..af2346978 --- /dev/null +++ b/plugins/snap/snap.plugin.zsh @@ -0,0 +1,10 @@ +alias sv="snap version" +alias sf="snap find" +alias si="snap install" +alias sin="snap info" +alias sr="snap remove" +alias sref="snap refresh" +alias srev="snap revert" +alias sl="snap list" +alias sd="snap disable" +alias se="snap enable" From 2db53ff1da078b2207cb98736370f1f145e5c667 Mon Sep 17 00:00:00 2001 From: Steve Lessard Jr Date: Fri, 13 Oct 2023 18:26:16 -0400 Subject: [PATCH 02/29] fix(avit): RPROMPT Fix for #10307 (#11131) Co-authored-by: Steve Lessard --- themes/avit.zsh-theme | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index 1279ea919..206274462 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -11,7 +11,12 @@ $(_user_host)${_current_dir} $(git_prompt_info) $(ruby_prompt_info) PROMPT2='%{%(!.${fg[red]}.${fg[white]})%}◀%{$reset_color%} ' -RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}' +__RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}' +if [[ -z $RPROMPT ]]; then + RPROMPT=$__RPROMPT +else + RPROMPT="${RPROMPT} ${__RPROMPT}" +fi function _user_host() { local me From f7130bb529a2d15652f739c552688b34aac63315 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Fri, 13 Oct 2023 15:38:13 -0700 Subject: [PATCH 03/29] fix(gnzh): Don't show .local for local hostnames in theme Fixes #10871 --- themes/gnzh.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 1e6c4e93b..ca62320e2 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -21,7 +21,7 @@ fi if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then PR_HOST='%F{red}%M%f' # SSH else - PR_HOST='%F{green}%M%f' # no SSH + PR_HOST='%F{green}%m%f' # no SSH fi From f93976875133409297be864ce94d50f20a9bc18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 14 Oct 2023 16:40:45 +0200 Subject: [PATCH 04/29] fix(git): fix fallback to develop branch if `master` not found (#11966) --- plugins/git/git.plugin.zsh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index b0376308f..d053a7638 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -20,26 +20,31 @@ function current_branch() { function git_develop_branch() { command git rev-parse --git-dir &>/dev/null || return local branch - for branch in dev devel development; do + for branch in dev devel develop development; do if command git show-ref -q --verify refs/heads/$branch; then echo $branch - return + return 0 fi done + echo develop + return 1 } # Check if main exists and use instead of master function git_main_branch() { command git rev-parse --git-dir &>/dev/null || return local ref - for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default}; do + for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}; do if command git show-ref -q --verify $ref; then echo ${ref:t} - return + return 0 fi done + + # If no main branch was found, fall back to master but return error echo master + return 1 } function grename() { @@ -129,6 +134,8 @@ function gbda() { git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null local default_branch=$(git_main_branch) + (( ! $? )) || default_branch=$(git_develop_branch) + git for-each-ref refs/heads/ "--format=%(refname:short)" | \ while read branch; do local merge_base=$(git merge-base $default_branch $branch) From 96c976637a4112e1e72a1a449ac51d78acc67597 Mon Sep 17 00:00:00 2001 From: nishanthps-cai <123212871+nishanthps-cai@users.noreply.github.com> Date: Tue, 17 Oct 2023 00:55:05 -0700 Subject: [PATCH 05/29] feat(bazel): use completion also for bazelisk (#11984) --- plugins/bazel/_bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bazel/_bazel b/plugins/bazel/_bazel index c34c572b0..ea1f4cace 100644 --- a/plugins/bazel/_bazel +++ b/plugins/bazel/_bazel @@ -1,4 +1,4 @@ -#compdef bazel +#compdef bazel bazelisk # Copyright 2015 The Bazel Authors. All rights reserved. # From d3112d67a3eb55fc39975f917467704ebb2c296b Mon Sep 17 00:00:00 2001 From: Vyacheslav Scherbinin Date: Wed, 18 Oct 2023 14:18:05 +0700 Subject: [PATCH 06/29] feat(vscode): allow arguments to `vsc` alias (#11903) Co-authored-by: Carlo Sala --- plugins/vscode/README.md | 3 ++- plugins/vscode/vscode.plugin.zsh | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md index e95ed5d4f..726b23d35 100644 --- a/plugins/vscode/README.md +++ b/plugins/vscode/README.md @@ -31,7 +31,7 @@ the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell ## Using multiple flavours -If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can +If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines). This will make the plugin use your manually defined executable. @@ -53,6 +53,7 @@ source $ZSH/oh-my-zsh.sh | Alias | Command | Description | | ----------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------- | | vsc | code . | Open the current folder in VS code | +| vsc `dir` | code `dir` | Open passed folder in VS code | | vsca `dir` | code --add `dir` | Add folder(s) to the last active window | | vscd `file` `file` | code --diff `file` `file` | Compare two files with each other. | | vscg `file:line[:char]` | code --goto `file:line[:char]` | Open a file at the path on the specified line and character position. | diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh index 48d904377..356c62360 100644 --- a/plugins/vscode/vscode.plugin.zsh +++ b/plugins/vscode/vscode.plugin.zsh @@ -23,7 +23,14 @@ if [[ -z "$VSCODE" ]]; then fi fi -alias vsc="$VSCODE ." +function vsc { + if (( $# )); then + $VSCODE $@ + else + $VSCODE . + fi +} + alias vsca="$VSCODE --add" alias vscd="$VSCODE --diff" alias vscg="$VSCODE --goto" From f10cd5281d805bb5679dd46b304d9b8997f98981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Krawaczy=C5=84ski?= Date: Wed, 18 Oct 2023 13:59:28 +0200 Subject: [PATCH 07/29] feat(history): add `hl` alias (#11990) --- plugins/history/README.md | 1 + plugins/history/history.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/history/README.md b/plugins/history/README.md index a9d480f46..73d6a5052 100644 --- a/plugins/history/README.md +++ b/plugins/history/README.md @@ -13,5 +13,6 @@ plugins=(... history) | Alias | Command | Description | |-------|----------------------|------------------------------------------------------------------| | `h` | `history` | Prints your command history | +| `hl` | `history \| less` | Pipe history output to less to search and navigate it easily | | `hs` | `history \| grep` | Use grep to search your command history | | `hsi` | `history \| grep -i` | Use grep to do a case-insensitive search of your command history | diff --git a/plugins/history/history.plugin.zsh b/plugins/history/history.plugin.zsh index 9cee48fe4..fb3e31389 100644 --- a/plugins/history/history.plugin.zsh +++ b/plugins/history/history.plugin.zsh @@ -1,3 +1,4 @@ alias h='history' +alias hl='history | less' alias hs='history | grep' alias hsi='history | grep -i' From b696288337618ca749369a679bd77989bd4cd47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my?= Date: Wed, 18 Oct 2023 19:27:47 +0200 Subject: [PATCH 08/29] feat(kubectl): add `kgdsa` alias (#11863) --- plugins/kubectl/kubectl.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 315d3ce93..0dd4e691a 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -162,6 +162,7 @@ alias kdelsa="kubectl delete sa" # DaemonSet management. alias kgds='kubectl get daemonset' +alias kgdsa='kubectl get daemonset --all-namespaces' alias kgdsw='kgds --watch' alias keds='kubectl edit daemonset' alias kdds='kubectl describe daemonset' From 8152dc673b14c89dc12e816583e24532ed77e8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 18 Oct 2023 20:01:58 +0200 Subject: [PATCH 09/29] fix(git): move squash-merged branch deletion from `gbda` to `gbds` function (#11991) --- plugins/git/README.md | 3 ++- plugins/git/git.plugin.zsh | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index a4e9f4c4a..724965302 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -250,7 +250,8 @@ receive further support. | `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. | | `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. | | `grename ` | Renames branch `` to ``, including on the origin remote. | -| `gbda` | Deletes all merged and squash-merged branches | +| `gbda` | Deletes all merged branches | +| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) | ### Work in Progress (WIP) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index d053a7638..48937cb83 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -128,11 +128,13 @@ alias gba='git branch --all' alias gbd='git branch --delete' alias gbD='git branch --delete --force' -# Copied and modified from James Roeder (jmaroeder) under MIT License -# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish function gbda() { git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null +} +# Copied and modified from James Roeder (jmaroeder) under MIT License +# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish +function gbds() { local default_branch=$(git_main_branch) (( ! $? )) || default_branch=$(git_develop_branch) From 0da416986aadbaf89dc5596b01f9b42403f4d9fd Mon Sep 17 00:00:00 2001 From: Vishal Sharma <106011641+vishal-sharma-369@users.noreply.github.com> Date: Wed, 18 Oct 2023 23:44:47 +0530 Subject: [PATCH 10/29] fix(ssh-agent): add error message if `~/.ssh` is not found (#11929) Closes #11829 Co-authored-by: Carlo Sala --- plugins/ssh-agent/ssh-agent.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 78ac46b13..49ad95a11 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -13,6 +13,11 @@ function _start_agent() { fi fi + if [[ ! -d "$HOME/.ssh" ]]; then + echo "[oh-my-zsh] ssh-agent plugin requires ~/.ssh directory" + return 1 + fi + # Set a maximum lifetime for identities added to ssh-agent local lifetime zstyle -s :omz:plugins:ssh-agent lifetime lifetime From 104041a018dc9a3eb74f93815192dba4c9386e1a Mon Sep 17 00:00:00 2001 From: Peat Bakke Date: Thu, 19 Oct 2023 02:49:38 -0700 Subject: [PATCH 11/29] feat(tmux): add `tds` alias for directory sessions (#11987) --- plugins/tmux/README.md | 1 + plugins/tmux/tmux.plugin.zsh | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 0f8473daf..b4516ef26 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -25,6 +25,7 @@ The plugin also supports the following: | `tkss` | tmux kill-session -t | Terminate named running tmux session | | `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session | | `tmuxconf` | `$EDITOR $ZSH_TMUX_CONFIG` | Open .tmux.conf file with an editor | +| `tds` | `_tmux_directory_session` | Creates or attaches to a session for the current path | ## Configuration Variables diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 6ed91c447..72cdd4818 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -108,6 +108,19 @@ compdef _tmux _zsh_tmux_plugin_run # Alias tmux to our wrapper function. alias tmux=_zsh_tmux_plugin_run +function _tmux_directory_session() { + # current directory without leading path + local dir=${PWD##*/} + # md5 hash for the full working directory path + local md5=$(printf '%s' "$PWD" | md5sum | cut -d ' ' -f 1) + # human friendly unique session name for this directory + local session_name="${dir}-${md5:0:6}" + # create or attach to the session + tmux new -As "$session_name" +} + +alias tds=_tmux_directory_session + # Autostart if not already in tmux and enabled. if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" ]]; then # Actually don't autostart if we already did and multiple autostarts are disabled. From a8dee63ffe8839d3bcf1066f8359fa43caccf3f2 Mon Sep 17 00:00:00 2001 From: Ryan Tvenge Date: Thu, 19 Oct 2023 09:41:36 -0500 Subject: [PATCH 12/29] feat(lando): bypass `lando` if command is not available in container (#11993) Closes #11993 --- plugins/lando/lando.plugin.zsh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/lando/lando.plugin.zsh b/plugins/lando/lando.plugin.zsh index af53e7e5a..b5fa80092 100644 --- a/plugins/lando/lando.plugin.zsh +++ b/plugins/lando/lando.plugin.zsh @@ -11,15 +11,23 @@ function artisan \ php \ wp \ yarn { - if checkForLandoFile; then - lando "$0" "$@" + # If the lando task is available in `lando --help`, then it means: + # + # 1. `lando` is in a project with a `.lando.yml` file. + # 2. The lando task is available for lando, based on the .lando.yml config file. + # + # This has a penalty of about 250ms, so we still want to check if the lando file + # exists before, which is the fast path. If it exists, checking help output is + # still faster than running the command and failing. + if _lando_file_exists && lando --help 2>&1 | command grep -Eq "^ +lando $0 "; then + command lando "$0" "$@" else command "$0" "$@" fi } # Check for the file in the current and parent directories. -checkForLandoFile() { +_lando_file_exists() { # Only bother checking for lando within the Sites directory. if [[ "$PWD/" != "$LANDO_ZSH_SITES_DIRECTORY"/* ]]; then # Not within $LANDO_ZSH_SITES_DIRECTORY @@ -38,4 +46,4 @@ checkForLandoFile() { # Could not find $LANDO_ZSH_CONFIG_FILE in the current directory # or in any of its parents up to $LANDO_ZSH_SITES_DIRECTORY. return 1 -} \ No newline at end of file +} From d082d87580f05cca524c546d54eb8009cf8bb10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 19 Oct 2023 20:35:01 +0200 Subject: [PATCH 13/29] refactor(lando): add `LANDO_ZSH_WRAPPED_COMMANDS` setting and refactor --- plugins/lando/README.md | 24 +++++++++++++++++++++--- plugins/lando/lando.plugin.zsh | 19 +++++++++++-------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/plugins/lando/README.md b/plugins/lando/README.md index 6daeae4e4..2f881cf3d 100644 --- a/plugins/lando/README.md +++ b/plugins/lando/README.md @@ -8,7 +8,7 @@ To use it, add `lando` to the plugins array in your zshrc file: plugins=(... lando) ``` -## ALIASES: +## Wrapped Commands | Alias | Description | |:----------:|:----------------:| @@ -21,16 +21,34 @@ plugins=(... lando) | `wp` | `lando wp` | | `yarn` | `lando yarn` | +More or different commands can be wrapped by setting the `LANDO_ZSH_WRAPPED_COMMANDS` setting, see [Settings](#settings) below. + ## How It Works: This plugin removes the requirement to type `lando` before a command. It utilizes the lando version of supported commands run within directories with the following criteria: + - The `.lando.yml` file is found in the current directory or any parent directory within `$LANDO_ZSH_SITES_DIRECTORY`. - The current directory is within `$LANDO_ZSH_SITES_DIRECTORY` but is not `$LANDO_ZSH_SITES_DIRECTORY` itself. +- If the command is not a part of the commands available in the lando environment, it will run the command without `lando`. ## Settings: -- `LANDO_ZSH_SITES_DIRECTORY`: The plugin will stop searching through parents for `CONFIG_FILE` once it hits this directory. -- `LANDO_ZSH_CONFIG_FILE`: The plugin will check to see if this provided file exists to check for presence of Lando. +> NOTE: these settings must be set *before* the plugin is loaded, and any changes require a restart of the shell to be applied. + +- `LANDO_ZSH_SITES_DIRECTORY`: The plugin will stop searching through parents for `CONFIG_FILE` once it hits this directory: + ```sh + LANDO_ZSH_SITES_DIRECTORY="$HOME/Code" + ``` + +- `LANDO_ZSH_CONFIG_FILE`: The plugin will check to see if this provided file exists to check for presence of Lando: + ```sh + LANDO_ZSH_CONFIG_FILE=".lando.dev.yml" + ``` + +- `LANDO_ZSH_WRAPPED_COMMANDS`: The list of commands to wrap, as a string of commands separated by whitespace: + ```sh + LANDO_ZSH_WRAPPED_COMMANDS="mysql php composer test artisan" + ``` ## Author: diff --git a/plugins/lando/lando.plugin.zsh b/plugins/lando/lando.plugin.zsh index b5fa80092..ee796d212 100644 --- a/plugins/lando/lando.plugin.zsh +++ b/plugins/lando/lando.plugin.zsh @@ -1,16 +1,19 @@ # Settings : ${LANDO_ZSH_SITES_DIRECTORY:="$HOME/Sites"} : ${LANDO_ZSH_CONFIG_FILE:=.lando.yml} +: ${LANDO_ZSH_WRAPPED_COMMANDS:=" + artisan + composer + drush + gulp + npm + php + wp + yarn +"} # Enable multiple commands with lando. -function artisan \ - composer \ - drush \ - gulp \ - npm \ - php \ - wp \ - yarn { +function ${=LANDO_ZSH_WRAPPED_COMMANDS} { # If the lando task is available in `lando --help`, then it means: # # 1. `lando` is in a project with a `.lando.yml` file. From 9f84ba085425800dee0b4e391d8cf377806dc75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 19 Oct 2023 20:47:26 +0200 Subject: [PATCH 14/29] feat(command-not-found): add support for Homebrew on Linux Fixes #11151 --- plugins/command-not-found/command-not-found.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index cb8a8989c..c741e18a2 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -3,9 +3,10 @@ for file ( # Arch Linux. Must have pkgfile installed: https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found /usr/share/doc/pkgfile/command-not-found.zsh - # macOS (M1 and classic Homebrew): https://github.com/Homebrew/homebrew-command-not-found + # Homebrew: https://github.com/Homebrew/homebrew-command-not-found /opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh /usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh + /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh ); do if [[ -r "$file" ]]; then source "$file" From 207d29b716301c77392ae140b1482eeba44e9102 Mon Sep 17 00:00:00 2001 From: Zeeshan Date: Tue, 4 Oct 2022 18:51:24 +0530 Subject: [PATCH 15/29] fix(git)!: standardize `git pull --rebase` aliases (#11224) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #11104 Closes #11224 Co-authored-by: Marc Cornellà --- plugins/git/README.md | 434 +++++++++++++++++++------------------ plugins/git/git.plugin.zsh | 29 ++- 2 files changed, 242 insertions(+), 221 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index 724965302..93dc8ccea 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -10,207 +10,205 @@ plugins=(... git) ## Aliases -| Alias | Command | -| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `grt` | `cd "$(git rev-parse --show-toplevel \|\| echo .)"` | -| `ggpnp` | `ggl && ggp` | -| `ggpur` | `ggu` | -| `g` | `git` | -| `ga` | `git add` | -| `gaa` | `git add --all` | -| `gapa` | `git add --patch` | -| `gau` | `git add --update` | -| `gav` | `git add --verbose` | -| `gwip` | `git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign --message "--wip-- [skip ci]"` | -| `gam` | `git am` | -| `gama` | `git am --abort` | -| `gamc` | `git am --continue` | -| `gamscp` | `git am --show-current-patch` | -| `gams` | `git am --skip` | -| `gap` | `git apply` | -| `gapt` | `git apply --3way` | -| `gbs` | `git bisect` | -| `gbsb` | `git bisect bad` | -| `gbsg` | `git bisect good` | -| `gbsn` | `git bisect new` | -| `gbso` | `git bisect old` | -| `gbsr` | `git bisect reset` | -| `gbss` | `git bisect start` | -| `gbl` | `git blame -w` | -| `gb` | `git branch` | -| `gba` | `git branch --all` | -| `gbd` | `git branch --delete` | -| `gbD` | `git branch --delete --force` | -| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` | -| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` | -| `gbm` | `git branch --move` | -| `gbnm` | `git branch --no-merged` | -| `gbr` | `git branch --remote` | -| `ggsup` | `git branch --set-upstream-to=origin/$(git_current_branch)` | -| `gbg` | `LANG=C git branch -vv \| grep ": gone\]"` | -| `gco` | `git checkout` | -| `gcor` | `git checkout --recurse-submodules` | -| `gcb` | `git checkout -b` | -| `gcd` | `git checkout $(git_develop_branch)` | -| `gcm` | `git checkout $(git_main_branch)` | -| `gcp` | `git cherry-pick` | -| `gcpa` | `git cherry-pick --abort` | -| `gcpc` | `git cherry-pick --continue` | -| `gclean` | `git clean --interactive -d` | -| `gcl` | `git clone --recurse-submodules` | -| `gccd` | `git clone --recurse-submodules "$@" && cd "$(basename $\_ .git)"` | -| `gcam` | `git commit --all --message` | -| `gcas` | `git commit --all --signoff` | -| `gcasm` | `git commit --all --signoff --message` | -| `gcmsg` | `git commit --message` | -| `gcsm` | `git commit --signoff --message` | -| `gc` | `git commit --verbose` | -| `gca` | `git commit --verbose --all` | -| `gca!` | `git commit --verbose --all --amend` | -| `gcan!` | `git commit --verbose --all --no-edit --amend` | -| `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` | -| `gc!` | `git commit --verbose --amend` | -| `gcn!` | `git commit --verbose --no-edit --amend` | -| `gcs` | `git commit -S` | -| `gcss` | `git commit -S -s` | -| `gcssm` | `git commit -S -s -m` | -| `gcf` | `git config --list` | -| `gdct` | `git describe --tags $(git rev-list --tags --max-count=1)` | -| `gd` | `git diff` | -| `gdca` | `git diff --cached` | -| `gdcw` | `git diff --cached --word-diff` | -| `gds` | `git diff --staged` | -| `gdw` | `git diff --word-diff` | -| `gdv` | `git diff -w "$@" \| view -` | -| `gdup` | `git diff @{upstream}` | -| `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` | -| `gdt` | `git diff-tree --no-commit-id --name-only -r` | -| `gf` | `git fetch` | -| `gfa` | `git fetch --all --prune` | -| `gfo` | `git fetch origin` | -| `gg` | `git gui citool` | -| `gga` | `git gui citool --amend` | -| `ghh` | `git help` | -| `glgg` | `git log --graph` | -| `glgga` | `git log --graph --decorate --all` | -| `glgm` | `git log --graph --max-count=10` | -| `glod` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'` | -| `glods` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short` | -| `glol` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'` | -| `glola` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --all` | -| `glols` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --stat` | -| `glo` | `git log --oneline --decorate` | -| `glog` | `git log --oneline --decorate --graph` | -| `gloga` | `git log --oneline --decorate --graph --all` | -| `glp` | `git log --pretty=` | -| `glg` | `git log --stat` | -| `glgp` | `git log --stat --patch` | -| `gignored` | `git ls-files -v \| grep "^[[:lower:]]"` | -| `gfg` | `git ls-files \| grep` | -| `gm` | `git merge` | -| `gma` | `git merge --abort` | -| `gms` | `git merge --squash` | -| `gmom` | `git merge origin/$(git_main_branch)` | -| `gmum` | `git merge upstream/$(git_main_branch)` | -| `gmtl` | `git mergetool --no-prompt` | -| `gmtlvim` | `git mergetool --no-prompt --tool=vimdiff` | -| `gl` | `git pull` | -| `gpr` | `git pull --rebase` | -| `gup` | `git pull --rebase` | -| `gupa` | `git pull --rebase --autostash` | -| `gupav` | `git pull --rebase --autostash --verbose` | -| `gupv` | `git pull --rebase --verbose` | -| `ggu` | `git pull --rebase origin $(current_branch)` | -| `gupom` | `git pull --rebase origin $(git_main_branch)` | -| `gupomi` | `git pull --rebase=interactive origin $(git_main_branch)` | -| `ggpull` | `git pull origin "$(git_current_branch)"` | -| `ggl` | `git pull origin $(current_branch)` | -| `gluc` | `git pull upstream $(git_current_branch)` | -| `glum` | `git pull upstream $(git_main_branch)` | -| `gp` | `git push` | -| `gpd` | `git push --dry-run` | -| `gpf!` | `git push --force` | -| `ggf` | `git push --force origin $(current_branch)` | -| `gpf` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` | -| `gpf` | On Git < 2.30: `git push --force-with-lease` | -| `ggfl` | `git push --force-with-lease origin $(current_branch)` | -| `gpsup` | `git push --set-upstream origin $(git_current_branch)` | -| `gpsupf` | On Git >= 2.30: `git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes` | -| `gpsupf` | On Git < 2.30: `git push --set-upstream origin $(git_current_branch) --force-with-lease` | -| `gpv` | `git push --verbose` | -| `gpoat` | `git push origin --all && git push origin --tags` | -| `gpod` | `git push origin --delete` | -| `ggpush` | `git push origin "$(git_current_branch)"` | -| `ggp` | `git push origin $(current_branch)` | -| `gpu` | `git push upstream` | -| `grb` | `git rebase` | -| `grba` | `git rebase --abort` | -| `grbc` | `git rebase --continue` | -| `grbi` | `git rebase --interactive` | -| `grbo` | `git rebase --onto` | -| `grbs` | `git rebase --skip` | -| `grbd` | `git rebase $(git_develop_branch)` | -| `grbm` | `git rebase $(git_main_branch)` | -| `grbom` | `git rebase origin/$(git_main_branch)` | -| `gr` | `git remote` | -| `grv` | `git remote --verbose` | -| `gra` | `git remote add` | -| `grrm` | `git remote remove` | -| `grmv` | `git remote rename` | -| `grset` | `git remote set-url` | -| `grup` | `git remote update` | -| `grh` | `git reset` | -| `gru` | `git reset --` | -| `grhh` | `git reset --hard` | -| `grhk` | `git reset --keep` | -| `grhs` | `git reset --soft` | -| `gpristine` | `git reset --hard && git clean -dffx` | -| `groh` | `git reset origin/$(git_current_branch) --hard` | -| `grs` | `git restore` | -| `grss` | `git restore --source` | -| `grst` | `git restore --staged` | -| `gunwip` | `git rev-list --max-count=1 --format="%s" HEAD \| grep -q "--wip--" && git reset HEAD~1` | -| `grev` | `git revert` | -| `grm` | `git rm` | -| `grmc` | `git rm --cached` | -| `gcount` | `git shortlog --summary -n` | -| `gsh` | `git show` | -| `gsps` | `git show --pretty=short --show-signature` | -| `gstall` | `git stash --all` | -| `gstu` | `git stash --include-untracked` | -| `gstaa` | `git stash apply` | -| `gstc` | `git stash clear` | -| `gstd` | `git stash drop` | -| `gstl` | `git stash list` | -| `gstp` | `git stash pop` | -| `gsta` | On Git >= 2.13: `git stash push` | -| `gsta` | On Git < 2.13: `git stash save` | -| `gsts` | `git stash show --patch` | -| `gst` | `git status` | -| `gss` | `git status --short` | -| `gsb` | `git status --short -b` | -| `gsi` | `git submodule init` | -| `gsu` | `git submodule update` | -| `gsd` | `git svn dcommit` | -| `git-svn-dcommit-push` | `git svn dcommit && git push github $(git_main_branch):svntrunk` | -| `gsr` | `git svn rebase` | -| `gsw` | `git switch` | -| `gswc` | `git switch -c` | -| `gswd` | `git switch $(git_develop_branch)` | -| `gswm` | `git switch $(git_main_branch)` | -| `gta` | `git tag --annotate` | -| `gts` | `git tag -s` | -| `gtv` | `git tag \| sort -V` | -| `gignore` | `git update-index --assume-unchanged` | -| `gunignore` | `git update-index --no-assume-unchanged` | -| `gwch` | `git whatchanged -p --abbrev-commit --pretty=medium` | -| `gwt` | `git worktree` | -| `gwtls` | `git worktree list` | -| `gwtmv` | `git worktree move` | -| `gwtrm` | `git worktree remove` | -| `gk` | `gitk --all --branches &!` | -| `gke` | `gitk --all $(git log --walk-reflogs --pretty=%h) &!` | -| `gtl` | `gtl(){ git tag --sort=-v:refname -n --list ${1}\* }; noglob gtl` | +| Alias | Command | +| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------ | +| `grt` | `cd "$(git rev-parse --show-toplevel \|\| echo .)"` | +| `ggpnp` | `ggl && ggp` | +| `ggpur` | `ggu` | +| `g` | `git` | +| `ga` | `git add` | +| `gaa` | `git add --all` | +| `gapa` | `git add --patch` | +| `gau` | `git add --update` | +| `gav` | `git add --verbose` | +| `gwip` | `git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign --message "--wip-- [skip ci]"` | +| `gam` | `git am` | +| `gama` | `git am --abort` | +| `gamc` | `git am --continue` | +| `gamscp` | `git am --show-current-patch` | +| `gams` | `git am --skip` | +| `gap` | `git apply` | +| `gapt` | `git apply --3way` | +| `gbs` | `git bisect` | +| `gbsb` | `git bisect bad` | +| `gbsg` | `git bisect good` | +| `gbsn` | `git bisect new` | +| `gbso` | `git bisect old` | +| `gbsr` | `git bisect reset` | +| `gbss` | `git bisect start` | +| `gbl` | `git blame -w` | +| `gb` | `git branch` | +| `gba` | `git branch --all` | +| `gbd` | `git branch --delete` | +| `gbD` | `git branch --delete --force` | +| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` | +| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` | +| `gbm` | `git branch --move` | +| `gbnm` | `git branch --no-merged` | +| `gbr` | `git branch --remote` | +| `ggsup` | `git branch --set-upstream-to=origin/$(git_current_branch)` | +| `gbg` | `LANG=C git branch -vv \| grep ": gone\]"` | +| `gco` | `git checkout` | +| `gcor` | `git checkout --recurse-submodules` | +| `gcb` | `git checkout -b` | +| `gcd` | `git checkout $(git_develop_branch)` | +| `gcm` | `git checkout $(git_main_branch)` | +| `gcp` | `git cherry-pick` | +| `gcpa` | `git cherry-pick --abort` | +| `gcpc` | `git cherry-pick --continue` | +| `gclean` | `git clean --interactive -d` | +| `gcl` | `git clone --recurse-submodules` | +| `gccd` | `git clone --recurse-submodules "$@" && cd "$(basename $\_ .git)"` | +| `gcam` | `git commit --all --message` | +| `gcas` | `git commit --all --signoff` | +| `gcasm` | `git commit --all --signoff --message` | +| `gcmsg` | `git commit --message` | +| `gcsm` | `git commit --signoff --message` | +| `gc` | `git commit --verbose` | +| `gca` | `git commit --verbose --all` | +| `gca!` | `git commit --verbose --all --amend` | +| `gcan!` | `git commit --verbose --all --no-edit --amend` | +| `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` | +| `gc!` | `git commit --verbose --amend` | +| `gcn!` | `git commit --verbose --no-edit --amend` | +| `gcs` | `git commit -S` | +| `gcss` | `git commit -S -s` | +| `gcssm` | `git commit -S -s -m` | +| `gcf` | `git config --list` | +| `gdct` | `git describe --tags $(git rev-list --tags --max-count=1)` | +| `gd` | `git diff` | +| `gdca` | `git diff --cached` | +| `gdcw` | `git diff --cached --word-diff` | +| `gds` | `git diff --staged` | +| `gdw` | `git diff --word-diff` | +| `gdv` | `git diff -w "$@" \| view -` | +| `gdup` | `git diff @{upstream}` | +| `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` | +| `gdt` | `git diff-tree --no-commit-id --name-only -r` | +| `gf` | `git fetch` | +| `gfa` | `git fetch --all --prune` | +| `gfo` | `git fetch origin` | +| `gg` | `git gui citool` | +| `gga` | `git gui citool --amend` | +| `ghh` | `git help` | +| `glgg` | `git log --graph` | +| `glgga` | `git log --graph --decorate --all` | +| `glgm` | `git log --graph --max-count=10` | +| `glod` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'` | +| `glods` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short` | +| `glol` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'` | +| `glola` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --all` | +| `glols` | `git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --stat` | +| `glo` | `git log --oneline --decorate` | +| `glog` | `git log --oneline --decorate --graph` | +| `gloga` | `git log --oneline --decorate --graph --all` | +| `glp` | `git log --pretty=` | +| `glg` | `git log --stat` | +| `glgp` | `git log --stat --patch` | +| `gignored` | `git ls-files -v \| grep "^[[:lower:]]"` | +| `gfg` | `git ls-files \| grep` | +| `gm` | `git merge` | +| `gma` | `git merge --abort` | +| `gms` | `git merge --squash` | +| `gmom` | `git merge origin/$(git_main_branch)` | +| `gmum` | `git merge upstream/$(git_main_branch)` | +| `gmtl` | `git mergetool --no-prompt` | +| `gmtlvim` | `git mergetool --no-prompt --tool=vimdiff` | +| `gl` | `git pull` | +| `gpr` | `git pull --rebase` | +| `gprv` | `git pull --rebase -v` | +| `gpra` | `git pull --rebase --autostash` | +| `gprav` | `git pull --rebase --autostash -v` | +| `gprom` | `git pull --rebase origin $(git_main_branch)` | +| `gpromi` | `git pull --rebase=interactive origin $(git_main_branch)` | +| `ggpull` | `git pull origin "$(git_current_branch)"` | +| `ggl` | `git pull origin $(current_branch)` | +| `gluc` | `git pull upstream $(git_current_branch)` | +| `glum` | `git pull upstream $(git_main_branch)` | +| `gp` | `git push` | +| `gpd` | `git push --dry-run` | +| `gpf!` | `git push --force` | +| `ggf` | `git push --force origin $(current_branch)` | +| `gpf` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` | +| `gpf` | On Git < 2.30: `git push --force-with-lease` | +| `ggfl` | `git push --force-with-lease origin $(current_branch)` | +| `gpsup` | `git push --set-upstream origin $(git_current_branch)` | +| `gpsupf` | On Git >= 2.30: `git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes` | +| `gpsupf` | On Git < 2.30: `git push --set-upstream origin $(git_current_branch) --force-with-lease` | +| `gpv` | `git push --verbose` | +| `gpoat` | `git push origin --all && git push origin --tags` | +| `gpod` | `git push origin --delete` | +| `ggpush` | `git push origin "$(git_current_branch)"` | +| `ggp` | `git push origin $(current_branch)` | +| `gpu` | `git push upstream` | +| `grb` | `git rebase` | +| `grba` | `git rebase --abort` | +| `grbc` | `git rebase --continue` | +| `grbi` | `git rebase --interactive` | +| `grbo` | `git rebase --onto` | +| `grbs` | `git rebase --skip` | +| `grbd` | `git rebase $(git_develop_branch)` | +| `grbm` | `git rebase $(git_main_branch)` | +| `grbom` | `git rebase origin/$(git_main_branch)` | +| `gr` | `git remote` | +| `grv` | `git remote --verbose` | +| `gra` | `git remote add` | +| `grrm` | `git remote remove` | +| `grmv` | `git remote rename` | +| `grset` | `git remote set-url` | +| `grup` | `git remote update` | +| `grh` | `git reset` | +| `gru` | `git reset --` | +| `grhh` | `git reset --hard` | +| `grhk` | `git reset --keep` | +| `grhs` | `git reset --soft` | +| `gpristine` | `git reset --hard && git clean -dffx` | +| `groh` | `git reset origin/$(git_current_branch) --hard` | +| `grs` | `git restore` | +| `grss` | `git restore --source` | +| `grst` | `git restore --staged` | +| `gunwip` | `git rev-list --max-count=1 --format="%s" HEAD \| grep -q "--wip--" && git reset HEAD~1` | +| `grev` | `git revert` | +| `grm` | `git rm` | +| `grmc` | `git rm --cached` | +| `gcount` | `git shortlog --summary -n` | +| `gsh` | `git show` | +| `gsps` | `git show --pretty=short --show-signature` | +| `gstall` | `git stash --all` | +| `gstu` | `git stash --include-untracked` | +| `gstaa` | `git stash apply` | +| `gstc` | `git stash clear` | +| `gstd` | `git stash drop` | +| `gstl` | `git stash list` | +| `gstp` | `git stash pop` | +| `gsta` | On Git >= 2.13: `git stash push` | +| `gsta` | On Git < 2.13: `git stash save` | +| `gsts` | `git stash show --patch` | +| `gst` | `git status` | +| `gss` | `git status --short` | +| `gsb` | `git status --short -b` | +| `gsi` | `git submodule init` | +| `gsu` | `git submodule update` | +| `gsd` | `git svn dcommit` | +| `git-svn-dcommit-push` | `git svn dcommit && git push github $(git_main_branch):svntrunk` | +| `gsr` | `git svn rebase` | +| `gsw` | `git switch` | +| `gswc` | `git switch -c` | +| `gswd` | `git switch $(git_develop_branch)` | +| `gswm` | `git switch $(git_main_branch)` | +| `gta` | `git tag --annotate` | +| `gts` | `git tag -s` | +| `gtv` | `git tag \| sort -V` | +| `gignore` | `git update-index --assume-unchanged` | +| `gunignore` | `git update-index --no-assume-unchanged` | +| `gwch` | `git whatchanged -p --abbrev-commit --pretty=medium` | +| `gwt` | `git worktree` | +| `gwtls` | `git worktree list` | +| `gwtmv` | `git worktree move` | +| `gwtrm` | `git worktree remove` | +| `gk` | `gitk --all --branches &!` | +| `gke` | `gitk --all $(git log --walk-reflogs --pretty=%h) &!` | +| `gtl` | `gtl(){ git tag --sort=-v:refname -n --list ${1}\* }; noglob gtl` | ### Main branch preference @@ -224,19 +222,25 @@ branch exists. We do this via the function `git_main_branch`. These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not, receive further support. -| Alias | Command | Modification | -| :------- | :----------------------------------------------------- | :-------------------------------------------------------- | -| `gap` | `git add --patch` | New alias: `gapa`. | -| `gcl` | `git config --list` | New alias: `gcf`. | -| `gdc` | `git diff --cached` | New alias: `gdca`. | -| `gdt` | `git difftool` | No replacement. | -| `ggpull` | `git pull origin $(current_branch)` | New alias: `ggl`. (`ggpull` still exists for now though.) | -| `ggpur` | `git pull --rebase origin $(current_branch)` | New alias: `ggu`. (`ggpur` still exists for now though.) | -| `ggpush` | `git push origin $(current_branch)` | New alias: `ggp`. (`ggpush` still exists for now though.) | -| `gk` | `gitk --all --branches` | Now aliased to `gitk --all --branches`. | -| `glg` | `git log --stat --max-count=10` | Now aliased to `git log --stat --color`. | -| `glgg` | `git log --graph --max-count=10` | Now aliased to `git log --graph --color`. | -| `gwc` | `git whatchanged -p --abbrev-commit --pretty = medium` | New alias: `gwch`. | +| Alias | Command | Modification | +| :------- | :-------------------------------------------------------- | :-------------------------------------------------------- | +| `gap` | `git add --patch` | New alias: `gapa`. | +| `gcl` | `git config --list` | New alias: `gcf`. | +| `gdc` | `git diff --cached` | New alias: `gdca`. | +| `gdt` | `git difftool` | No replacement. | +| `ggpull` | `git pull origin $(current_branch)` | New alias: `ggl`. (`ggpull` still exists for now though.) | +| `ggpur` | `git pull --rebase origin $(current_branch)` | New alias: `ggu`. (`ggpur` still exists for now though.) | +| `ggpush` | `git push origin $(current_branch)` | New alias: `ggp`. (`ggpush` still exists for now though.) | +| `gk` | `gitk --all --branches` | Now aliased to `gitk --all --branches`. | +| `glg` | `git log --stat --max-count=10` | Now aliased to `git log --stat --color`. | +| `glgg` | `git log --graph --max-count=10` | Now aliased to `git log --graph --color`. | +| `gwc` | `git whatchanged -p --abbrev-commit --pretty = medium` | New alias: `gwch`. | +| `gup` | `git pull --rebase` | now alias `gpr` | +| `gupv` | `git pull --rebase -v` | now alias `gprv` | +| `gupa` | `git pull --rebase --autostash` | now alias `gpra` | +| `gupav` | `git pull --rebase --autostash -v` | now alias `gprav` | +| `gupom` | `git pull --rebase origin $(git_main_branch)` | now alias `gprom` | +| `gupomi` | `git pull --rebase=interactive origin $(git_main_branch)` | now alias `gpromi` | ## Functions @@ -250,7 +254,7 @@ receive further support. | `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. | | `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. | | `grename ` | Renames branch `` to ``, including on the origin remote. | -| `gbda` | Deletes all merged branches | +| `gbda` | Deletes all merged branches | | `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) | ### Work in Progress (WIP) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 48937cb83..5ec2bbe2b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -246,12 +246,12 @@ alias gmom='git merge origin/$(git_main_branch)' alias gmum='git merge upstream/$(git_main_branch)' alias gmtl='git mergetool --no-prompt' alias gmtlvim='git mergetool --no-prompt --tool=vimdiff' + alias gl='git pull' alias gpr='git pull --rebase' -alias gup='git pull --rebase' -alias gupa='git pull --rebase --autostash' -alias gupav='git pull --rebase --autostash --verbose' -alias gupv='git pull --rebase --verbose' +alias gprv='git pull --rebase -v' +alias gpra='git pull --rebase --autostash' +alias gprav='git pull --rebase --autostash -v' function ggu() { [[ "$#" != 1 ]] && local b="$(git_current_branch)" @@ -259,8 +259,8 @@ function ggu() { } compdef _git ggu=git-checkout -alias gupom='git pull --rebase origin $(git_main_branch)' -alias gupomi='git pull --rebase=interactive origin $(git_main_branch)' +alias gprom='git pull --rebase origin $(git_main_branch)' +alias gpromi='git pull --rebase=interactive origin $(git_main_branch)' alias ggpull='git pull origin "$(git_current_branch)"' function ggl() { @@ -388,3 +388,20 @@ alias gk='\gitk --all --branches &!' alias gke='\gitk --all $(git log --walk-reflogs --pretty=%h) &!' unset git_version + +# Logic for adding warnings on deprecated aliases +local old_alias new_alias +for old_alias new_alias ( + # TODO(2023-10-19): remove deprecated `git pull --rebase` aliases + gup gpr + gupv gprv + gupa gpra + gupav gprav + gupom gprom + gupomi gpromi +); do + aliases[$old_alias]=" + print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_alias}%F{yellow}' is a deprecated alias, using '%F{green}${new_alias}%F{yellow}' instead.%f\" + $new_alias" +done +unset old_alias new_alias From f79647dba5df47cd87917bcf527c5825be6511dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 19 Oct 2023 22:05:03 +0200 Subject: [PATCH 16/29] fix(git): fix check in `gbds` function --- plugins/git/git.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5ec2bbe2b..eef538b75 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -141,7 +141,7 @@ function gbds() { git for-each-ref refs/heads/ "--format=%(refname:short)" | \ while read branch; do local merge_base=$(git merge-base $default_branch $branch) - if [[ '-*' == $(git cherry $default_branch $(git commit-tree $(git rev-parse $branch\^{tree}) -p $merge_base -m _)) ]]; then + if [[ $(git cherry $default_branch $(git commit-tree $(git rev-parse $branch\^{tree}) -p $merge_base -m _)) = -* ]]; then git branch -D $branch fi done From ff6dac56a256e376a10b19a4948ada7df4509c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 19 Oct 2023 23:04:08 +0200 Subject: [PATCH 17/29] fix(git): fix smart cd to cloned directory in `gccd` function --- plugins/git/git.plugin.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index eef538b75..6ea1d1177 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -166,8 +166,15 @@ alias gclean='git clean --interactive -d' alias gcl='git clone --recurse-submodules' function gccd() { - command git clone --recurse-submodules "$@" - [[ -d "$_" ]] && cd "$_" || cd "${${_:t}%.git}" + # get repo URI from args based on valid formats: https://git-scm.com/docs/git-clone#URLS + local repo="${${@[(r)(ssh://*|git://*|ftp(s)#://*|http(s)#://*|*@*)(.git/#)#]}:-$_}" + + # clone repository and exit if it fails + command git clone --recurse-submodules "$@" || return + + # if last arg passed was a directory, that's where the repo was cloned + # otherwise parse the repo URI and use the last part as the directory + [[ -d "$_" ]] && cd "$_" || cd "${${repo:t}%.git/#}" } compdef _git gccd=git-clone From 8428442ff0e0114fab32b90443911b11a4b7f5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 19 Oct 2023 23:24:55 +0200 Subject: [PATCH 18/29] fix(termsupport): add workaround for directory tracking issues in Konsole Fixes #11683 Related: 50c6786 --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index a800e651f..d170ffcbf 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -151,7 +151,7 @@ function omz_termsupport_cwd { URL_PATH="$(omz_urlencode -P $PWD)" || return 1 # Konsole errors if the HOST is provided - [[ -z "$KONSOLE_VERSION" ]] || URL_HOST="" + [[ -z "$KONSOLE_PROFILE_NAME" && -z "$KONSOLE_DBUS_SESSION" ]] || URL_HOST="" # common control sequence (OSC 7) to set current host and path printf "\e]7;file://%s%s\e\\" "${URL_HOST}" "${URL_PATH}" From 465253396df1865d3c73b1b3cff243798960ca3f Mon Sep 17 00:00:00 2001 From: Amir Hosseini <19665344+itsamirhn@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:00:25 +0330 Subject: [PATCH 19/29] fix(direnv): use `hook` instead of `export` (#12000) --- plugins/direnv/direnv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh index 5e32c4c23..6f8debb62 100644 --- a/plugins/direnv/direnv.plugin.zsh +++ b/plugins/direnv/direnv.plugin.zsh @@ -3,7 +3,7 @@ command -v direnv &>/dev/null || return _direnv_hook() { trap -- '' SIGINT; - eval "$(direnv export zsh)"; + eval "$(direnv hook zsh)"; trap - SIGINT; } typeset -ag precmd_functions; From 1868c15ec6b13c2da20375780f1e8b8f61458be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 23 Oct 2023 13:24:35 +0200 Subject: [PATCH 20/29] chore: remove mentions of huntr.dev huntr.dev has pivoted to ML/AI-only vulnerability reporting, and we are now already using GitHub's private vulnerability reports. --- README.md | 1 - SECURITY.md | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 308d117e1..499986879 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi [![Mastodon Follow](https://img.shields.io/mastodon/follow/111169632522566717?label=%40ohmyzsh&domain=https%3A%2F%2Fmstdn.social&logo=mastodon&style=flat)](https://mstdn.social/@ohmyzsh) [![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/ohmyzsh) [![Gitpod ready](https://img.shields.io/badge/Gitpod-ready-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh) -[![huntr.dev](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev/bounties/disclose/?utm_campaign=ohmyzsh%2Fohmyzsh&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh)
Table of Contents diff --git a/SECURITY.md b/SECURITY.md index 7e5c8eed0..ae7458ee2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -17,8 +17,7 @@ In the near future we will introduce versioning, so expect this section to chang **Do not submit an issue or pull request**: this might reveal the vulnerability. -Instead, you should email the maintainers directly at: [**security@ohmyz.sh**](mailto:security@ohmyz.sh). +Instead, you should email the maintainers directly at: [**security@ohmyz.sh**](mailto:security@ohmyz.sh), +or using the link to [privately report a vulnerability with GitHub](https://github.com/ohmyzsh/ohmyzsh/security/advisories/new). We will deal with the vulnerability privately and submit a patch as soon as possible. - -You can also submit your vulnerability report to [huntr.dev](https://huntr.dev/bounties/disclose/?utm_campaign=ohmyzsh%2Fohmyzsh&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh) and see if you can get a bounty reward. From b7904ae54867cd9e64dfd3c1f952d72b5cfe17be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=B6=E9=B3=96=E5=A4=A7=E5=B8=9D?= Date: Tue, 24 Oct 2023 19:33:04 +0800 Subject: [PATCH 21/29] fix(firewalld): remove ` (default)` from the end of zone string (#11998) --- plugins/firewalld/firewalld.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/firewalld/firewalld.plugin.zsh b/plugins/firewalld/firewalld.plugin.zsh index 5b1090636..b2c0f64be 100644 --- a/plugins/firewalld/firewalld.plugin.zsh +++ b/plugins/firewalld/firewalld.plugin.zsh @@ -9,7 +9,7 @@ function fwl () { zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}") for i in $zones; do - sudo firewall-cmd --zone $i --list-all + sudo firewall-cmd --zone ${i/ \(default\)} --list-all done echo 'Direct Rules:' From 5c22c5812ec8b980d223b8252edc7759dd354014 Mon Sep 17 00:00:00 2001 From: alps2006 Date: Tue, 24 Oct 2023 20:00:26 +0800 Subject: [PATCH 22/29] feat(vi-mode): allow replacing on visual mode (#12006) --- plugins/vi-mode/vi-mode.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index d1493e02f..8fefaf86c 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -154,7 +154,8 @@ wrap_clipboard_widgets copy \ vi-delete vi-delete-char vi-backward-delete-char wrap_clipboard_widgets paste \ - vi-put-{before,after} + vi-put-{before,after} \ + put-replace-selection unfunction wrap_clipboard_widgets From 048455ccefdc67c4f137b8f7886769c55c2e5417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 25 Oct 2023 19:47:10 +0200 Subject: [PATCH 23/29] fix(git-commit): fix revert alias conflict (#12007) Fixes #12007 --- plugins/git-commit/README.md | 14 ++++++++++---- plugins/git-commit/git-commit.plugin.zsh | 24 ++++++++++++++---------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/plugins/git-commit/README.md b/plugins/git-commit/README.md index dc10d8ad5..91cc73b44 100644 --- a/plugins/git-commit/README.md +++ b/plugins/git-commit/README.md @@ -10,7 +10,7 @@ plugins=(... git-commit) ## Syntax -```zshrc +```zsh git [(-s, --scope) ""] "" ``` @@ -26,11 +26,17 @@ Where `type` is one of the following: - `fix` - `perf` - `refactor` -- `revert` +- `rev` - `style` - `test` +> NOTE: the alias for `revert` type is `rev`, as otherwise it conflicts with the git command of the same name. +> It will still generate a commit message in the format `revert: ` + ## Examples -`git style "remove trailing whitespace"` -> `git commit -m "style: remove trailing whitespace"` -`git fix -s "router" "correct redirect link"` -> `git commit -m "fix(router): correct redirect link"` +| Git alias | Command | +| --------------------------------------------- | ---------------------------------------------------- | +| `git style "remove trailing whitespace"` | `git commit -m "style: remove trailing whitespace"` | +| `git fix -s "router" "correct redirect link"` | `git commit -m "fix(router): correct redirect link"` | +| `git rev -s "api" "rollback v2"` | `git commit -m "revert(api): rollback v2"` | diff --git a/plugins/git-commit/git-commit.plugin.zsh b/plugins/git-commit/git-commit.plugin.zsh index 4ad4c0177..72cecb1d6 100644 --- a/plugins/git-commit/git-commit.plugin.zsh +++ b/plugins/git-commit/git-commit.plugin.zsh @@ -1,9 +1,3 @@ -function _git_commit_register { - if ! git config --global --get-all alias.$1 >/dev/null 2>&1; then - git config --global alias.$1 '!a() { if [ "$1" = "-s" ] || [ "$1" = "--scope" ]; then local scope="$2"; shift 2; git commit -m "'$1'(${scope}): ${@}"; else git commit -m "'$1': ${@}"; fi }; a' - fi -} - local -a _git_commit_aliases _git_commit_aliases=( 'build' @@ -19,9 +13,19 @@ _git_commit_aliases=( 'test' ) -for _alias in "${_git_commit_aliases[@]}"; do - _git_commit_register $_alias +local alias type +for type in "${_git_commit_aliases[@]}"; do + # an alias can't be named "revert" because the git command takes precedence + # https://stackoverflow.com/a/3538791 + case "$type" in + revert) alias=rev ;; + *) alias=$type ;; + esac + + local func='!a() { if [ "$1" = "-s" ] || [ "$1" = "--scope" ]; then local scope="$2"; shift 2; git commit -m "'$type'(${scope}): ${@}"; else git commit -m "'$type': ${@}"; fi }; a' + if ! git config --global --get-all alias.${alias} >/dev/null 2>&1; then + git config --global alias.${alias} "$func" + fi done -unfunction _git_commit_register -unset _alias +unset _git_commit_aliases alias type func From 7348d12f8e5cd755037aa6f5d347eab0ac2efb0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 28 Oct 2023 10:24:24 +0200 Subject: [PATCH 24/29] ci(vercel): add Content-Disposition header on installer This allows doing something like curl -O https://install.ohmyz.sh and have the `install.sh` file automatically saved to its right name. --- .github/workflows/installer/vercel.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/installer/vercel.json b/.github/workflows/installer/vercel.json index 8c5aec5e0..524dc3c0f 100644 --- a/.github/workflows/installer/vercel.json +++ b/.github/workflows/installer/vercel.json @@ -2,7 +2,16 @@ "headers": [ { "source": "/((?!favicon.ico).*)", - "headers": [{ "key": "Content-Type", "value": "text/plain" }] + "headers": [ + { + "key": "Content-Type", + "value": "text/plain" + }, + { + "key": "Content-Disposition", + "value": "inline; filename=\"install.sh\"" + } + ] } ], "rewrites": [ From 7733e3ab57ee3f666cf6f3e699d03b69aca2d373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 28 Oct 2023 10:29:54 +0200 Subject: [PATCH 25/29] ci: fix path filtering in installer workflow See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths --- .github/workflows/installer.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 4a25c8079..a70c483d1 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -3,9 +3,9 @@ on: workflow_dispatch: {} push: paths: - - tools/install.sh - - .github/workflows/installer - - .github/workflows/installer.yml + - 'tools/install.sh' + - '.github/workflows/installer/**' + - '.github/workflows/installer.yml' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From cb86d378f287f1731cc6ad907f6248e35b52dc25 Mon Sep 17 00:00:00 2001 From: Josh Hubbard Date: Sat, 28 Oct 2023 04:37:50 -0400 Subject: [PATCH 26/29] feat(git-auto-fetch): fetch also submodules (#12001) --- plugins/git-auto-fetch/git-auto-fetch.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh index 2df34bb7b..f8dfec759 100644 --- a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh +++ b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh @@ -29,7 +29,7 @@ function git-fetch-all { date -R &>! "$gitdir/FETCH_LOG" GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \ GIT_TERMINAL_PROMPT=0 \ - command git fetch --all 2>/dev/null &>> "$gitdir/FETCH_LOG" + command git fetch --all --recurse-submodules=yes 2>/dev/null &>> "$gitdir/FETCH_LOG" ) &| } From 38c01a235fef0d990be5ece0d62f94fd06b10571 Mon Sep 17 00:00:00 2001 From: Sarah Noor <88581241+sarah-noor-12232@users.noreply.github.com> Date: Sat, 28 Oct 2023 20:48:45 +0500 Subject: [PATCH 27/29] feat(npm): add alias for `npm run build` (#12012) Closes #12010 --- plugins/npm/README.md | 1 + plugins/npm/npm.plugin.zsh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/plugins/npm/README.md b/plugins/npm/README.md index 420dd710a..7848a1290 100644 --- a/plugins/npm/README.md +++ b/plugins/npm/README.md @@ -30,6 +30,7 @@ plugins=(... npm) | `npmi` | `npm info` | Run npm info | | `npmSe` | `npm search` | Run npm search | | `npmrd` | `npm run dev` | Run npm run dev | +| `npmrb` | `npm run build` | Run npm run build | ## `npm install` / `npm uninstall` toggle diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 3cba18f6c..23377b085 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -73,6 +73,9 @@ alias npmSe="npm search" # Run npm run dev alias npmrd="npm run dev" +# Run npm run build +alias npmrb="npm run build" + npm_toggle_install_uninstall() { # Look up to the previous 2 history commands local line From 632ed413a9ce62747ded83d7736491b081be4b49 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 1 Nov 2023 21:24:28 +0100 Subject: [PATCH 28/29] fix(wd): use `(( ))` instead of `[[ ]]` zsh versions prior to 5.0.6 mark `[[ ]]` as invalid syntax Closes #12017 --- plugins/wd/wd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index e51cf906a..840e92d61 100644 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -396,7 +396,7 @@ fi # disable extendedglob for the complete wd execution time setopt | grep -q extendedglob wd_extglob_is_set=$? -[[ $wd_extglob_is_set ]] && setopt noextendedglob +(( ! $wd_extglob_is_set )) && setopt noextendedglob # load warp points typeset -A points @@ -484,7 +484,7 @@ fi # if not, next time warp will pick up variables from this run # remember, there's no sub shell -[[ $wd_extglob_is_set ]] && setopt extendedglob +(( ! $wd_extglob_is_set )) && setopt extendedglob unset wd_extglob_is_set unset wd_warp From b6bb133f230847ed0b3f9f4e25f2ceb874ca6c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 8 Nov 2023 08:42:34 +0100 Subject: [PATCH 29/29] fix(git): fix repository detection in `gccd` function (#12023) Fixes #12023 --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 6ea1d1177..2a824444b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -166,6 +166,8 @@ alias gclean='git clean --interactive -d' alias gcl='git clone --recurse-submodules' function gccd() { + setopt localoptions extendedglob + # get repo URI from args based on valid formats: https://git-scm.com/docs/git-clone#URLS local repo="${${@[(r)(ssh://*|git://*|ftp(s)#://*|http(s)#://*|*@*)(.git/#)#]}:-$_}"