Hey, hey itchy-trigger finger!

This commit is contained in:
Izuru Yakumo ~Eternal Servant~ 2025-04-10 17:50:18 -03:00
parent 7407c4532b
commit 2bb9097f87
3 changed files with 32 additions and 2 deletions

View File

@ -1 +1 @@
"THE BEER-WARE LICENSE" (Revision 42): <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp
"THE BEER-WARE LICENSE" (Revision 42.1): <eternal-servant@yakumo.dev> wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a bottle of sake in return Izuru Yakumo

View File

@ -1,3 +1,21 @@
# svn2git-sync
Easily sync SVN repositories to their Git counterparts (or so I guess)
Easily sync SVN repositories to their Git counterparts (or so I guess)
## Dependencies
* [Git](https://git-scm.com) (and `git-svn`)
* [Perl](https://www.perl.org)
* [Subversion](https://subversion.apache.org)
## Run
* Write a configuration file and save it on `~/.config/svn2git-sync.conf`
```perl
$git_host = "https://git.yakumo.dev"
$git_passwd = "";
$git_user = "";
@repos = { "aya", "chen" };
```
## Diagnostics
I only tested it on [Gitea](https://gitea.io), but I'm 100% sure it works just as fine with a home-made HTTP Basic Authentication setup with `git-http-backend(1)`

12
svn2git-sync Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env perl
# $YakumoLabs$
use strict;
use warnings;
do "$ENV{HOME}/.config/svn2git-sync.conf"
foreach my $r (@repos) {
print "Processing $r\n";
system("git -C $r svn --quiet rebase");
system("git -C $r push --quiet https://$git_user:$git_passwd\@$git_host/$git_user/$r");
}