[Pkg-javascript-devel] How to switch to DEP14 automatically for > 1000 existing repositories

Xavier yadd at debian.org
Fri Sep 11 17:23:39 BST 2020


Le 11/09/2020 à 18:14, Xavier a écrit :
> Le 11/09/2020 à 12:42, Paolo Greppi a écrit :
>> Hi Andreas,
>>
>> Il 11/09/20 12:16, Andreas Tille ha scritto:
>>> Hi,
>>>
>>> in teams where I have lots of packages (summing up to more than 1000)
>>> I've touched) we followed the gbp default and have branches
>>>
>>>     master
>>>     upstream
>>>     pristine-tar
>>>
>>> and this is also the layout fixed in those team policies.  I admit I
>>> don't have strong feelings about branch names but I'm willing to
>>> normalize to some common standard which seems to be the now accepted
>>> DEP14.  However, its not acceptable to change this manually.  As far as
>>> to my experience it is hard to rename a default branch - at least I did
>>> this in those rare cases when I had to rename a default branch by using
>>> the Salsa web interface.
>>>
>>> My guess is that the Salsa API provides means to script everything.  Is
>>> there any existing script that supports this or is there any volunteer
>>> to write it.  I would start migrating Debian Med, Debian Science and
>>> R packaging team repositories once gbp also switched to DEP14.
>>>
>>> Kind regards
>>>
>>>        Andreas.
>>
>> I would use a Python library as client to the Gitlab API on salsa.
>> We have this one already packaged in Debian:
>> https://tracker.debian.org/pkg/python-gitlab
>>
>> Disclaimer: I have already used this library for a different purpose:
>> https://salsa.debian.org/paolog/bts2salsa
>>
>> I am interested in working on this for the JavaScript team,
>> but of course only if the team agrees to this bulk change.
>>
>> Paolo
> 
> Hi,
> 
> salsa(1) can do it. See "rename_branch" command in manpage.
> 
> Cheers,
> Xavier

Something like:

  $ salsa --group xx-team --all --no-fail protect_branch master no
  $ salsa --group xx-team --all --no-fail rename_branch \
          --source-branch=master --dest-branch=debian/master
  $ salsa --group xx-team --all --no-fail rename_branch \
          --source-branch=upstream --dest-branch=master
  $ salsa --group xx-team --all --no-fail protect_branch master md

NB: I didn't verify if "--all" is compatible with these commands but I
can fix that if this doesn't work. I think Raphaël Hertzog tried it;
Raphaël, did you ?



More information about the Pkg-javascript-devel mailing list