summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-10-08 11:41:14 +0100
committerTom Hacohen <tom@stosb.com>2013-10-08 11:41:14 +0100
commit78f45364b166606c69eedcf7949c30eb11aa6b5c (patch)
treeb4b26e498f073284ec50f133d06ff03fec13fb43
parentc021f97d867dea6679ae63bf147048985694a827 (diff)
Updated READE and removed the update file.
-rw-r--r--README98
-rw-r--r--update51
2 files changed, 87 insertions, 62 deletions
diff --git a/README b/README
index 90f2a9a..3eb18c6 100644
--- a/README
+++ b/README
@@ -1,9 +1,23 @@
1This document includes 3 sections.
21. Migrating a repo, for the initial migration process.
32. Moving things around the repo (if things were moved around your repo).
43. Updating an already migrated repo, if you svn repo has been updated and you'd like to sync git with it.
5
6############### Migrating a repo #######################
7
1If you want to migrate a repository to Git: 8If you want to migrate a repository to Git:
2 9
3* Adjust DEVS_PATH in rename_authors.sh and rename_authors_manual.sh to your setup 10* Adjust DEVS_PATH in rename_authors.sh and rename_authors_manual.sh to your setup
4 11
5* Check out the project - make sure you are checking out the root dir 12* Check out the project - make sure you are checking out the root dir
6> git svn clone --use-log-author http://svn.enlightenment.org/svn/e/trunk/PROTO/project tmp 13> git svn clone --use-log-author http://svn.enlightenment.org/svn/e/trunk/PROTO/project project
14
15* In the git repo directory:
16
17* Optional: Move things around the repo (see "Moving things around" section) - look inside the section for explanation on how to check.
18
19* Optional (2): Limit the repo to a subdirectory of interest
20git filter-branch --prune-empty -f --subdirectory-filter some/subdirectory
7 21
8* Transform the authors 22* Transform the authors
9> git filter-branch -f --env-filter 'eval $(/path/to/migration/rename_authors.sh)' HEAD 23> git filter-branch -f --env-filter 'eval $(/path/to/migration/rename_authors.sh)' HEAD
@@ -29,16 +43,78 @@ If you want to migrate a repository to Git:
29* Push to Git 43* Push to Git
30> git push origin master 44> git push origin master
31 45
46####### Optional: Moving things around #####################
47
48This section is for you if you have a directory that has been moved around a repo and you'd like to keep all of it's history.
49
50* Find all the location of a directory.
511. Choose a file that you think is unique to the directory (not the directory itself!), e.g configure.ac.
522. Run:
53> git log --follow --name-only -- path/to/current/configure.ac
543. Scroll down to the end to make sure the last commit actually introduced that directory (first commit).
554. Run:
56> git log --name-only --format=format: --follow trunk/expedite/configure.ac | sort | uniq
575. Filter the last output manually to make sure it only includes your project and didn't pick up similar directories.
58
59* Write a script similar to filter_branch_scripts/filter-branch-e.sh, copying everything to "newroot".
60
61* Optional but recommended: Mount /tmp/ram on ram or other fast media, and mkdir a "filter" directory there.
62> sudo mount ramfs -t ramfs /tmp/ram
63> mkdir /tmp/ram/filter
32 64
33######################################################################## 65* Run the script you created to move things to newroot.
34If you are migrating a project that has been moved around a lot, you should 66> git filter-branch -f -d /tmp/ram/filter --prune-empty --tree-filter "$(pwd)/filter_branch_scripts/filter-branch-YOUR-SCRIPT.sh HEAD
35track all of it's history. The way to check if a project has been moved around
36is to run:
37git log --name-only --format=format: --follow trunk/expedite/configure.ac | sort | uniq
38 67
39Switch configure.ac with any file that you think is unique to this project but that has been there from the start. You can also just run: 68* At this point you might need to reset the state of the repo:
40git log --follow 69> git reset --hard HEAD.
41and go to the bottom to verify that commit was really the commit that got this
42component into the repos.
43 70
44After that you need to run some other scripts in this repo, more on that in the future. 71* Filter the repo to include only the new root
72> git filter-branch --prune-empty -f --subdirectory-filter newroot
73
74########## Updating a migrated repo #########################
75
76* Check the latest SVN rev imported and clone the branch/trunk from there:
77> git svn clone -r 83370:HEAD --use-log-author http://svn.enlightenment.org/svn/e/trunk/efl/ efl-trunk-update
78
79# Until mentioned otherwise, the rest is the same as migrating:
80
81* Transform the authors
82> git filter-branch -f --env-filter 'eval $(/full/path/here/rename_authors.sh)' HEAD
83
84* Attribute Patch by:
85> git filter-branch -f --env-filter 'eval $(/full/path/here/rename_patch_by.sh)' HEAD
86
87* Check if there are any anomalies (picked up through incorrect use of Signed-off-by or From lines)
88> git shortlog -n -s -e
89
90* Add those authors + email to the manual-reset-author file and reset these
91> git filter-branch -f --env-filter 'eval $(/full/path/here/rename_authors_manual.sh)' HEAD
92
93* Verify all authors check out okay
94> git shortlog -n -s -e
95
96* Beautify the SVN revisions in the log
97> git filter-branch -f --msg-filter 'sed -e "s/git-svn-id: [^@]*@\([0-9]*\) .*/SVN revision: \1/"' HEAD
98
99# Here comes the interesting part.
100
101* Add the master repo as a remote and fetch
102> git remote add origin ssh://git@git.enlightenment.org/core/efl.git
103> git fetch origin
104
105* Find the git revisions that are links (origin/master and one very early commit in master) and reestablish correct ancestory
106> gitk master origin/master
107> echo commit parent > .git/info/grafts
108> gitk master origin/master
109
110* Make sure you like the result, otherwise modify things as needed.
111
112* Make the graft permanent
113> git filter-branch --prune-empty -f origin/master..HEAD
114> rm .git/info/grafts
115
116* Make sure everything is correct.
117> gitk master
118
119* Push to origin (disabling mailhook and etc. if you have them, first)
120> git push origin master
diff --git a/update b/update
deleted file mode 100644
index ee29fe0..0000000
--- a/update
+++ /dev/null
@@ -1,51 +0,0 @@
1* Check cgit repo owner display
2* Commit mails:
3 One mail per commit
4 Subject format: [EGIT] [repo] Commitmsg (Author)
5
6Per project
7-----------
8
9On the day:
10* Delete/lock the dir in SVN
11* Update master, branches and tags
12* Verify/change tag owners
13* Check/add phabricator integration
14
15Updating a project:
16* Check the latest SVN rev imported and clone the branch/trunk from there:
17> git svn clone -r 83370:HEAD --use-log-author http://svn.enlightenment.org/svn/e/trunk/efl/ efl-trunk
18
19* Transform the authors
20> git filter-branch -f --env-filter 'eval $(/full/path/here/rename_authors.sh)' HEAD
21
22* Attribute Patch by:
23> git filter-branch -f --env-filter 'eval $(/full/path/here/rename_patch_by.sh)' HEAD
24
25* Check if there are any anomalies (picked up through incorrect use of Signed-off-by or From lines)
26> git shortlog -n -s -e
27
28* Add those authors + email to the manual-reset-author file and reset these
29> git filter-branch -f --env-filter 'eval $(/full/path/here/rename_authors_manual.sh)' HEAD
30
31* Verify all authors check out okay
32> git shortlog -n -s -e
33
34* Beautify the SVN revisions in the log
35> git filter-branch -f --msg-filter 'sed -e "s/git-svn-id: [^@]*@\([0-9]*\) .*/SVN revision: \1/"' HEAD
36
37* Add the master repo as a remote and fetch
38> git remote add origin ssh://git@git.enlightenment.org/core/efl.git
39> git fetch origin
40
41* Find the git revisions that are links (origin/master and one very early commit in master) and reestablish correct ancestory
42> gitk master origin/master
43> echo commit parent .git/info/grafts
44> gitk master origin/master
45
46* Make the graft permanent
47> git filter-branch --prune-empty -f origin/master..HEAD
48> rm .git/info/grafts
49
50* Push to origin - disabling mailhook first
51> git push origin master