[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rename master branch to main



* Sébastien Villemot <sebastien@debian.org> [2021-08-07 11:55]:

Le vendredi 06 août 2021 à 18:11 +0200, Rafael Laboissière a écrit :
* Sébastien Villemot <sebastien@debian.org> [2021-08-04 09:24]:

Le mardi 03 août 2021 à 12:29 +0200, Rafael Laboissière a écrit :

[…]

I will try to automate the procedure to avoid errors due to manual operations. Please tell me whether you agree with the plan above or if I forgot something.

Sounds good to me, thanks.

Ok, I wrote a script that automates the whole procedure [*]. I tested it on the octave-brain2mesh repository. Everything seems to work correctly with the new layout, as you can check by cloing a fresh repository:

     gbp clone git@salsa.debian.org:rafael/octave-brain2mesh.git

I did not test the whole workflow but, at least, "gbp dch", "gbp buildpackage", and "gbp import-orig" seem to work fine.

Unfortunately, I could not find a way to update an existing cloned repository with the old branches "master" and "upstream". If someone know how to do it, please let me know. If you have already commit to your local master branch and not pushed them, I apologize for the inconvinience.

The following may work (untested):

git fetch git branch --move upstream upstream/latest git branch --move master debian/latest git branch --set-upstream-to=origin/upstream/latest upstream/latest git branch --set-upstream-to=origin/debian/latest debian/latest git checkout upstream/latest git pull git checkout debian/latest git pull

Thanks, Sébastien. Your code almost fully worked. I needed just to add "git remote prune origin" before the first "git checkout" command. I added the resulting script to our admin repo [*].

Rafael

[*] https://salsa.debian.org/pkg-octave-team/admin/-/blob/main/script/dep14-update-local-repo


Reply to: