Unverified Commit d81b4ac9 authored by Fabian Bonk's avatar Fabian Bonk Committed by GitHub
Browse files

git: run gfa with --jobs=10 (fetch remotes in parallel) (#9268)


Co-authored-by: default avatarMarc Cornellà <marc.cornella@live.com>
parent 89278c71
# Git version checking
autoload -Uz is-at-least
git_version="${(As: :)$(git version 2>/dev/null)[3]}"
# #
# Functions # Functions
# #
...@@ -104,7 +108,10 @@ function gdv() { git diff -w "$@" | view - } ...@@ -104,7 +108,10 @@ function gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff compdef _git gdv=git-diff
alias gf='git fetch' alias gf='git fetch'
alias gfa='git fetch --all --prune' # --jobs=<n> was added in git 2.8
is-at-least 2.8 "$git_version" \
&& alias gfa='git fetch --all --prune --jobs=10' \
|| alias gfa='git fetch --all --prune'
alias gfo='git fetch origin' alias gfo='git fetch origin'
alias gfg='git ls-files | grep' alias gfg='git ls-files | grep'
...@@ -240,8 +247,7 @@ alias gss='git status -s' ...@@ -240,8 +247,7 @@ alias gss='git status -s'
alias gst='git status' alias gst='git status'
# use the default stash push on git 2.13 and newer # use the default stash push on git 2.13 and newer
autoload -Uz is-at-least is-at-least 2.13 "$git_version" \
is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')" \
&& alias gsta='git stash push' \ && alias gsta='git stash push' \
|| alias gsta='git stash save' || alias gsta='git stash save'
...@@ -291,3 +297,5 @@ function grename() { ...@@ -291,3 +297,5 @@ function grename() {
git push --set-upstream origin "$2" git push --set-upstream origin "$2"
fi fi
} }
unset git_version
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment