From c22fcf5fce863f3b9ad9cdfc81117424a32da18d Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sat, 14 May 2022 16:04:35 +0200 Subject: [PATCH] git,zsh:autoload: Move `spull` into own function Move `git-track` into its own autoloadable function. This way it is better maintainable as in one-liner format and brings the possibility of having more complexity (e.g. for better portability). By that it is also now executable as `git-spull` as well as `git spull` as before. --- .config/git/config | 2 +- .config/zsh/autoload/git/git-spull | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 .config/zsh/autoload/git/git-spull diff --git a/.config/git/config b/.config/git/config index 11888b6..2848d48 100644 --- a/.config/git/config +++ b/.config/git/config @@ -15,7 +15,7 @@ flog = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/glog\"" root = rev-parse --show-toplevel signoff = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/git-signoff\"" - spull = "!__git_spull() { git pull \"$@\" && git submodule sync --recursive && git submodule update --init --recursive; }; __git_spull" + spull = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/git-spull\"" track = "!\"${XDG_CONFIG_HOME:-$HOME/.config}/zsh/autoload/git/git-track\"" [blame] date = short diff --git a/.config/zsh/autoload/git/git-spull b/.config/zsh/autoload/git/git-spull new file mode 100755 index 0000000..e26f38d --- /dev/null +++ b/.config/zsh/autoload/git/git-spull @@ -0,0 +1,7 @@ +#!/usr/bin/env zsh + +emulate -L zsh -o err_return + +git pull "$@" +git submodule sync --recursive +git submodule update --init --recursive