Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create a git_do command to log git actions

commit 5bca8d9358f5b08af40ac32f289bb14b18965cec 1 parent 53e9c76
Jerome Baum jeromebaum authored
Showing with 13 additions and 0 deletions.
  1. +5 −0 git-flow
  2. +8 −0 gitflow-common
5 git-flow
View
@@ -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

How is this flag used? Should the README be updated? @jeromebaum

See my comment in #389 (about to post there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+ # do actual parsing
FLAGS "$@" || exit $?
eval set -- "${FLAGS_ARGV}"
8 gitflow-common
View
@@ -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/^[* ] //'; }
Justin Gordon

How is this flag used? Should the README be updated? @jeromebaum

Jerome Baum

See my comment in #389 (about to post there).

Please sign in to comment.
Something went wrong with that request. Please try again.