-
Notifications
You must be signed in to change notification settings - Fork 0
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
discussion about git pr push -r -n
and defaults
#47
Comments
That's a good question tied up in history, and could be improved now:
At first, there was just 'push' which didn't do anything fancy other
than push to the right remote.
Then I got tired of going to the web browser to open them, so added
"-r" which means "open a pull Request automatically" It calls the "gh"
subcommand to do this (but gitlab *has* to open them at the same time
it pushes...)
Then I got tired of saving and closing the editor, so added "-n".
These days I almost always use "-r", and then very often "-n" too.
I've actually made it shorter, adding a git alias `prpnr = "pr push -n
-r`. Then I added bash aliases for "m" (git pr master; detect and
check out master branch), "prn" (git pr pr new), and "prpnr" (git pr
push -n -r) so I can even avoid typing "git". So I've gone down some
deep hole here, probably too deep to be default.
This should probably be re-thought some, because indeed it is a bit
much and my solution is too esoteric. How do you think it should be
designed?
|
For me I anticipate that I will use This means that I would probably prefer Of course I can solve this with an alias but wanted to discuss good defaults before this tool goes viral and it becomes harder to change defaults. |
The more I think about it the more I like |
But if If I did not know what |
I like "branch" and "open" (and it's easy to keep backwards
compatibility).
"pr open" can directly call 'push -r", the script invokes itself other
places, too.
"pr branch" makes sense as the new name of "pr new", though we avoid
confusion since "git branch" just makes branch and "checkout -b"
checks it out. I think this won't be a big deal.
|
The new |
I think "branch" is a pretty good name. As a verb is is describing
what it does.
One reason for "push" not using "-r" by default: I also
sometimes/often update a pull request by just "pr push". For bigger
changes, this is more often than opening.
So, add "branch" and "open" ? Or think more about switch/create?
|
Sounds good:
|
The What about Here is the reference for hub: |
I like And |
And although commands can reference each other and backwards compatibility is "no problem", I would still limit the option to not arrive at something like Git where there are some options where I ask myself whether Linus has used them twice and now we are stuck with them. So perhaps instead:
we could do: $ git pr push mybranch # here the user preferred to not open yet
$ git pr open mybranch |
I still sort of like the principle of least surprise: it's safe to open the editor (pre-filled with the message it would have). But not doing that could result in spam to projects when someone doesn't realize it will immediately open it and mail everyone.
In fact that's sort of how this evolved: there was To make it worse, Gitlab has different semantics: Should we have a video chat to talk about it? I feel this is going on quite a while, and more quick discussions=better. |
The branch one seems simple so I did that one first. |
Good convincing argument to not make |
- open command: This is an alias for `git pr -o`, but provides a more logical entry point to recommend to people when they are starting. Open always pushes at the same time. - This concept may still be developed, this is only the initial change. - Remove documentation of the `gh` subcommand, it is almost never used directly. - Part of #47.
- open command: This is an alias for `git pr -o`, but provides a more logical entry point to recommend to people when they are starting. Open always pushes at the same time. - This concept may still be developed, this is only the initial change. - Remove documentation of the `gh` subcommand, it is almost never used directly. - Part of #47.
How do you typically use
git pr push
? Are you using-r -n
always or only sometimes?I think the default should be what we do most of the time but unsure what we do most of the time? I can imagine myself typing
-r -n
always.These are not too easy to remember. What is
-r
short for?The text was updated successfully, but these errors were encountered: