Make an unofficial git repo tracking svn
Brought to you by:
sobukus
I think providing an unofficial git repository would be useful as most people nowadays are used to git but not to git.
I have no idea how complex the svn repository of mpg123 is though.
If there is willingness to completely convert to a git workflow,
then it is maybe required to use a specialized tool such as reposurgeon to do the conversion.
Well, there are unofficial git repos from several people on github, in various states.
The mpg123 svn repo somewhat follows the standard of trunk/ branches/ tags/, but also has things like website/ and other historic stuff. I actually painfully constructed it from past release tarballs before there was revision control for mpg123 and the initial CVS repository. It is also used as a file store of things associated with mpg123 code, as svn can do that easily. A useful git mirror might focus on trunk, not even bothering with tags. Tags in the git sense don't exist in subversion and I make use of the fact that I can construct a tag before treating it as an unchanged bit of history. You could create branches named release-x.y.z instead (for those that are named x.y.z) and tag the endpoint of those.
I guess migration tools have some strategies for such, but I am not really intending to move mpg123 to git. I'm not doing things just because most others do them, actually more of the opposite;-)
Are you talking about making a git mirror as such, or about a mirroring project on github so that people have the full workflow of that? I could be convinced to host a read-only git mirror of mpg123's trunk, without any fancyness, on the mpg123 scm server. I'd also be fine with you managing a half-official mirror on github or the like. I would even link to it from the mpg123 website if you promise to keep it up to date (or if automatics do that).
A migration to git is not in order. Mpg123 is rather mature. New stuff happening is mostly porting and wrappers for various languages. So no need for a huge flow of changes. People also happily use git-svn to work locally with git and then send patches.
Also, if someone mails me / creates a ticket here about, say, a github fork of the mirror with some changes that should be pulled, I am capable of getting the diff and importing it into the mpg123 repo. Or, well, as git is designed for Linus' workflow with emails, a patch mail generated with git also should work.
The only thing that bugs me is that svn doesn't track change ownership, that's something sensible added in git, but concering the code itself, it works fine and also offers some tricks that git doesn't. Some variety is healthy, also for scms and project hosting;-)
I think it should be possible to make a github clone using nothing else but github actions:
e.g. update every 24 hours.
The issue tracker + wiki can be disabled.
Using github actions, you can define what action to do when somebody opens a pull request.
Perhaps a mail could be sent to the mpg123-devel mailing list?
As a proof of concept, I have created https://github.com/madebr/mpg123
Using github actions and git-svn, it should sync with the svn repo every 3 hours.
https://github.com/madebr/mpg123/actions
It's not well tested right now, because no new commits have been added to the svn since then.
Also, every sync takes 20 minutes because git-svn must fetch the complete svn history.
This overhead could be avoided if the official svn would have some hook that syncs itself with a git repository on every change.
Hm, OK … full clone for 20 minutes does not sound so nice. What about
https://mpg123.org/trunk/.git/
?
This is git-svn on the main server, triggered by a hook. It doesn't bother with tags/branches, like your approach. A clone takes quite long (it's just Apache serving the repo), but updating should be quick. Hm, what does one need github for, actually … well, if people want to easily have their fork there.
About pull requests … mail to the list would be a good idea; but I'm not sure about the list membership/spam issues.
I've updated the github actions to use your git-svn clone.
See https://github.com/madebr/mpg123/actions
(The error should resolve itself with the next cron job)
You tested a pull request there? Of course, nothing arrived at the mailing list, AFAICS. You'd have to set up a subscribed sender address, I presume. You could configure maintainer@mpg123.org, though … hoping that this doesn't become a source of spam.
I'm testing with my own mail addresses at the moment.
It will only send a mail when opening a github pull request, not when somebody adds a comment, edits or adds a commit.
Also, it checks for new pull requests hourly (not when opening a pull request): this is done because github actions triggered by pull requests don't have access to secrets (which I need to send mails).
As you can see from https://github.com/madebr/mpg123/pull/4, it is currently a bit of a spam bot but it's a good begin.
I think I got it working.
The hourly cron job will send mails for non-tagged pull requests (and tag it afterwards).
Where do you want to send mails to?
To mpg123-devel@lists.sourceforge.net?
To maintainer@mpg123.org?
To both?
It looks like github/mpg123 is already taken
How about a libmpg123 organization with a mpg123 repo?
So https://github.com/libmpg123/mpg123?
Do you want to create this organization+repo and take ownership or do you want me to completely handle it?
It is possible to add collaborators.
The mailing script requires configuration environment variables for github access + sending email, which I have configures using secrets.
For reference
PUSH_GITHUB_TOKEN: github token that has repo:public_repo permission (it needs to tag and add a comment)MAIL_RECEIVER: the address of the mailing list/maintainer. This can be multiple addresses. e.g.mpg123-devel@lists.sourceforge;maintainer@mpg123.org.MAIL_SERVER: server name of the smtp mail server (smtp.gmail.comfor gmail)MAIL_LOGIN: login user name for the smtp mail serverMAIL_PASSWORD:password or token for the smtp mail server (for gmail, I've used an app password)MAIL_SENDER: from address of the mail (for gmail, this must be the same asMAIL_LOGIN, or is ignored)The git clone at https://mpg123.org/trunk/.git/ does not track current git.
The latests commits are not downloaded when doing git fetch.
OK, so you have a regular mail account that is subscribed. That works, of course.
The existing mpg123 org is a bit suspicious and inactive. Seems to be just some forking off https://github.com/ServiceNow during training sessions? Seems to be a rather weak claim to the name, but it exists.
Since we are not really moving to github for development, it is maybe actually preferrable to have a less official name. I'm yet undecided if I'd add it under my name. Actually, since it is your initiative, I kindof like the idea that this keeps running under your name. You're the one that figured things out and has an eye on it. I keep the git-svn mirror on the main server.
When mail to the -devel list works, it makes sense to only post there. We can pretend that there is some actual group development, apart from occasional patches regarding bugs/enhancements.
I'll have to check the commit hook. It should update the git.
Apparently I misunderstand how git-svn should work. It doesn't update. the git repo properly. I've seen some modification info, but the files don't change.
I'll have to re-check this later. Got work stuff to do.
OK, I missed
git svn rebaseaftergit svn fetch. The tree is updated now and we'll see if new commits do appear.Seems like we could get rolling with really preparing 1.26.4 for end-of-year.
I didn't have to do anything. The cron job picked up your updates, so it looks like it is set up correctly!
I just configured https://github.com/madebr/mpg123 to send a mail to mpg123-devel@lists.sourceforge.net only when opening a pull request.
No follow-up mails are sent.
Thanks, I added that info the mpg123 website now (commit imminent). So, you're running the official non-official mirror now;-)
Just read about SDL moving to github, abandoning mercurial and all their self-hosting in the process. Makes you think … but I'm not really ready to give up independence yet. All people doing the same thing is boring.
I might one time decide to make a more official mirror on github, maybe if one could grab the mpg123 name. But for now, you helped us get a bit more reach over to where all the hip young developers dwell.
Hey,
I received a PR today on my fork: https://github.com/madebr/mpg123/pull/8
The cron github action log says that an email has been sent successfully, but I cannot find the mail in the mpg123-devel mailing list archive.
gha log: https://github.com/madebr/mpg123/runs/2764845520?check_suite_focus=true
Do you have an idea where the mail could be stuck?
There were some delays on the mails during the weekend. Could be bad luck.
I fixed the PR issue in trunk.
Thanks!