From 2bb9097f874e3f2e6405da2df30758165ee72631 Mon Sep 17 00:00:00 2001 From: Izuru Yakumo ~Eternal Servant~ Date: Thu, 10 Apr 2025 17:50:18 -0300 Subject: [PATCH] Hey, hey itchy-trigger finger! --- LICENSE | 2 +- README.md | 20 +++++++++++++++++++- svn2git-sync | 12 ++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 svn2git-sync diff --git a/LICENSE b/LICENSE index c7ffc1a..28cc892 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1 @@ -"THE BEER-WARE LICENSE" (Revision 42): 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): 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 diff --git a/README.md b/README.md index 9a72f25..84040b9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ # svn2git-sync -Easily sync SVN repositories to their Git counterparts (or so I guess) \ No newline at end of file +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)` diff --git a/svn2git-sync b/svn2git-sync new file mode 100644 index 0000000..c845f00 --- /dev/null +++ b/svn2git-sync @@ -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"); +}