From c386733efd154b56628466b772a9ac55331b715f Mon Sep 17 00:00:00 2001 From: spacewander Date: Tue, 25 Aug 2020 14:45:12 +0800 Subject: [PATCH 1/3] git-info: add zsh completion --- etc/git-extras-completion.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etc/git-extras-completion.zsh b/etc/git-extras-completion.zsh index 702cc39..3ae4bae 100644 --- a/etc/git-extras-completion.zsh +++ b/etc/git-extras-completion.zsh @@ -267,6 +267,13 @@ _git-ignore() { } +_git-info() { + _arguments -C \ + '(--color -c)'{--color,-c}'[use color for information titles]' \ + '--no-config[do not show list all variables set in config file, along with their values]' +} + + _git-merge-into() { _arguments '--ff-only[merge only fast-forward]' _arguments \ From c56b61d2bd66654d64a594444a59fc0050c2386c Mon Sep 17 00:00:00 2001 From: spacewander Date: Tue, 25 Aug 2020 14:50:56 +0800 Subject: [PATCH 2/3] remove incorrect completion --- etc/git-extras-completion.zsh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/etc/git-extras-completion.zsh b/etc/git-extras-completion.zsh index 3ae4bae..3288874 100644 --- a/etc/git-extras-completion.zsh +++ b/etc/git-extras-completion.zsh @@ -257,16 +257,6 @@ _git-ignore() { } -_git-ignore() { - _arguments -C \ - '(--append -a)'{--append,-a}'[append .gitignore]' \ - '(--replace -r)'{--replace,-r}'[replace .gitignore]' \ - '(--list-in-table -l)'{--list-in-table,-l}'[print available types in table format]' \ - '(--list-alphabetically -L)'{--list-alphabetically,-L}'[print available types in alphabetical order]' \ - '(--search -s)'{--search,-s}'[search word in available types]' -} - - _git-info() { _arguments -C \ '(--color -c)'{--color,-c}'[use color for information titles]' \ From 6afc2fb4a8cdb77bde794243ab5495df9ebfde6d Mon Sep 17 00:00:00 2001 From: spacewander Date: Tue, 25 Aug 2020 14:53:11 +0800 Subject: [PATCH 3/3] sort completion in alphabetical order --- etc/git-extras-completion.zsh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/etc/git-extras-completion.zsh b/etc/git-extras-completion.zsh index 3288874..a2f958a 100644 --- a/etc/git-extras-completion.zsh +++ b/etc/git-extras-completion.zsh @@ -102,6 +102,7 @@ __gitex_author_names() { } # subcommands +# new subcommand should be added in alphabetical order _git-authors() { _arguments -C \ '(--list -l)'{--list,-l}'[show authors]' \ @@ -277,6 +278,18 @@ _git-missing() { ':second-branch-name:__gitex_branch_names' } +_git-release() { + _arguments -C \ + '-c[Generates/populates the changelog with all commit message since the last tag.]' \ + '-r[The "remote" repository that is destination of a push operation.]' \ + '-m[use the custom commit information instead of the default message.]' \ + '-s[Create a signed and annotated tag.]' \ + '-u[Create a tag, annotated and signed with the given key.]' \ + '--semver[If the latest tag in your repo matches the semver format requirement, you could increase part of it as the new release tag.]' \ + '--no-empty-commit[Avoid creating empty commit if nothing could be committed.]' \ + '--[The arguments listed after "--" separator will be passed to pre/post-release hook.]' +} + _git-squash() { _arguments '--squash-msg[commit with the squashed commit messages]' _arguments \ @@ -307,18 +320,6 @@ _git-summary() { __gitex_commits } -_git-release() { - _arguments -C \ - '-c[Generates/populates the changelog with all commit message since the last tag.]' \ - '-r[The "remote" repository that is destination of a push operation.]' \ - '-m[use the custom commit information instead of the default message.]' \ - '-s[Create a signed and annotated tag.]' \ - '-u[Create a tag, annotated and signed with the given key.]' \ - '--semver[If the latest tag in your repo matches the semver format requirement, you could increase part of it as the new release tag.]' \ - '--no-empty-commit[Avoid creating empty commit if nothing could be committed.]' \ - '--[The arguments listed after "--" separator will be passed to pre/post-release hook.]' -} - _git-undo(){ _arguments -C \ '(--soft -s)'{--soft,-s}'[only rolls back the commit but changes remain un-staged]' \