Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-fufem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
agnumpde
dune-fufem
Commits
164f2f1a
Commit
164f2f1a
authored
10 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
Document subversion->git migration process
parent
68a1b688
No related branches found
Branches containing commit
Tags
subversion->git
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
convert-to-git.bash
+232
-0
232 additions, 0 deletions
convert-to-git.bash
with
232 additions
and
0 deletions
convert-to-git.bash
0 → 100644
+
232
−
0
View file @
164f2f1a
#!/usr/bin/env bash
GIT_CLEANUP
=
$PWD
/git-cleanup.bash
GIT_CONVERT
=
$PWD
/convert-to-git.bash
if
!
[[
-f
${
GIT_CONVERT
}
]]
;
then
cat
<<
EOF
error: This script expects to be called convert-to-git.bash and reside in the
directory in which it is executed.
EOF
exit
-1
fi
clone
()
{
git svn clone
--stdlayout
\
https://svn.imp.fu-berlin.de/agnumpde/software/dune-modules/
$1
}
handle_gitignore_and_filter
()
{
git svn show-ignore
>
.gitignore
git add .gitignore
git commit
-m
'Convert svn:ignore properties to .gitignore.'
git filter-branch
-f
\
--msg-filter
'
sed -e "/^\$/{ :l; N; s/^\n\$//; t l; p; d; }" | \
sed -e "/^git-svn-id:/s/.*@\([^ ]*\) .*$/[[Imported from SVN: r\1]]/"'
\
--commit-filter
".
${
GIT_CLEANUP
}
;"
\
HEAD
}
create_release_branch
()
{
git checkout
-b
releases/
$1
$2
}
create_git_cleanup
()
{
cat
>
${
GIT_CLEANUP
}
<<
'
EOF
'
#!/usr/bin/env bash
case
$GIT_AUTHOR_NAME
in
akbib*|youett*)
GIT_AUTHOR_NAME="Jonathan Youett"
GIT_AUTHOR_EMAIL=youett@mi.fu-berlin.de
;;
ansgar)
GIT_AUTHOR_NAME="Ansgar Burchardt"
GIT_AUTHOR_EMAIL=burchardt@igpm.rwth-aachen.de
;;
forster*)
GIT_AUTHOR_NAME="Ralf Forster"
GIT_AUTHOR_EMAIL=forster@math.fu-berlin.de
;;
graeser*)
GIT_AUTHOR_NAME="Carsten Gräser"
GIT_AUTHOR_EMAIL=graeser@mi.fu-berlin.de
;;
lschmidt*|oel*)
GIT_AUTHOR_NAME="Leo Schmidt"
GIT_AUTHOR_EMAIL=lschmidt@math.fu-berlin.de
;;
klapprot*)
GIT_AUTHOR_NAME="Corinna Klapproth"
GIT_AUTHOR_EMAIL=klapproth@zib.de
;;
mawolf*)
GIT_AUTHOR_NAME="Maren-Wanda Wolf"
GIT_AUTHOR_EMAIL=mawolf@math.fu-berlin.de
;;
maxka)
GIT_AUTHOR_NAME="Max Kahnt"
GIT_AUTHOR_EMAIL=max.kahnt@fu-berlin.de
;;
pipping*)
GIT_AUTHOR_NAME="Elias Pipping"
GIT_AUTHOR_EMAIL=elias.pipping@fu-berlin.de
;;
podlesjo)
GIT_AUTHOR_NAME="Joscha Podlesny"
GIT_AUTHOR_EMAIL=joscha.py@googlemail.com
;;
sander*)
GIT_AUTHOR_NAME="Oliver Sander"
GIT_AUTHOR_EMAIL=sander@igpm.rwth-aachen.de
;;
sertel)
GIT_AUTHOR_NAME="Susanne Ertel"
GIT_AUTHOR_EMAIL=ertel@zib.de
;;
usack*)
GIT_AUTHOR_NAME="Uli Sack"
GIT_AUTHOR_EMAIL=usack@math.fu-berlin.de
;;
esac
git commit-tree "
$@
"
EOF
}
save_script_and_create_tag
()
{
cp
${
GIT_CONVERT
}
.
git add convert-to-git.bash
git commit
-m
'Document subversion->git migration process'
git tag
-a
\
-m
"Subversion->Git migration completed. Master rev:
$@
"
\
'subversion->git'
}
### Check out and clean up repositories
create_git_cleanup
clone dune-fufem
(
cd
dune-fufem
master_rev
=
$(
git svn find-rev HEAD
)
create_release_branch 2.0-1 2.0.0-1
;
handle_gitignore_and_filter
;
# Rename
create_release_branch 2.1-1 2.1-1
;
handle_gitignore_and_filter
;
create_release_branch 2.2-1 2.2-1
;
handle_gitignore_and_filter
;
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
clone dune-solvers
(
cd
dune-solvers
master_rev
=
$(
git svn find-rev HEAD
)
create_release_branch 2.0-1 2.0.0-1
;
handle_gitignore_and_filter
;
# Rename
create_release_branch 2.1-1 2.1-1
;
handle_gitignore_and_filter
;
create_release_branch 2.2-1 2.2-1
;
handle_gitignore_and_filter
;
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
clone dune-tnnmg
(
cd
dune-tnnmg
master_rev
=
$(
git svn find-rev HEAD
)
create_release_branch 2.0-1 2.0.0-1
;
handle_gitignore_and_filter
;
# Rename
create_release_branch 2.1-1 2.1-1
;
handle_gitignore_and_filter
;
create_release_branch 2.2-1 2.2-1
;
handle_gitignore_and_filter
;
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
clone dune-biomech
(
cd
dune-biomech
master_rev
=
$(
git svn find-rev HEAD
)
create_release_branch 2.0-1 2.0-1
;
handle_gitignore_and_filter
;
create_release_branch 2.1-1 2.1-1
;
handle_gitignore_and_filter
;
create_release_branch 2.2-1 2.2
;
handle_gitignore_and_filter
;
# Rename
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
clone dune-contact
(
cd
dune-contact
master_rev
=
$(
git svn find-rev HEAD
)
create_release_branch 2.0-1 2.0-1
;
handle_gitignore_and_filter
;
create_release_branch 2.1-1 2.1
;
handle_gitignore_and_filter
;
# Rename
create_release_branch 2.2-1 2.2
;
handle_gitignore_and_filter
;
# Rename
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
clone dune-contact-timeint
(
cd
dune-contact-timeint
master_rev
=
$(
git svn find-rev HEAD
)
create_release_branch 2.0-1 2.0-1
;
handle_gitignore_and_filter
;
create_release_branch 2.1-1 2.1-1
;
handle_gitignore_and_filter
;
create_release_branch 2.2-1 2.2
;
handle_gitignore_and_filter
;
# Rename
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
clone dune-elasticity
(
cd
dune-elasticity
master_rev
=
$(
git svn find-rev HEAD
)
create_release_branch 2.0-1 2.0-1
;
handle_gitignore_and_filter
;
create_release_branch 2.1-1 2.1-1
;
handle_gitignore_and_filter
;
create_release_branch 2.2-1 2.2
;
handle_gitignore_and_filter
;
# Rename
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
clone dune-schur-newton
(
cd
dune-schur-newton
master_rev
=
$(
git svn find-rev HEAD
)
git checkout master
;
handle_gitignore_and_filter
;
save_script_and_create_tag
${
master_rev
}
)
rm
-f
${
GIT_CLEANUP
}
## Debugging section
#
# Use the following scripts to check if the conversion went according to plan
#
# (1) To generate a list of authors
#
# !/usr/bin/env bash
#
# for i in dune-*; do
# (
# cd $i;
# git log --format=tformat:'%an <%ae>';
# );
# done | perl -e '
# use 5.018;
# my %a;
# while (<>) {
# chomp; $a{$_}++;
# };
# while (each %a) {
# printf "%d\t%s\n", $a{$_}, $_;
# }
# ' | sort -n
#
# (2) To generate a list of converted branches
#
# !/usr/bin/env bash
#
# for i in dune-*; do
# (
# cd $i;
# echo $i;
# git for-each-ref --format=' %(refname)' refs/heads;
# );
# done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment