Skip to content

Bugfix/help text and reorder rename args #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion git-flow-bugfix
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ git flow bugfix rebase
git flow bugfix checkout
git flow bugfix pull
git flow bugfix delete
git flow bugfix rename

Manage your bugfix branches.

@@ -831,7 +832,7 @@ r,[no]remote Delete remote branch

cmd_rename() {
OPTIONS_SPEC="\
git flow bugfix rename <new_name> [<new_name>]
git flow bugfix rename [<old_name>] <new_name>

Rename a given bugfix branch
--
3 changes: 2 additions & 1 deletion git-flow-feature
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ git flow feature rebase
git flow feature checkout
git flow feature pull
git flow feature delete
git flow feature rename

Manage your feature branches.

@@ -832,7 +833,7 @@ r,[no]remote Delete remote branch

cmd_rename() {
OPTIONS_SPEC="\
git flow feature rename <new_name> [<new_name>]
git flow feature rename [<old_name>] <new_name>

Rename a given feature branch
--
5 changes: 4 additions & 1 deletion git-flow-hotfix
Original file line number Diff line number Diff line change
@@ -53,6 +53,9 @@ git flow hotfix start
git flow hotfix finish
git flow hotfix publish
git flow hotfix delete
git flow hotfix rebase
git flow hotfix track
git flow hotfix rename

Manage your hotfix branches.

@@ -732,7 +735,7 @@ r,[no]remote Delete remote branch

cmd_rename() {
OPTIONS_SPEC="\
git flow hotfix rename <new_name> [<new_name>]
git flow hotfix rename [<old_name>] <new_name>

Rename a given hotfix branch
--
2 changes: 2 additions & 0 deletions git-flow-release
Original file line number Diff line number Diff line change
@@ -417,8 +417,10 @@ usage() {
git flow release [list]
git flow release start
git flow release finish
git flow release branch
git flow release publish
git flow release track
git flow release rebase
git flow release delete

Manage your release branches.
1 change: 1 addition & 0 deletions git-flow-support
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ usage() {
OPTIONS_SPEC="\
git flow support [list]
git flow support start
git flow support rebase

Manage your support branches.

14 changes: 8 additions & 6 deletions gitflow-common
Original file line number Diff line number Diff line change
@@ -609,15 +609,17 @@ gitflow_rename_branch() {
# read arguments into global variables
if [ -z $1 ]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we testing to see if the first variable passed in is a null string here when we perform the exact same test a few lines down for the second variable?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the user may provide 0, 1, or 2 args?

Also note, this PR did not change that line.

NEW_NAME=''
else
NEW_NAME=$1
fi

if [ -z $2 ]; then
NAME=''
else
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nesting the if else block used to determin how to call rename inside of this else made the code a little harder for me to initially follow as I had to go back up and figure out the context of when it's called.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose an alternative?

NAME=$2
if [ -z $2 ]; then
NAME=''
NEW_NAME=$1
else
NAME=$1
NEW_NAME=$2
fi
fi

BRANCH=${PREFIX}${NAME}
NEW_BRANCH=${PREFIX}${NEW_NAME}