feat: implement prompt for remote renaming#1882
Conversation
sonyapieklik
left a comment
There was a problem hiding this comment.
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:
|
vilmibm
left a comment
There was a problem hiding this comment.
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.
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:
