-
Couldn't load subscription status.
- Fork 7.3k
feat: implement prompt for remote renaming #1882
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
Conversation
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.
failing for ubuntu, windows, and macros
|
As I mentioned in issue #847, I didn't learn Go yet! The offline fork I had is mostly based on the previous implementations. |
|
I came here looking for an issue to add an optional name to the fork itself, not only the remote name βΒ for example, when several repos have the same name, but within different user or org workspaces. Don't want to derail this PR, just checking to see if there's some common use cases here. A few other things that feel related:
|
9f6b28f to
5e23766
Compare
5e23766 to
c4ffde0
Compare
c4ffde0 to
3d905d2
Compare
3d905d2 to
e513333
Compare
|
i'll see this through. TODO:
|
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.
self approving since we went over the implementation synchronously and there are no huge changes here
|
Thanks @vilmibm for your work! π |
|
So this is changing the previous behavior, right? If you cloned a repo from origin, then added a fork, you would have the old origin be added to the https://asciinema.org/a/DRebWnUq73hVcNAY8lZdVXolV As much as I like having the option to pass a name, this is marked as an addition, but it's also a feature removal, and it'll be missed :c |
| renameTarget := "upstream" | ||
| renameCmd, err := git.GitCommand("remote", "rename", remoteName, renameTarget) |
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.
This clearly broke existing functionality to rename existing remote to upstream π
The pattern of origin, upstream is very common when forking due to scripts and muscle memory.
|
Is a compromise here a |
|
Good enough for me :) |
|
In my opinion a flag would not resolve it. Perhaps If anything though |
fixes #847
Changes:
A prompt asking for the name of fork remote, if there is already remote with same name, another prompt asking for name of source remote to rename it, otherwise just add the remote name from the first prompt.
Behaviour if the entered name of remote is already a remote name:

Behaviour if the entered name of remote is not a remote name:
