summaryrefslogtreecommitdiff
path: root/.zsh/zshfunctions
diff options
context:
space:
mode:
Diffstat (limited to '.zsh/zshfunctions')
-rw-r--r--.zsh/zshfunctions21
1 files changed, 11 insertions, 10 deletions
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