From b669606c4de7993ae26c668eeadc3c407fc49999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 14 Sep 2024 17:46:22 +0200 Subject: [PATCH] Rework push to use a function that accepts an argument --- home/zsh/default.nix | 1 - home/zsh/files/functions.zsh | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/home/zsh/default.nix b/home/zsh/default.nix index bdcd608..ef70fc5 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -120,7 +120,6 @@ "rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"; ag = "rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"; - push = ''git add -A && git commit -m "`date`" && git push''; reset = "tput reset"; }; history.size = 10000000; diff --git a/home/zsh/files/functions.zsh b/home/zsh/files/functions.zsh index f055cc2..16565ec 100644 --- a/home/zsh/files/functions.zsh +++ b/home/zsh/files/functions.zsh @@ -83,3 +83,13 @@ function register_key() { bindkey -M vicmd "^$1" $2 bindkey -M viins "^$1" $2 } + +function push() { + git add -A + if [ -z "$1" ]; then + git commit -m "`date`" + else + git commit -m "$1" + fi + git push +}