On Fri, 27 Dec 2019, Richard Biener wrote:

> Does this allow to keep the URL of the old git mirror and the new 
> official fit repo the same or would that cause conflicts with existing 
> clones?

The URL of the old mirror feels like it's the right URL to use for the new 
conversion.  It would cause conflicts for existing clones, in that 
attempting to fetch would force-update refs in origin/ that exist with 
different contents in old and new histories (with the version with lots of 
ref renamings, there might not be many or any of those other than master) 
then give the error "fatal: refusing to merge unrelated histories" rather 
than updating the local master branch tracking origin/master.  It might be 
possible to provide a script to rearrange refs in an existing clone, but 
checking out again is probably simpler.

We may want a git hook that prevents people from accidentally pushing 
commits whose ancestry links back to the existing git mirror (i.e. 
includes the first commit on trunk in that mirror), to avoid accidents 
where pushing a merge (as opposed to a rebase) suddenly adds 300 MB of the 
version of the history in the existing mirror to what everyone fetches by 
default.

> If that's not possible instructions how to manually import a branch 
> (fetch refs from the old repo, rebase and push?) would work for me, too, 
> and would allow me to only keep the single active branch. As far as I 
> understand active branches require manual work anyway?

Yes, I think manual work will be needed to rebase on the new history.

Based on my experience of git rebasing, a two-stage rebase process may be 
helpful - first rebase the development branch on top of the most recent 
commit, in the old history, from which it was merged (so giving it a 
cleaner history without all the merge commits from past merges - any 
further history cleanup beyond eliminating those merges is optional), then 
rebase that on top of the corresponding commit in the new history (this 
second rebase should be very straightforward).

-- 
Joseph S. Myers
j...@polyomino.org.uk

Reply via email to