diff --git a/README.md b/README.md index 84040b9..13bb59a 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ $git_host = "https://git.yakumo.dev" $git_passwd = ""; $git_user = ""; @repos = { "aya", "chen" }; +$reporoot = ""; ``` ## Diagnostics diff --git a/svn2git-sync b/svn2git-sync index 96521e6..7d718d3 100644 --- a/svn2git-sync +++ b/svn2git-sync @@ -6,12 +6,17 @@ use warnings; my $git_host; my $git_passwd; my $git_user; +my $reporoot; my @repos; do "$ENV{HOME}/.config/svn2git-sync.conf" or die "Can't load config file"; +chdir($reporoot); + 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"); } + +chdir($ENV{OLDPWD}); diff --git a/svn2git-sync.conf.example b/svn2git-sync.conf.example new file mode 100644 index 0000000..c6ce692 --- /dev/null +++ b/svn2git-sync.conf.example @@ -0,0 +1,7 @@ +# vim: syntax=perl +# -*- mode: perl -*- +$git_host = "https://git.example.com"; +$git_pass = "nekomikoreimu"; +$git_user = "hakurei.reimu"; +$reporoot = "/home/user/git"; +@repos = { "nekomikoreimu" };