Commit 5bca8d93 authored by Jerome Baum's avatar Jerome Baum

Create a git_do command to log git actions

parent 53e9c768
......@@ -80,6 +80,11 @@ main() {
# use the shFlags project to parse the command line arguments
. "$GITFLOW_DIR/gitflow-shFlags"
FLAGS_PARENT="git flow"
# allow user to request git action logging
DEFINE_boolean show_commands false 'show actions taken (git commands)' g
# do actual parsing
FLAGS "$@" || exit $?
eval set -- "${FLAGS_ARGV}"
......
......@@ -70,6 +70,14 @@ noflag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; }
# Git specific common functionality
#
git_do() {
# equivalent to git, used to indicate actions that make modifications
if flag show_commands; then
echo "git $@" >&2
fi
git "$@"
}
git_local_branches() { git branch --no-color | sed 's/^[* ] //'; }
git_remote_branches() { git branch -r --no-color | sed 's/^[* ] //'; }
git_all_branches() { ( git branch --no-color; git branch -r --no-color) | sed 's/^[* ] //'; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment