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

Preserving URLs #6

Closed
foolip opened this issue Jun 15, 2020 · 6 comments · Fixed by #14
Closed

Preserving URLs #6

foolip opened this issue Jun 15, 2020 · 6 comments · Fixed by #14

Comments

@foolip
Copy link

foolip commented Jun 15, 2020

The last step of "Delete the old branch" will break existing links including the branch name, which are fairly commonly spread around in at least my line of work (browser vendors). Here's one random example from a repo I work in a lot to illustrate:
web-platform-tests/wpt@1f1d940

Currently, keeping the old branch around is probably the only way to fix this. Better would be automatically redirecting, since the intention of such links was to follow tip-of-tree.

I don't know if GitHub is planning any server-side aliasing to fix this, have you been in touch?

@mheap
Copy link
Owner

mheap commented Jun 15, 2020

I'm unaware of any plans GitHub themselves have to help with this.

You can run with --keep-old if you'd like to skip the last step and keep the old branch. Could this be clearer in the documentation?

@foolip
Copy link
Author

foolip commented Jun 15, 2020

I think it would be good to spell out the implications of deleting the old branch in the documentation, and maybe to ask for confirmation before doing it since it's the default?

@mheap
Copy link
Owner

mheap commented Jun 16, 2020

I can definitely make it clearer in the docs, and make it clear that the old branch has been deleted in the CLI output.

What do you think about a section similar to the following in the README?


Help! It deleted my $old branch and I need it

By default this tool deletes the old branch intentionally. If you need to restore the old branch, run the following command on your local machine after cloning the repo:

The example assumes that you renamed from master to main

git fetch
git push origin remotes/origin/main:refs/heads/master

@foolip
Copy link
Author

foolip commented Jun 16, 2020

Proving instructions for recovering is good, but informing people ahead of time about broken URLs in case they haven't thought about that would be good.

Per https://twitter.com/natfriedman/status/1271253144442253312 there may be some support for branch switching coming from GitHub, so if I were in the position to give people advice I would recommend just waiting for a few weeks. If any kind of redirecting will happen, it's somewhat likely that it won't work if the rename has already happened. (Similar to what happens if you create a new repo instead of moving, and later would like to redirect the old repo to the new.)

@mheap
Copy link
Owner

mheap commented Jun 16, 2020

I can add a --confirm flag and if it's not present, prompt for confirmation after explaining the steps that will be taken 👍

@foolip
Copy link
Author

foolip commented Jun 17, 2020

That sounds good, thanks!

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

Successfully merging a pull request may close this issue.

2 participants