-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bugfix/help text and reorder rename args #1
Conversation
…<old_name>] <new_name>`, following git conventions (like `git branch --move [<oldbranch>] <newbranch>`)
@@ -609,15 +609,17 @@ gitflow_rename_branch() { | |||
# read arguments into global variables | |||
if [ -z $1 ]; then |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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=$1 | ||
fi | ||
|
||
if [ -z $2 ]; then | ||
NAME='' | ||
else |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose an alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is necessary to set both NAME and New_Name to empty strings this can be done with out having to use an else clause and nest the actual test used to determine the number of arguments passed in.
I think a better option would be to adopt a fail early mindset. Instead of waiting tell after we have attempted to assign the old and new branch names before we test for a failure we do it before even attempting the assignments. Since rename has to have at least one argument passed to it. There is no need to test how many arguments were passed if rename was called with zero arugments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding these missing commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching that new name and old name were reversed I think the initial idea was that since the old name is optional there was no need to have it first. However it does make more sense to follow the standard git convention.
Asides:
|
While the official repo is at CJ-Systems/gitflow-cjs I do not mind PR's being submitted to my "personal dev" copy. If you feel it may cause issue or confusion for future PR's I have no problems with making my copy private.
Thank you for the feedback on this. I typically don't use the webUI side of github and at the time I did not realize that even though the intent was to approve the change I had been commenting on it was going to "approve" the entire PR.
I shall keep that in mind thank you for letting me know. |
This feels a bit like bikeshedding to me. That said, I tried to make minimal changes to the code and to the approach. (See One option would be to keep it as I have it, to keep the differences minimal in case gitflow-avh ever resurrects. Alternatively, you could make your proposed changes in a separate commit, and push onto my branch. |
Oh, I'm not sure how I wound up on this one, then. Might as well at least finish our discussion here, then - if not merge it here, too.
IMO, going forward, better to have them all in one place, on the "official" repo. I'm not sure what's the best way to do that, though. I don't think you'll be able to make it private since it's a fork of a public repo. Maybe disallow further issues and/or PRs on this one?
Welcome. :)
Interesting. What interface did you use? |
I'm doubting myself about this bit now, since the way I moved it out of draft just now was by clicking "Ready for Review". See also https://github.blog/changelog/2020-04-08-convert-pull-request-to-draft/ |
Fair enough, I can appreciate wanting to keep the changes simple that way if gitflow-avh ever does become active again, the changes can be easily committed there as well.
I was using the vs code plugin Github Pull Requests and Issues. However I didn't like the comment dialog scrolling off screen when adding a comment for the entire file when you tried to scroll down. I'll get this merged and pushed to both repos and see what I can do about preventing a similar situation again in the future.
I actually just assumed that you saw the gitflow-cjs and didn't realize that the first one was for my "personal" copy since it's listed first due to how github sorts the dropdown. |
* update contributing section to match the wiki * add better quick start and pull request sections
Originally submitted against petervanderdoes/gitflow-avh: