From 89ae3e667a9bb6206f916bcd9c5d2dbb69e97b44 Mon Sep 17 00:00:00 2001 From: Lapo Luchini Date: Thu, 23 Feb 2023 18:12:04 +0000 Subject: [PATCH] Add support for dots in branches. --- mirror_to_github.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mirror_to_github.sh b/mirror_to_github.sh index 63d886b..36d2171 100755 --- a/mirror_to_github.sh +++ b/mirror_to_github.sh @@ -9,7 +9,10 @@ if [ ! -d .git ]; then fi touch git-marks1.txt git-marks2.txt [ -f git-authors.txt ] || echo 'lapo@lapo.it = Lapo Luchini ' > git-authors.txt -mtn ls branches --ignore-suspend-certs | sort -V | awk -F . '{ print $0 " = " ($4 ? $4 : "trunk") }' > git-branches.txt +mtn ls branches --ignore-suspend-certs | sort -V | awk ' + NR == 1 { base = $0; len = length(base) } + { d = length($0) - len; print $0 " = " (d > 0 ? substr($0, len+2) : "trunk") } +' > git-branches.txt mtn --quiet --authors=git-authors.txt --branches-file=git-branches.txt --import-marks=git-marks1.txt --export-marks=git-marks1.txt git_export | \ git fast-import --import-marks=git-marks2.txt --export-marks=git-marks2.txt git push --mirror origin -- 2.51.2