Changing default branch of an autopkg org repo from master to main

57 views
Skip to first unread message

Graham Pugh

unread,
Aug 31, 2021, 4:01:26 PM8/31/21
to autopkg-discuss
Hi all,

I'm bringing this conversation over from Slack and this GitHub issue: https://github.com/autopkg/autopkg/issues/765

I decided to change my "grahampugh-recipes" repo's default branch from "master" to "main". (This setting is not available to the maintainers of the repos, but I put in an issue and it was kindly changed on my behalf.)

Unfortunately, our collective belief that "autopkg repo-update grahampugh-recipes" would detect that the default branch had changed and switch to it were not borne out. Anyone who already has the repo in their list will remain on the master branch after performing repo-update.

When I mentioned that I wanted to make this change in Slack, there were a couple of other people who said they would like to do it too. So, is this enough of an issue to warrant a code change to handle a change of default branch? 

The workaround is easy - just run  "autopkg repo-delete grahampugh-recipes" followed by  "autopkg repo-add grahampugh-recipes" - but communicating the change is hard. 

One suggestion would be for repo-update verb to include a check to see if the current branch is the default branch or not, and spit out a warning if not. That would allow people who are knowingly using a different branch of a repo to do so, while notifying others that they may wish to switch branches. 

I'd be interested to hear other people's views and ideas on this.

Cheers
Graham

Mike Solin

unread,
Dec 26, 2021, 1:41:27 PM12/26/21
to autopkg...@googlegroups.com
Sorry for taking so long to reply. It's been on my to-do list for...a while.

I ended up getting a list of all of the recipe repos that I use, exporting that, and doing a 'for' loop to do `autopkg repo-delete $repo` and then `autopkg repo-add $repo`.

The process would be easier if `autopkg repo-list` would give me just the URLs (so I could paste them into an array), but some futzing with awk would probably get me there. That was the most time-consuming part.

It'd be great if AutoPkg could determine if the current branch is the default, or even exists, and offer to help the user fix it.



--
You received this message because you are subscribed to the Google Groups "autopkg-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autopkg-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autopkg-discuss/d9eaa2fc-21dd-4c4f-b8b4-3d1cb8feea6an%40googlegroups.com.

Nick McSpadden

unread,
Dec 26, 2021, 4:37:14 PM12/26/21
to autopkg...@googlegroups.com
It doesn't seem that useful to me to spend a lot of effort putting in code for something that will happen generally only once in every repo's lifetime. It's an annoyance but a one-time cost to the AutoPkg admin.



--
--
Nick McSpadden
nmcsp...@gmail.com
Reply all
Reply to author
Forward
0 new messages