Merge branch 'feature/compliance' into develop
diff --git a/git-flow b/git-flow
index 573aa25..7f8c90c 100755
--- a/git-flow
+++ b/git-flow
@@ -77,7 +77,7 @@
if [ "$1" != "" ] && ! echo "$1" | grep -q "^-"; then
SUBACTION="$1"; shift
fi
- if ! typeset -f "cmd_$SUBACTION" 2>&1 >/dev/null; then
+ if ! type "cmd_$SUBACTION" >/dev/null 2>&1; then
warn "Unknown subcommand: '$SUBACTION'"
usage
exit 1
diff --git a/git-flow-feature b/git-flow-feature
index db45d81..d65da94 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -32,9 +32,9 @@
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
- typeset feature_branches
- typeset current_branch
- typeset short_names
+ local feature_branches
+ local current_branch
+ local short_names
feature_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$feature_branches" ]; then
warn "No feature branches exist."
@@ -44,20 +44,20 @@
short_names=$(echo "$feature_branches" | sed "s ^$PREFIX g")
# determine column width first
- typeset -i width=0
- typeset branch
+ local width=0
+ local branch
for branch in $short_names; do
- typeset -i len=${#branch}
+ local len=${#branch}
width=$(max $width $len)
done
- width=width+3
+ width=$(($width+3))
- typeset branch
+ local branch
for branch in $short_names; do
- typeset fullname=$PREFIX$branch
- typeset base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
- typeset develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
- typeset branch_sha=$(git rev-parse "$fullname")
+ local fullname=$PREFIX$branch
+ local base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
+ local develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
+ local branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
printf "* "
else
@@ -97,8 +97,8 @@
expand_nameprefix_arg() {
require_name_arg
- typeset expanded_name
- typeset -i exitcode
+ local expanded_name
+ local exitcode
expanded_name=$(resolve_nameprefix "$NAME" "$PREFIX")
exitcode=$?
case $exitcode in
@@ -114,7 +114,7 @@
expand_nameprefix_arg
gitflow_require_branch "$PREFIX$NAME"
else
- typeset current_branch=$(gitflow_current_branch)
+ local current_branch=$(gitflow_current_branch)
if startswith "$current_branch" "$PREFIX"; then
BRANCH=$current_branch
NAME=${BRANCH#$PREFIX}
@@ -368,7 +368,7 @@
gitflow_require_branch "$BRANCH"
git checkout -q "$BRANCH"
- typeset OPTS=
+ local OPTS=
if flag interactive; then
OPTS="$OPTS -i"
fi
diff --git a/git-flow-hotfix b/git-flow-hotfix
index b0df9ac..3926e40 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -29,9 +29,9 @@
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
- typeset hotfix_branches
- typeset current_branch
- typeset short_names
+ local hotfix_branches
+ local current_branch
+ local short_names
hotfix_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$hotfix_branches" ]; then
warn "No hotfix branches exist."
@@ -41,20 +41,20 @@
short_names=$(echo "$hotfix_branches" | sed "s ^$PREFIX g")
# determine column width first
- typeset -i width=0
- typeset branch
+ local width=0
+ local branch
for branch in $short_names; do
- typeset -i len=${#branch}
+ local len=${#branch}
width=$(max $width $len)
done
- width=width+3
+ width=$(($width+3))
- typeset branch
+ local branch
for branch in $short_names; do
- typeset fullname=$PREFIX$branch
- typeset base=$(git merge-base "$fullname" "$MASTER_BRANCH")
- typeset master_sha=$(git rev-parse "$MASTER_BRANCH")
- typeset branch_sha=$(git rev-parse "$fullname")
+ local fullname=$PREFIX$branch
+ local base=$(git merge-base "$fullname" "$MASTER_BRANCH")
+ local master_sha=$(git rev-parse "$MASTER_BRANCH")
+ local branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
printf "* "
else
@@ -65,8 +65,8 @@
if [ "$branch_sha" = "$master_sha" ]; then
printf "(no commits yet)"
else
- typeset tagname=$(git name-rev --tags --no-undefined --name-only "$base")
- typeset nicename
+ local tagname=$(git name-rev --tags --no-undefined --name-only "$base")
+ local nicename
if [ "$tagname" != "" ]; then
nicename=$tagname
else
@@ -193,9 +193,9 @@
# try to tag the release
# in case a previous attempt to finish this release branch has failed,
# but the tag was set successful, we skip it now
- typeset tagname=$VERSION_PREFIX$VERSION
+ local tagname=$VERSION_PREFIX$VERSION
if ! gitflow_tag_exists "$tagname"; then
- typeset opts="-a"
+ local opts="-a"
flag sign && opts="$opts -s"
[ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'"
[ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'"
diff --git a/git-flow-init b/git-flow-init
index a8e0825..4c43b31 100644
--- a/git-flow-init
+++ b/git-flow-init
@@ -21,12 +21,12 @@
echo
echo "Summary of actions:"
- if ! git rev-parse --git-dir 2>&1 >/dev/null; then
+ if ! git rev-parse --git-dir >/dev/null 2>&1; then
git init --quiet
echo "- A new git repository at $PWD was created"
fi
- if ! git rev-parse --quiet --verify HEAD 2>&1 >/dev/null; then
+ if ! git rev-parse --quiet --verify HEAD >/dev/null 2>&1; then
touch "$README"
git add "$README"
git commit --quiet -m "initial commit"
@@ -36,7 +36,7 @@
echo "- An initial commit was created at branch '$MASTER_BRANCH'"
fi
- if ! git rev-parse --verify "$MASTER_BRANCH" 2>&1 >/dev/null; then
+ if ! git rev-parse --verify "$MASTER_BRANCH" >/dev/null 2>&1; then
die "Cannot find your master branch. Try: git branch -m <mymaster> $MASTER_BRANCH"
fi
@@ -47,7 +47,7 @@
gitflow_require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
fi
- if git rev-parse --verify "$DEVELOP_BRANCH" 2>&1 >/dev/null; then
+ if git rev-parse --verify "$DEVELOP_BRANCH" >/dev/null 2>&1; then
gitflow_require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
else
git checkout -q -b "$DEVELOP_BRANCH" "$MASTER_BRANCH"
diff --git a/git-flow-release b/git-flow-release
index 3b44325..b56c54d 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -40,9 +40,9 @@
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
- typeset release_branches
- typeset current_branch
- typeset short_names
+ local release_branches
+ local current_branch
+ local short_names
release_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$release_branches" ]; then
warn "No release branches exist."
@@ -53,20 +53,20 @@
short_names=$(echo "$release_branches" | sed "s ^$PREFIX g")
# determine column width first
- typeset -i width=0
- typeset branch
+ local width=0
+ local branch
for branch in $short_names; do
- typeset -i len=${#branch}
+ local len=${#branch}
width=$(max $width $len)
done
- width=width+3
+ width=$(($width+3))
- typeset branch
+ local branch
for branch in $short_names; do
- typeset fullname=$PREFIX$branch
- typeset base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
- typeset develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
- typeset branch_sha=$(git rev-parse "$fullname")
+ local fullname=$PREFIX$branch
+ local base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
+ local develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
+ local branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
printf "* "
else
@@ -77,7 +77,7 @@
if [ "$branch_sha" = "$develop_sha" ]; then
printf "(no commits yet)"
else
- typeset nicename=$(git rev-parse --short "$base")
+ local nicename=$(git rev-parse --short "$base")
printf "(based on $nicename)"
fi
else
@@ -199,9 +199,9 @@
# try to tag the release
# in case a previous attempt to finish this release branch has failed,
# but the tag was set successful, we skip it now
- typeset tagname=$VERSION_PREFIX$VERSION
+ local tagname=$VERSION_PREFIX$VERSION
if ! gitflow_tag_exists "$tagname"; then
- typeset opts="-a"
+ local opts="-a"
flag sign && opts="$opts -s"
[ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'"
[ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'"
diff --git a/git-flow-support b/git-flow-support
index 06bea16..804a01d 100644
--- a/git-flow-support
+++ b/git-flow-support
@@ -31,9 +31,9 @@
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
- typeset support_branches
- typeset current_branch
- typeset short_names
+ local support_branches
+ local current_branch
+ local short_names
support_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$support_branches" ]; then
warn "No support branches exist."
@@ -43,20 +43,20 @@
short_names=$(echo "$support_branches" | sed "s ^$PREFIX g")
# determine column width first
- typeset -i width=0
- typeset branch
+ local width=0
+ local branch
for branch in $short_names; do
- typeset -i len=${#branch}
+ local len=${#branch}
width=$(max $width $len)
done
- width=width+3
+ width=$(($width+3))
- typeset branch
+ local branch
for branch in $short_names; do
- typeset fullname=$PREFIX$branch
- typeset base=$(git merge-base "$fullname" "$MASTER_BRANCH")
- typeset master_sha=$(git rev-parse "$MASTER_BRANCH")
- typeset branch_sha=$(git rev-parse "$fullname")
+ local fullname=$PREFIX$branch
+ local base=$(git merge-base "$fullname" "$MASTER_BRANCH")
+ local master_sha=$(git rev-parse "$MASTER_BRANCH")
+ local branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
printf "* "
else
@@ -67,8 +67,8 @@
if [ "$branch_sha" = "$master_sha" ]; then
printf "(no commits yet)"
else
- typeset tagname=$(git name-rev --tags --no-undefined --name-only "$base")
- typeset nicename
+ local tagname=$(git name-rev --tags --no-undefined --name-only "$base")
+ local nicename
if [ "$tagname" != "" ]; then
nicename=$tagname
else
diff --git a/gitflow-common b/gitflow-common
index b1c42ac..8efc365 100644
--- a/gitflow-common
+++ b/gitflow-common
@@ -18,7 +18,7 @@
# set logic
has() {
- typeset item=$1; shift
+ local item=$1; shift
echo " $@ " | grep -q " $item "
}
@@ -31,8 +31,8 @@
endswith() { [ "$1" != "${1#$2}" ]; }
# convenience functions for checking shFlags flags
-flag() { typeset FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -eq $FLAGS_TRUE ]; }
-noflag() { typeset FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; }
+flag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -eq $FLAGS_TRUE ]; }
+noflag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; }
#
# Git specific common functionality
@@ -61,10 +61,10 @@
# 2: Multiple matches found. These matches are written to stderr
#
resolve_nameprefix() {
- typeset name=$1
- typeset prefix=$2
- typeset matches
- typeset -i num_matches
+ local name=$1
+ local prefix=$2
+ local matches
+ local num_matches
# first, check if there is a perfect match
if has "$LOCAL_BRANCHES" "$prefix$name"; then
@@ -109,7 +109,7 @@
gitflow_require_clean_working_tree() {
gitflow_test_clean_working_tree
- typeset -i result=$?
+ local result=$?
if [ $result -eq 1 ]; then
die "fatal: Working tree contains unstaged changes. Aborting."
fi
@@ -164,10 +164,10 @@
# 3 Branch needs a real merge
#
gitflow_test_branches_equal() {
- typeset commit1=$(git rev-parse "$1")
- typeset commit2=$(git rev-parse "$2")
+ local commit1=$(git rev-parse "$1")
+ local commit2=$(git rev-parse "$2")
if [ "$commit1" != "$commit2" ]; then
- typeset base=$(git merge-base "$commit1" "$commit2")
+ local base=$(git merge-base "$commit1" "$commit2")
if [ "$commit1" = "$base" ]; then
return 1
elif [ "$commit2" = "$base" ]; then
@@ -184,7 +184,7 @@
gitflow_require_local_branch "$1"
gitflow_require_remote_branch "$2"
gitflow_test_branches_equal "$1" "$2"
- typeset -i status=$?
+ local status=$?
if [ $status -gt 0 ]; then
warn "Branches '$1' and '$2' have diverged."
if [ $status -eq 1 ]; then
@@ -204,8 +204,8 @@
# Checks whether branch $1 is succesfully merged into $2
#
gitflow_is_branch_merged_into() {
- typeset subject=$1
- typeset base=$2
- typeset all_merges=$(git branch --contains $subject | sed 's/^[* ] //')
+ local subject=$1
+ local base=$2
+ local all_merges=$(git branch --contains $subject | sed 's/^[* ] //')
has $base $all_merges
}