diff options
Diffstat (limited to '')
-rw-r--r-- | .zsh/functions/cci | 25 |
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 |