You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
621 B
Bash
37 lines
621 B
Bash
#!/usr/bin/env bash
|
|
|
|
REPOS=( "$@" )
|
|
BASE_PATH="/home/user/nwellpott/svnMigration"
|
|
|
|
function migrate() {
|
|
# change dir
|
|
/usr/bin/printf "changing directory to %s\n" "$REPO"
|
|
cd "$BASE_PATH/$REPO" || return 1
|
|
|
|
# rebase
|
|
/usr/bin/printf "attempt to fetch %s commits\n" "$REPO"
|
|
/usr/bin/svn2git --rebase
|
|
}
|
|
|
|
function clean() {
|
|
# clean up git tree
|
|
/usr/bin/git gc --auto
|
|
}
|
|
|
|
function push() {
|
|
# push changes
|
|
/usr/bin/git push --all || return 1
|
|
|
|
# push tags
|
|
/usr/bin/git push --tags
|
|
}
|
|
|
|
# main
|
|
for REPO in "${REPOS[@]}"; do
|
|
migrate || continue
|
|
|
|
clean
|
|
|
|
push || continue
|
|
done
|