-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add git-sync #500
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
add git-sync #500
Conversation
bin/git-sync
Outdated
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.
help can be a legal name of a remote branch.
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 reviewing it. I should fix that.
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.
As we don't use "?" for seeing usage with any other commands, we shouldn't do it here either.
? is a special character in some terminals with extglob (i think) enabled, and could confuse people as well.
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.
I will remove '?'. Thank you!
|
What about using a default remote/branch when |
|
I will follow the convention of |
|
I changed to use upstream of local branch by default, when remote/branch is not specified. |
bin/git-sync
Outdated
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.
A little quibble:
git rev-parse --abbrev-ref --symbolic-full-name @{u} will return nothing if there is not related upstream branch.
Then users will see ... & sync with ''? [y/N] and the command may simply reset to current branch, which is not really wanted.
|
I added upstream check that is based on exit status of |
|
Yup, looks good to me! Merging. In the future, I think it'd be a good idea to standardize how help/usage is displayed for each command. Each command should have the same name for the function that displays the help/usage. Additionally, the formatting of the usage should be the same. |
|
Thank you for reviewing it! |
|
Thanks for contributing, @kumon! 😄 |
Add "sync" command.
This command syncs local branch with remote branch.
This runs: