Skip to content
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

Fix git rpr #1109

Merged
merged 3 commits into from
Feb 6, 2017
Merged

Fix git rpr #1109

merged 3 commits into from
Feb 6, 2017

Conversation

emilevauge
Copy link
Member

@emilevauge emilevauge commented Feb 3, 2017

This PR adds an argument to manage upstream correctly: git rpr pr remote/branch
It also adds git rmpr & git cpr commands.

/cc @vdemeester

Signed-off-by: Emile Vauge [email protected]


if [ "$#" -ne 1 ]; then
if [ "$#" -ne 2 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a default value for the most common case ? (if $2 is not present, use upstream/master for ex 👼 )

Copy link
Contributor

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

@emilevauge there is still room for improvement

  1. git fetch -p --all (-p is not required though 👼) to make sure the remotes are all up-to-date
  2. Validate beforehand that the specified remote exists.

@emilevauge emilevauge modified the milestone: 1.2 Feb 6, 2017
@emilevauge
Copy link
Member Author

@vdemeester I added 1/. On 2/, is it really needed? The script will fail if the specified remote doesn't exist, right ?

Copy link
Contributor

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

The script will fail if the specified remote doesn't exist, right ?

It will, but it leaves you in a weird state (not on the same branch when you ran the script initially).
Also, shouldn't rpr use cpr and rmpr ?

.github/cpr.sh Outdated
@@ -0,0 +1,26 @@
#!/bin/sh
#
# git config --global alias.rpr '!sh .github/cpr.sh'
Copy link
Contributor

Choose a reason for hiding this comment

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

This alias is not right 👼

.github/rmpr.sh Outdated
@@ -0,0 +1,27 @@
#!/bin/sh
#
# git config --global alias.rpr '!sh .github/rmpr.sh'
Copy link
Contributor

Choose a reason for hiding this comment

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

This alias is not right 👼 👼

Signed-off-by: Emile Vauge <[email protected]>
Signed-off-by: Emile Vauge <[email protected]>
Signed-off-by: Emile Vauge <[email protected]>
@emilevauge
Copy link
Member Author

emilevauge commented Feb 6, 2017

@vdemeester

It will, but it leaves you in a weird state (not on the same branch when you ran the script initially).

Added a TRAP calling clean.

Also, shouldn't rpr use cpr and rmpr ?

Indeed, fixed.

Copy link
Contributor

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants