File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ main() {
8080 # use the shFlags project to parse the command line arguments
8181 . " $GITFLOW_DIR /gitflow-shFlags"
8282 FLAGS_PARENT=" git flow"
83+
84+ # allow user to request git action logging
85+ DEFINE_boolean show_commands false ' show actions taken (git commands)' g
86+
87+ # do actual parsing
8388 FLAGS " $@ " || exit $?
8489 eval set -- " ${FLAGS_ARGV} "
8590
Original file line number Diff line number Diff line change @@ -70,6 +70,14 @@ noflag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; }
7070# Git specific common functionality
7171#
7272
73+ git_do() {
74+ # equivalent to git, used to indicate actions that make modifications
75+ if flag show_commands; then
76+ echo "git $@" >&2
77+ fi
78+ git "$@"
79+ }
80+
7381git_local_branches() { git branch --no-color | sed 's/^[* ] //'; }
7482git_remote_branches() { git branch -r --no-color | sed 's/^[* ] //'; }
7583git_all_branches() { ( git branch --no-color; git branch -r --no-color) | sed 's/^[* ] //'; }
You can’t perform that action at this time.
0 commit comments