From 7e45e6a89e02fea6b7e28b075e230407ee1df709 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Thu, 25 Feb 2010 01:17:58 +0100 Subject: Enhance error-checking for 'cci' --- .zsh/zshfunctions | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index add0202..8e3620a 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -58,13 +58,35 @@ cci () return 2 fi - echo + echo ">> Creating new patch" cstg new $tok -m "$message" + + echo ">> Refreshing" cstg refresh $files + + if [[ -z $(cstg files) ]]; then + echo "Ehm - this patch is empty. Narf. Aborting!" + echo "Deleting useless patch" + cstg del $tok + return 3 + fi + + echo ">> Committing" cstg commit $tok + + if [[ -n $(cstg series --applied) ]]; then + echo "Urgs! Something went wrong. There are still patches applied." + echo "Clean up for yourself. Aborting here!" + return 4 + fi + + echo ">> Pushing to remote" config push + + echo ">> Re-apply patches" cstg push -a - echo "Done" + + echo ">> Done" } if [[ $UID == 0 ]]; then -- cgit v1.2.3-70-g09d2