From 9d59f8bab76605b683bf84f6ae0d496b4cbf20d0 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Thu, 25 Feb 2010 01:45:14 +0100 Subject: Restricting 'cci' to given files just makes things too complicated. Thus remove the feature --- .zsh/zshfunctions | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to '.zsh/zshfunctions') diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index 8e3620a..9f0270e 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -33,23 +33,20 @@ open_ebuild () } # Commit a new config change +# Works only for simple cases cci () { - local message files - local tok=__cci__ - if [[ $# == 0 ]]; then echo "No message given. Aborting." return 1 fi - message=$1 - shift - files=$@ + local message=$1 + local tok=__cci__ pushd -q ~ - cstg diff $files + cstg diff echo -n "Is this ok? [y/n] " if ! read -q; then @@ -57,14 +54,15 @@ cci () echo "I would have done the wrong thing ... aborting!" return 2 fi - + echo ">> Creating new patch" cstg new $tok -m "$message" echo ">> Refreshing" - cstg refresh $files + cstg refresh if [[ -z $(cstg files) ]]; then + echo echo "Ehm - this patch is empty. Narf. Aborting!" echo "Deleting useless patch" cstg del $tok @@ -75,6 +73,7 @@ cci () cstg commit $tok if [[ -n $(cstg series --applied) ]]; then + echo echo "Urgs! Something went wrong. There are still patches applied." echo "Clean up for yourself. Aborting here!" return 4 @@ -85,8 +84,10 @@ cci () echo ">> Re-apply patches" cstg push -a - + echo ">> Done" + + popd -q } if [[ $UID == 0 ]]; then -- cgit v1.2.3-54-g00ecf