[GRASS-SVN] r74070 - grass-addons/tools/svn2git
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Feb 9 06:17:49 PST 2019
Author: martinl
Date: 2019-02-09 06:17:49 -0800 (Sat, 09 Feb 2019)
New Revision: 74070
Added:
grass-addons/tools/svn2git/0-migrate-fetch.sh
grass-addons/tools/svn2git/1-migrate-branches-tags.sh
Removed:
grass-addons/tools/svn2git/migrate.sh
Log:
svn2git: split migration script into pieces, split repo into grass and grass-legacy
Added: grass-addons/tools/svn2git/0-migrate-fetch.sh
===================================================================
--- grass-addons/tools/svn2git/0-migrate-fetch.sh (rev 0)
+++ grass-addons/tools/svn2git/0-migrate-fetch.sh 2019-02-09 14:17:49 UTC (rev 74070)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# core repo
+DIR=grass-fetch
+mkdir $DIR ; cd $DIR
+git svn init --stdlayout https://svn.osgeo.org/grass/grass
+git svn --authors-file=../AUTHORS.txt fetch
+
+# addons repo
+DIR=grass-addons-fetch
+mkdir $DIR ; cd $DIR
+git svn init https://svn.osgeo.org/grass/grass-addons
+git svn --authors-file=../AUTHORS.txt fetch
+
+# promo
+DIR=grass-promo-fetch
+mkdir $DIR ; cd $DIR
+git svn init https://svn.osgeo.org/grass/grass-addons
+git svn --authors-file=../AUTHORS.txt fetch
Property changes on: grass-addons/tools/svn2git/0-migrate-fetch.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: grass-addons/tools/svn2git/1-migrate-branches-tags.sh
===================================================================
--- grass-addons/tools/svn2git/1-migrate-branches-tags.sh (rev 0)
+++ grass-addons/tools/svn2git/1-migrate-branches-tags.sh 2019-02-09 14:17:49 UTC (rev 74070)
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# TO BE SET
+DIR=grass
+### DIR=grass-legacy
+
+rm -rf $DIR
+cp -r grass-fetch $DIR
+cd $DIR
+
+# Create local branches
+if [ $DIR = "grass" ] ; then
+ branch_filter="releasebranch_7"
+else
+ branch_filter="releasebranch_[0-6]"
+fi
+for branch in `git branch -r | grep $branch_filter | sed 's# origin/##g'`; do
+ git branch $branch origin/$branch
+done
+if [ $DIR = "grass" ] ; then
+ git branch master origin/trunk
+ git checkout master
+fi
+
+# Rename tags
+if [ $DIR = "grass" ] ; then
+ tag_filter="grass_7"
+else
+ tag_filter="grass_[0-6]"
+fi
+for i in `git branch -r | grep tags | grep $tag_filter`; do
+ b=`echo $i | sed 's#origin/##'`
+ if [ `echo $i | grep -c release` -gt 0 ] ; then
+ j=`echo $i | sed 's#origin/tags/release_[0-9]\+_##g'`
+ else
+ j=`echo $i | sed 's#origin/tags/##g'`
+ fi
+ git branch $b $i
+ d=`git log -1 --format=%cd --date=iso $b`
+ h=`git log -1 --format=%h --date=iso $b`
+ GIT_COMMITTER_DATE="$d" git tag -a $j -m "Tagging release $j" $h
+done
+
+if [ $DIR = "grass" ] ; then
+ git checkout master
+fi
+for i in `git branch | grep tags`; do
+ git branch -D $i
+done
+
+# Remove remote branches
+for i in `git branch -r | grep origin`; do git branch -dr $i; done
+
+# Fix commit messages (#x -> https://trac.osgeo.org/...)
+git reset --hard HEAD && git checkout master
+#SCRIPT=`realpath $0` # realpath is a separate package and doesn't need to be installed
+#SCRIPTPATH=`dirname $SCRIPT`
+#git filter-branch --msg-filter "python $SCRIPTPATH/../rewrite.py" -- --all
+# check out /tmp/log_touched.txt and /tmp/log_untoched.txt for changes overview ...
Property changes on: grass-addons/tools/svn2git/1-migrate-branches-tags.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Deleted: grass-addons/tools/svn2git/migrate.sh
===================================================================
--- grass-addons/tools/svn2git/migrate.sh 2019-02-09 11:44:55 UTC (rev 74069)
+++ grass-addons/tools/svn2git/migrate.sh 2019-02-09 14:17:49 UTC (rev 74070)
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-# Initialize git repo (preferably use AUTHORS.txt from SVN)
-
-mkdir grass-gis-git
-cd grass-gis-git
-git svn init --stdlayout https://svn.osgeo.org/grass/grass # --no-metadata
-git svn --authors-file=../AUTHORS.txt fetch
-
-# Create local branches
-# git branch develbranch_6 origin/develbranch_6
-for branch in `git branch -r | grep releasebranch | sed 's# origin/##g'`; do
- git branch $branch origin/$branch
-done
-# git checkout develbranch_6
-git branch -D master
-git branch master origin/trunk
-git checkout master
-
-# Rename tags
-for i in `git branch -r | grep tags`; do
- b=`echo $i | sed 's#origin/##'`
- if [ `echo $i | grep -c release` -gt 0 ] ; then
- j=`echo $i | sed 's#origin/tags/release_[0-9]\+_##g'`
- else
- j=`echo $i | sed 's#origin/tags/##g'`
- fi
- git branch $b $i
- d=`git log -1 --format=%cd --date=iso $b`
- h=`git log -1 --format=%h --date=iso $b`
- GIT_COMMITTER_DATE="$d" git tag -a $j -m "Tagging release $j" $h
-done
-git checkout master
-for i in `git branch | grep tags`; do
- git branch -D $i
-done
-
-# Remove remote branches
-for i in `git branch -r | grep origin`; do git branch -dr $i; done
-
-# Fix commit messages (#x -> https://trac.osgeo.org/...)
-git reset --hard HEAD && git checkout master
-SCRIPT=`realpath $0` # realpath is a separate package and doesn't need to be installed
-SCRIPTPATH=`dirname $SCRIPT`
-git filter-branch --msg-filter "python $SCRIPTPATH/../rewrite.py" -- --all
-# check out /tmp/log_touched.txt and /tmp/log_untoched.txt for changes overview ...
More information about the grass-commit
mailing list