diff --git a/svnmigrate.sh b/svnmigrate.sh index 5535474..85ed6fa 100644 --- a/svnmigrate.sh +++ b/svnmigrate.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash -REPOS=(skript scare scare2) +REPOS=( "$@" ) BASE_PATH="/home/user/nwellpott/svnMigration" -for REPO in "${REPOS[@]}"; do +function migrate() { # change dir /usr/bin/printf "changing directory to %s\n" "$REPO" cd "$BASE_PATH/$REPO" || exit 1 @@ -11,7 +11,26 @@ for REPO in "${REPOS[@]}"; do # rebase /usr/bin/printf "attempt to fetch %s commits\n" "$REPO" /usr/bin/svn2git --rebase +} +function clean() { + # clean up git tree thoroughly + /usr/bin/git gc --aggressive +} + +function push() { # push changes - # /usr/bin/git push --all + /usr/bin/git push --all + + # push tags + /usr/bin/git push --tags +} + +# main +for REPO in "${REPOS[@]}"; do + migrate + + clean + + push done