gitflow-init honors global gitflow configuration that may exist before a
new repo is created.
This commit is contained in:
parent
477a88d84b
commit
b1033aa3d3
1 changed files with 15 additions and 6 deletions
|
@ -61,7 +61,7 @@ cmd_default() {
|
|||
if [ "$branch_count" -eq 0 ]; then
|
||||
echo "No branches exist yet. Base branches must be created now."
|
||||
should_check_existence=NO
|
||||
default_suggestion=master
|
||||
default_suggestion=$(git config --get gitflow.branch.master || echo master)
|
||||
else
|
||||
echo
|
||||
echo "Which branch should be used for bringing forth production releases?"
|
||||
|
@ -69,7 +69,8 @@ cmd_default() {
|
|||
|
||||
should_check_existence=YES
|
||||
default_suggestion=
|
||||
for guess in 'production' 'main' 'master'; do
|
||||
for guess in $(git config --get gitflow.branch.master) \
|
||||
'production' 'main' 'master'; do
|
||||
if git_local_branch_exists "$guess"; then
|
||||
default_suggestion="$guess"
|
||||
break
|
||||
|
@ -103,7 +104,7 @@ cmd_default() {
|
|||
branch_count=$(git_local_branches | grep -v "^${master_branch}\$" | wc -l)
|
||||
if [ "$branch_count" -eq 0 ]; then
|
||||
should_check_existence=NO
|
||||
default_suggestion=develop
|
||||
default_suggestion=$(git config --get gitflow.branch.develop || echo develop)
|
||||
else
|
||||
echo
|
||||
echo "Which branch should be used for integration of the \"next release\"?"
|
||||
|
@ -111,7 +112,8 @@ cmd_default() {
|
|||
|
||||
should_check_existence=YES
|
||||
default_suggestion=
|
||||
for guess in 'develop' 'int' 'integration' 'master'; do
|
||||
for guess in $(git config --get gitflow.branch.develop) \
|
||||
'develop' 'int' 'integration' 'master'; do
|
||||
if git_local_branch_exists "$guess"; then
|
||||
default_suggestion="$guess"
|
||||
break
|
||||
|
@ -174,8 +176,15 @@ cmd_default() {
|
|||
fi
|
||||
|
||||
# finally, ask the user for naming conventions (branch and tag prefixes)
|
||||
echo
|
||||
echo "How to name your supporting branch prefixes?"
|
||||
if flag force || \
|
||||
! git config --get gitflow.prefix.feature >/dev/null 2>&1 ||
|
||||
! git config --get gitflow.prefix.release >/dev/null 2>&1 ||
|
||||
! git config --get gitflow.prefix.hotfix >/dev/null 2>&1 ||
|
||||
! git config --get gitflow.prefix.support >/dev/null 2>&1 ||
|
||||
! git config --get gitflow.prefix.versiontag >/dev/null 2>&1; then
|
||||
echo
|
||||
echo "How to name your supporting branch prefixes?"
|
||||
fi
|
||||
|
||||
local prefix
|
||||
|
||||
|
|
Loading…
Reference in a new issue