From f97a3188b5b42ebc6c71fdcdf6ee761acb686551 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Thu, 25 Feb 2010 01:07:38 +0100 Subject: Small config commit function --- .zsh/zshfunctions | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to '.zsh/zshfunctions') diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index b9c074e..add0202 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -32,6 +32,41 @@ open_ebuild () fi } +# Commit a new config change +cci () +{ + local message files + local tok=__cci__ + + if [[ $# == 0 ]]; then + echo "No message given. Aborting." + return 1 + fi + + message=$1 + shift + files=$@ + + pushd -q ~ + + cstg diff $files + echo -n "Is this ok? [y/n] " + + if ! read -q; then + echo + echo "I would have done the wrong thing ... aborting!" + return 2 + fi + + echo + cstg new $tok -m "$message" + cstg refresh $files + cstg commit $tok + config push + cstg push -a + echo "Done" +} + if [[ $UID == 0 ]]; then # unpack a package -- cgit v1.2.3-70-g09d2