diff options
author | Tvrtko Majstorović <tvrtkomaj@gmail.com> | 2020-05-23 18:57:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-23 18:57:13 +0200 |
commit | 255ef8d5877f056e80751f45d264326de1688e95 (patch) | |
tree | e059e41dad0c4e76c1e995fdf4078d68c97ff23f /plugins | |
parent | 10538d11058dfc02c9399062aaa2e1fa584135b2 (diff) | |
download | zsh-255ef8d5877f056e80751f45d264326de1688e95.tar.gz zsh-255ef8d5877f056e80751f45d264326de1688e95.tar.bz2 zsh-255ef8d5877f056e80751f45d264326de1688e95.zip |
git: add alias for git diff excluding lock files (#8935)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/git/README.md | 1 | ||||
-rw-r--r-- | plugins/git/git.plugin.zsh | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/plugins/git/README.md b/plugins/git/README.md index dde60fe13..8642dd055 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -62,6 +62,7 @@ plugins=(... git) | gdct | git describe --tags $(git rev-list --tags --max-count=1) | | gds | git diff --staged | | gdt | git diff-tree --no-commit-id --name-only -r | +| gdnolock | git diff $@ ":(exclude)package-lock.json" ":(exclude)*.lock" | | gdv | git diff -w $@ \| view - | | gdw | git diff --word-diff | | gf | git fetch | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 855a746b4..1112421bf 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -86,6 +86,11 @@ alias gds='git diff --staged' alias gdt='git diff-tree --no-commit-id --name-only -r' alias gdw='git diff --word-diff' +function gdnolock() { + git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock" +} +compdef _git gdnolock=git-diff + function gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff |