summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Neumann <rene.neumann@in.tum.de>2012-02-23 19:26:16 +0100
committerRené Neumann <rene.neumann@in.tum.de>2012-02-23 19:26:16 +0100
commit823f19289a5139abe9e99bffd882594d2d5835a7 (patch)
tree05718654e27c15aa6fd0a199530e432146dccc5e
parenta55b3ac88629bd7d3de5f5edd45f85c9db32b673 (diff)
downloaddotfiles-823f19289a5139abe9e99bffd882594d2d5835a7.tar.gz
dotfiles-823f19289a5139abe9e99bffd882594d2d5835a7.tar.bz2
dotfiles-823f19289a5139abe9e99bffd882594d2d5835a7.zip
Unify cci output
-rw-r--r--.zsh/functions/cci25
1 files changed, 15 insertions, 10 deletions
diff --git a/.zsh/functions/cci b/.zsh/functions/cci
index 22441d7..0cd6feb 100644
--- a/.zsh/functions/cci
+++ b/.zsh/functions/cci
@@ -2,7 +2,7 @@
# Works only for simple cases
_ask_$0 ()
{
- echo -n "Is this ok? [y/n] "
+ echo -n ${fg_bold[white]}"Is this ok? [y/n] "${reset_color}
if ! read -q; then
echo
@@ -13,6 +13,11 @@ _ask_$0 ()
fi
}
+_echo_$0 ()
+{
+ echo ${fg_bold[white]}">> $1"${reset_color}
+}
+
if [[ $# == 0 ]]; then
echo "No message given. Aborting."
return 1
@@ -30,11 +35,11 @@ pushd -q ~
local indexed="$(config status --porcelain | grep -v '^ ')"
if [[ -n $indexed ]]; then
- echo ">> Stuff in index -- only commiting this"
+ _echo_$0 "Stuff in index -- only commiting this"
echo "$indexed"
_ask_$0 || return 2
else
- echo ">> Nothing in index -- commiting everything which has changed"
+ _echo_$0 "Nothing in index -- commiting everything which has changed"
echo "$(config status)"
_ask_$0 || return 2
@@ -44,10 +49,10 @@ fi
cstg diff -O --cached
_ask_$0 || return 2
-echo ">> Creating new patch"
+_echo_$0 "Creating new patch"
cstg new $tok -m "$message"
-echo ">> Refreshing"
+_echo_$0 "Refreshing"
cstg refresh -i
if [[ -z $(cstg files) ]]; then
@@ -58,13 +63,13 @@ if [[ -z $(cstg files) ]]; then
return 3
fi
-echo ">> Committing"
+_echo_$0 "Committing"
cstg commit $tok || return
# from 0.16 onwards stg repushes the patches ... pop them again
# this is needed to make the `config push` work
if is-at-least 0.16 $stg_v; then
- echo ">>> Popping patches, stg thought it had to re-apply"
+ _echo_$0 "Popping patches, stg thought it had to re-apply"
cstg pop -a -k || return
fi
@@ -75,13 +80,13 @@ if [[ -n $(cstg series --applied) ]]; then
return 4
fi
-echo ">> Pushing to remote"
+_echo_$0 "Pushing to remote"
config push || return
-echo ">> Re-apply patches"
+_echo_$0 "Re-apply patches"
cstg push -a -k || return
-echo ">> Done"
+_echo_$0 "Done"
popd -q