Sign in Join
Wiki copytemporary

Git Conversion Lazarus: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11This page has the detailed steps used to convert the Lazarus SVN repro to git.
22
33# SubGIT
44
55The initial conversion will be done using TMate Subgit.
66
77## Install
88
99Unpack subgit to
1010
11-`   ~/subgit/subgit-3.3.11`
11+```text
12+ ~/subgit/subgit-3.3.11
13+```
1214
1315## Required
1416
1517An author.txt file
1618
17-` svn-name - git-name <email>`
19+```text
20+ svn-name - git-name <email>
21+```
1822
1923## Run / main repro
2024
21-`   cd ~/subgit/subgit-3.3.11`\
22-`   ./bin/subgit configure `[`https://svn.freepascal.org/svn/lazarus`](https://svn.freepascal.org/svn/lazarus)` laz.git`\
23-`   `\
24-`   gedit laz.git/subgit/config `
25+```text
26+ cd ~/subgit/subgit-3.3.11
27+ ./bin/subgit configure https://svn.freepascal.org/svn/lazarus laz.git
28+
29+ gedit laz.git/subgit/config
30+```
2531
2632And add the following (the first line, replaces an existing setting)
2733
28-`   [svn]`\
29-`     trunk = trunk:refs/heads/main`\
30-`     gitCommitMessage = %message\\n\\ngit-svn-id: %branch@%revision -\\n`\
31-`     `\
32-`   [translate]  `\
33-`     eols = false`\
34-`     otherProperties = false`\
35-`     ignores = false`
34+```text
35+ [svn]
36+ trunk = trunk:refs/heads/main
37+ gitCommitMessage = %message\\n\\ngit-svn-id: %branch@%revision -\\n
38+
39+ [translate]
40+ eols = false
41+ otherProperties = false
42+ ignores = false
43+```
3644
3745The translate options prevent .gitignore and .gitattributes. Those can be translated, but will later be replaced...
3846
39-`   cp authors.txt laz.git/subgit/authors.txt`
47+```text
48+ cp authors.txt laz.git/subgit/authors.txt
49+```
4050
41-`   ./bin/subgit install laz.git`
51+```text
52+ ./bin/subgit install laz.git
53+```
4254
4355Without skipping the gitignore/gitattributes, there will be an error at revision 47330. The process will hang. nterrupt it and edit
4456
45-`   gedit lazarus.git/svn/.metadata`
57+```text
58+ gedit lazarus.git/svn/.metadata
59+```
4660
4761and set branches-maxRev and tags-maxRev to 47332 (it should be at 47330) <https://stackoverflow.com/questions/18918215/skip-revisions-when-installing-subgit-repository> Continue with
4862
49-`   ./bin/subgit install laz-bin.git`
63+```text
64+ ./bin/subgit install laz-bin.git
65+```
5066
5167Stop the daemon
5268
53-`   ./bin/subgit shutdown laz-bin.git/`
69+```text
70+ ./bin/subgit shutdown laz-bin.git/
71+```
5472
5573## Run / binaries repro
5674
57-`   ./bin/subgit configure `[`https://svn.freepascal.org/svn/lazarus`](https://svn.freepascal.org/svn/lazarus)`  laz-bin.git`
75+```text
76+ ./bin/subgit configure https://svn.freepascal.org/svn/lazarus laz-bin.git
77+```
5878
59-`   gedit laz-bin.git/subgit/config `\
60-`     [svn]`\
61-`     gitCommitMessage = %message\\n\\ngit-svn-id: %branch@%revision -\\n`\
62-`     trunk = binaries:refs/heads/main`
79+```text
80+ gedit laz-bin.git/subgit/config
81+ [svn]
82+ gitCommitMessage = %message\\n\\ngit-svn-id: %branch@%revision -\\n
83+ trunk = binaries:refs/heads/main
84+```
6385
64-`     cp authors.txt laz-bin.git/subgit/authors.txt`
86+```text
87+ cp authors.txt laz-bin.git/subgit/authors.txt
88+```
6589
6690follow the steps above
6791
6892## Run / website repro
6993
70-`   ./bin/subgit configure `[`https://svn.freepascal.org/svn/lazaruswebsite`](https://svn.freepascal.org/svn/lazaruswebsite)` laz-web.git`
94+```text
95+ ./bin/subgit configure https://svn.freepascal.org/svn/lazaruswebsite laz-web.git
96+```
7197
72-`   gedit laz-web.git/subgit/config `\
73-`     [svn]`\
74-`     gitCommitMessage = %message\\n\\ngit-svn-id: %branch@%revision -\\n`\
75-`     trunk = trunk:refs/heads/main`
98+```text
99+ gedit laz-web.git/subgit/config
100+ [svn]
101+ gitCommitMessage = %message\\n\\ngit-svn-id: %branch@%revision -\\n
102+ trunk = trunk:refs/heads/main
103+```
76104
77-`     cp authors.txt laz-web.git/subgit/authors.txt`
105+```text
106+ cp authors.txt laz-web.git/subgit/authors.txt
107+```
78108
79109follow the steps above
80110
81111# Part 2
82112
83113- Updating gitignore
84114- Prefixing all issue references with \#
85115- translating svn revisions to git hashes
86116
87117## Set a git user
88118
89-`   git config --local user.email "lazarus@lazarus-ide.org"`\
90-`   git config --local user.name "lazarus"`
119+```text
120+ git config --local user.email "lazarus@lazarus-ide.org"
121+ git config --local user.name "lazarus"
122+```
91123
92124## Clean out left overs from subgit
93125
94-`   git for-each-ref --format="%(refname)" refs/svn/ | xargs -n 1 git update-ref -d`
126+```text
127+ git for-each-ref --format="%(refname)" refs/svn/ | xargs -n 1 git update-ref -d
128+```
95129
96130## Clean left overs from binaries
97131
98132There are a few tags, that lead to binaries (gdb.exe) ending up in the data
99133
100-`  git tag -d binaries_0_9_26`\
101-`  git tag -d binaries_0_9_26_2`\
102-`  git tag -d binaries_0_9_28`\
103-`  git tag -d binaries_0_9_30`\
104-`  git tag -d binaries_0_9_30_2`\
105-`  git tag -d binaries_0_9_30_2RC1`\
106-`  git tag -d binaries_1_0`
134+```text
135+ git tag -d binaries_0_9_26
136+ git tag -d binaries_0_9_26_2
137+ git tag -d binaries_0_9_28
138+ git tag -d binaries_0_9_30
139+ git tag -d binaries_0_9_30_2
140+ git tag -d binaries_0_9_30_2RC1
141+ git tag -d binaries_1_0
142+```
107143
108144## Updating gitignore/gitattributes / Prefix issues with \#
109145
110146The below combines the 2 steps. It can be run in 2 separate calls.
111147
112148It will run for about one hour.
113149
114-`   FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --index-filter '  cp ~/subgit/subgit-3.3.11/.gitignore  ~/subgit/subgit-3.3.11/.gitattributes . ; git add .gitignore .gitattributes '  --msg-filter ' perl -ne "while (s/((?:iss?ues?|[ (](?:bugs?|mantis|fix|fixes|patch)\b)(?: +id)?[ :]+(?:#?0*[1-9][0-9]{2,4}(?: *(?:[ ,]| and ) *))*)(0*[1-9][0-9]{2,4})\b/\1#\2/i) {}; print" ' -f  -- --all`
150+```text
151+ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --index-filter ' cp ~/subgit/subgit-3.3.11/.gitignore ~/subgit/subgit-3.3.11/.gitattributes . ; git add .gitignore .gitattributes ' --msg-filter ' perl -ne "while (s/((?:iss?ues?|[ (](?:bugs?|mantis|fix|fixes|patch)\b)(?: +id)?[ :]+(?:#?0*[1-9][0-9]{2,4}(?: *(?:[ ,]| and ) *))*)(0*[1-9][0-9]{2,4})\b/\1#\2/i) {}; print" ' -f -- --all
152+```
115153
116-`   FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch  --msg-filter ' perl -ne "while (s/((?:iss?ues?|[ (](?:bugs?|mantis|fix|fixes|patch)\b)(?: +id)?[ :]+(?:#?0*[1-9][0-9]{2,4}(?: *(?:[ ,]| and ) *))*)(0*[1-9][0-9]{2,4})\b/\1#\2/i) {}; print" ' -f  -- --all`
154+```text
155+ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter ' perl -ne "while (s/((?:iss?ues?|[ (](?:bugs?|mantis|fix|fixes|patch)\b)(?: +id)?[ :]+(?:#?0*[1-9][0-9]{2,4}(?: *(?:[ ,]| and ) *))*)(0*[1-9][0-9]{2,4})\b/\1#\2/i) {}; print" ' -f -- --all
156+```
117157
118158Cleanup
119159
120-`   git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d`\
121-`   git reflog expire --expire=now --all ;git gc --prune=now`
160+```text
161+ git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
162+ git reflog expire --expire=now --all ;git gc --prune=now
163+```
122164
123165## Translating references to svn rev (r12345) to \#hash
124166
125167This must be the very last filter-branch. As each filter-branch creates new hashes for the commits, and that would invalidate the hash refs created here.
126168
127169- The first batch will update only commits it branch main.
128170
129171
130172This will also only be references to other commits in main.
131173
132174Merges from branches to main can not be updated.
133175
134176- The 2nd batch will update only commits in branches. This means the hashes for the main branch will be left intact.
135177
136178
137179This will update merges from main to fixes
138180
139181To verify the 2nd batch does not update the main branch compare the hash for **git log -n1 main**. It should not be changed by the 2nd batch.
140182
141-`   rm -rf /tmp/rmap`\
142-`   mkdir /tmp/rmap`\
143-`   git rev-list  main | xargs -L1 /bin/sh -c 'a=$( git log -n1 --pretty='%B' $0 | grep "git-svn-id: .*@[0-9][0-9]* "  | sed "s/.*@`$`[0-9]*`$` .*/\1/" ) ; echo $0 > /tmp/rmap/$a'`\
144-`   git rev-list  main | xargs -L1 /bin/sh -c 'echo 1 > /tmp/rmap/m_$0'`
183+```text
184+ rm -rf /tmp/rmap
185+ mkdir /tmp/rmap
186+ git rev-list main | xargs -L1 /bin/sh -c 'a=$( git log -n1 --pretty='%B' $0 | grep "git-svn-id: .*@[0-9][0-9]* " | sed "s/.*@\([0-9]*\) .*/\1/" ) ; echo $0 > /tmp/rmap/$a'
187+ git rev-list main | xargs -L1 /bin/sh -c 'echo 1 > /tmp/rmap/m_$0'
188+```
145189
146-`   FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter 'perl -wne "use strict; `\
147-`   unless ( -e qq#/tmp/rmap/m_\$ENV{GIT_COMMIT}# ) { print;  next; }`\
148-`   my %f;  foreach(/(?:(?:commit|rev|revisions?|revision`$`s`$`|revert|reverted) +| r)([1-9][0-9]{3,4}\b(?:[\/,-] *[1-9][0-9]{3,4}\b)*)\b/gi) {`\
149-`     my \$rvl=\$1;    `\
150-`     foreach my \$a (split / *[\/,] */, \$rvl) {`\
151-`     unless (\$f{\$a}){`\
152-`       \$f{\$a}=q/#/;`\
153-`       my(\$a1, \$a2) = split / *- */, \$a;`\
154-`       my \$c; my \$rh; if( open \$rh, q/</, qq#/tmp/rmap/\$a1#) { \$c=<\$rh>;   chomp \$c; }`\
155-`       my \$h; if(\$c && (open \$h, q/</, qq#../map/\$c#)) {     `\
156-`          \$c=<\$h>;   chomp \$c;  \$c = q/#/.substr \$c, 0,10; `\
157-`         if (\$a2) {`\
158-`           my \$c2; my \$rh2; if( open \$rh2, q/</, qq#/tmp/rmap/\$a1#) { \$c2=<\$rh2>;   chomp \$c2; }`\
159-`           my \$h; if(\$c2 && (open \$h, q/</, qq#../map/\$c2#)) {       \$c2=<\$h>;   chomp \$c2;        `\
160-`           \$c = \$c.q/-#/.substr( \$c2, 0,10); `\
161-`           }`\
162-`           else { \$c = \$c.q/..# / unless \$c eq q/#/;  warn q/MAP2 FAIL /.\$c2 }`\
163-`         }`\
164-`         \$f{\$a}=\$c;`\
165-`       }`\
166-`       else {warn q/MAP1 fail/.\$a;}`\
167-`     }} `\
168-`   }  `\
169-`   foreach my \$k (keys %f) {   my \$v = \$f{\$k};`\
170-`     unless (\$v eq q/#/) {     s/([ r,\/]\${k}\b)/\$1 \$v/g;   }`\
171-`   }   `\
172-`   warn \$_ if keys %f;`\
173-`   print; "`\
174-`   ' -f -- --all`
190+```text
191+ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter 'perl -wne "use strict;
192+ unless ( -e qq#/tmp/rmap/m_\$ENV{GIT_COMMIT}# ) { print; next; }
193+ my %f; foreach(/(?:(?:commit|rev|revisions?|revision\(s\)|revert|reverted) +| r)([1-9][0-9]{3,4}\b(?:[\/,-] *[1-9][0-9]{3,4}\b)*)\b/gi) {
194+ my \$rvl=\$1;
195+ foreach my \$a (split / *[\/,] */, \$rvl) {
196+ unless (\$f{\$a}){
197+ \$f{\$a}=q/#/;
198+ my(\$a1, \$a2) = split / *- */, \$a;
199+ my \$c; my \$rh; if( open \$rh, q/</, qq#/tmp/rmap/\$a1#) { \$c=<\$rh>; chomp \$c; }
200+ my \$h; if(\$c && (open \$h, q/</, qq#../map/\$c#)) {
201+ \$c=<\$h>; chomp \$c; \$c = q/#/.substr \$c, 0,10;
202+ if (\$a2) {
203+ my \$c2; my \$rh2; if( open \$rh2, q/</, qq#/tmp/rmap/\$a1#) { \$c2=<\$rh2>; chomp \$c2; }
204+ my \$h; if(\$c2 && (open \$h, q/</, qq#../map/\$c2#)) { \$c2=<\$h>; chomp \$c2;
205+ \$c = \$c.q/-#/.substr( \$c2, 0,10);
206+ }
207+ else { \$c = \$c.q/..# / unless \$c eq q/#/; warn q/MAP2 FAIL /.\$c2 }
208+ }
209+ \$f{\$a}=\$c;
210+ }
211+ else {warn q/MAP1 fail/.\$a;}
212+ }}
213+ }
214+ foreach my \$k (keys %f) { my \$v = \$f{\$k};
215+ unless (\$v eq q/#/) { s/([ r,\/]\${k}\b)/\$1 \$v/g; }
216+ }
217+ warn \$_ if keys %f;
218+ print; "
219+ ' -f -- --all
220+```
175221
176-`   git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d`
222+```text
223+ git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
224+```
177225
178-`   rm -rf /tmp/rmap`\
179-`   mkdir /tmp/rmap`\
180-`   git rev-list  --all | xargs -L1 /bin/sh -c 'a=$( git log -n1 --pretty='%B' $0 | grep "git-svn-id: .*@[0-9][0-9]* "  | sed "s/.*@`$`[0-9]*`$` .*/\1/" ) ; echo $0 > /tmp/rmap/$a'`\
181-`   git rev-list  main | xargs -L1 /bin/sh -c 'echo 1 > /tmp/rmap/m_$0'`
226+```text
227+ rm -rf /tmp/rmap
228+ mkdir /tmp/rmap
229+ git rev-list --all | xargs -L1 /bin/sh -c 'a=$( git log -n1 --pretty='%B' $0 | grep "git-svn-id: .*@[0-9][0-9]* " | sed "s/.*@\([0-9]*\) .*/\1/" ) ; echo $0 > /tmp/rmap/$a'
230+ git rev-list main | xargs -L1 /bin/sh -c 'echo 1 > /tmp/rmap/m_$0'
231+```
182232
183-`   FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter 'perl -wne "use strict; `\
184-`   if ( -e qq#/tmp/rmap/m_\$ENV{GIT_COMMIT}# ) { print;  next; }`\
185-`   my %f;  foreach(/(?:(?:commit|rev|revisions?|revision`$`s`$`|revert|reverted) +| r)([1-9][0-9]{3,4}\b(?:[\/,-] *[1-9][0-9]{3,4}\b)*)\b/gi) {`\
186-`     my \$rvl=\$1;    `\
187-`     foreach my \$a (split / *[\/,] */, \$rvl) {`\
188-`     unless (\$f{\$a}){`\
189-`       \$f{\$a}=q/#/;`\
190-`       my(\$a1, \$a2) = split / *- */, \$a;`\
191-`       my \$c; my \$rh; if( open \$rh, q/</, qq#/tmp/rmap/\$a1#) { \$c=<\$rh>;   chomp \$c; }`\
192-`       if (\$c) {  unless ( -e qq#/tmp/rmap/m_\$c# ) { `\
193-`          my \$h; if(open \$h, q/</, qq#../map/\$c#) {   \$c=<\$h>;   chomp \$c; }`\
194-`       }}`\
195-`       if(\$c ) {`\
196-`          \$c = q/#/.substr \$c, 0,10; `\
197-`         if (\$a2) {`\
198-`           my \$c2; my \$rh2; if( open \$rh2, q/</, qq#/tmp/rmap/\$a1#) { \$c2=<\$rh2>;   chomp \$c2; }`\
199-`           if (\$c2) { unless ( -e qq#/tmp/rmap/m_\$c2# ) { `\
200-`              my \$h; if(open \$h, q/</, qq#../map/\$c2#) {   \$c2=<\$h>;   chomp \$c2; }`\
201-`           }}`\
202-`           if(\$c2) {   \$c = \$c.q/-#/.substr( \$c2, 0,10);     }`\
203-`           else { \$c = \$c.q/..# / unless \$c eq q/#/;  warn q/MAP2 FAIL /.\$c2 }`\
204-`         }`\
205-`         \$f{\$a}=\$c;`\
206-`       }`\
207-`       else {warn q/MAP1 fail/.\$a;}`\
208-`     }} `\
209-`   }  `\
210-`   foreach my \$k (keys %f) {   my \$v = \$f{\$k};`\
211-`     unless (\$v eq q/#/) {     s/([ r,\/]\${k}\b)/\$1 \$v/g;   }`\
212-`   }   `\
213-`   warn \$_ if keys %f;`\
214-`   print; "`\
215-`   ' -f -- --all`
233+```text
234+ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter 'perl -wne "use strict;
235+ if ( -e qq#/tmp/rmap/m_\$ENV{GIT_COMMIT}# ) { print; next; }
236+ my %f; foreach(/(?:(?:commit|rev|revisions?|revision\(s\)|revert|reverted) +| r)([1-9][0-9]{3,4}\b(?:[\/,-] *[1-9][0-9]{3,4}\b)*)\b/gi) {
237+ my \$rvl=\$1;
238+ foreach my \$a (split / *[\/,] */, \$rvl) {
239+ unless (\$f{\$a}){
240+ \$f{\$a}=q/#/;
241+ my(\$a1, \$a2) = split / *- */, \$a;
242+ my \$c; my \$rh; if( open \$rh, q/</, qq#/tmp/rmap/\$a1#) { \$c=<\$rh>; chomp \$c; }
243+ if (\$c) { unless ( -e qq#/tmp/rmap/m_\$c# ) {
244+ my \$h; if(open \$h, q/</, qq#../map/\$c#) { \$c=<\$h>; chomp \$c; }
245+ }}
246+ if(\$c ) {
247+ \$c = q/#/.substr \$c, 0,10;
248+ if (\$a2) {
249+ my \$c2; my \$rh2; if( open \$rh2, q/</, qq#/tmp/rmap/\$a1#) { \$c2=<\$rh2>; chomp \$c2; }
250+ if (\$c2) { unless ( -e qq#/tmp/rmap/m_\$c2# ) {
251+ my \$h; if(open \$h, q/</, qq#../map/\$c2#) { \$c2=<\$h>; chomp \$c2; }
252+ }}
253+ if(\$c2) { \$c = \$c.q/-#/.substr( \$c2, 0,10); }
254+ else { \$c = \$c.q/..# / unless \$c eq q/#/; warn q/MAP2 FAIL /.\$c2 }
255+ }
256+ \$f{\$a}=\$c;
257+ }
258+ else {warn q/MAP1 fail/.\$a;}
259+ }}
260+ }
261+ foreach my \$k (keys %f) { my \$v = \$f{\$k};
262+ unless (\$v eq q/#/) { s/([ r,\/]\${k}\b)/\$1 \$v/g; }
263+ }
264+ warn \$_ if keys %f;
265+ print; "
266+ ' -f -- --all
267+```
216268
217-`   git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d`\
218-`   git reflog expire --expire=now --all ;git gc --prune=now`\
219-`   rm -rf /tmp/rmap`
269+```text
270+ git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
271+ git reflog expire --expire=now --all ;git gc --prune=now
272+ rm -rf /tmp/rmap
273+```
220274
221275## Updating tags
222276
223277This must be done **after** all filter-branches
224278
225279- Annotate all tags.
226280- Create some more tags
227281
228282This needs the git user being set
229283
230-`   git for-each-ref --format="%(refname:short)" refs/tags/ | xargs -L1 /bin/sh -c 'git tag -f -a $0 -m $0 $0 '`
284+```text
285+ git for-each-ref --format="%(refname:short)" refs/tags/ | xargs -L1 /bin/sh -c 'git tag -f -a $0 -m $0 $0 '
286+```
231287
232-`   git rev-list --in-commit-order  --reverse   fixes_2_2..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-2_3" -m "main to version 2.3" $0'`\
233-`   git rev-list --in-commit-order  --reverse   fixes_2_0..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-2_1" -m "main to version 2.1" $0'`\
234-`   git rev-list --in-commit-order  --reverse   fixes_1_8..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_9" -m "main to version 1.9" $0'`\
235-`   git rev-list --in-commit-order  --reverse   fixes_1_6..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_7" -m "main to version 1.7" $0'`\
236-`   git rev-list --in-commit-order  --reverse   fixes_1_4..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_5" -m "main to version 1.5" $0'`\
237-`   git rev-list --in-commit-order  --reverse   fixes_1_2..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_3" -m "main to version 1.3" $0'`\
238-`   git rev-list --in-commit-order  --reverse   fixes_1_0..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_1" -m "main to version 1.1" $0'`\
239-`   git rev-list --in-commit-order  --reverse   fixes_0_9_30..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_31" -m "main to version 0.9.31" $0'`\
240-`   git rev-list --in-commit-order  --reverse   fixes_0_9_28..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_29" -m "main to version 0.9.29" $0'`\
241-`   git rev-list --in-commit-order  --reverse   fixes_0_9_26..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_27" -m "main to version 0.9.27" $0'`\
242-`   git rev-list --in-commit-order  --reverse   fixes_0_9_24..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_25" -m "main to version 0.9.25" $0'`\
243-`   git rev-list --in-commit-order  --reverse   main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_0" -m "main init" $0'`\
244-`   `\
245-`   git rev-list --in-commit-order  --reverse   main..fixes_2_2 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-2_2" -m "fixes 2.2 branch" $0'`\
246-`   git rev-list --in-commit-order  --reverse   main..fixes_2_0 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-2_0" -m "fixes 2.0 branch" $0'`\
247-`   git rev-list --in-commit-order  --reverse   main..fixes_1_8 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_8" -m "fixes 1.8 branch" $0'`\
248-`   git rev-list --in-commit-order  --reverse   main..fixes_1_6 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_6" -m "fixes 1.6 branch" $0'`\
249-`   git rev-list --in-commit-order  --reverse   main..fixes_1_4 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_4" -m "fixes 1.4 branch" $0'`\
250-`   git rev-list --in-commit-order  --reverse   main..fixes_1_2 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_2" -m "fixes 1.2 branch" $0'`\
251-`   git rev-list --in-commit-order  --reverse   main..fixes_1_0 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_0" -m "fixes 1.0 branch" $0'`\
252-`   git rev-list --in-commit-order  --reverse   main..fixes_0_9_30 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_30" -m "fixes 0.9.30 branch" $0'`\
253-`   git rev-list --in-commit-order  --reverse   main..fixes_0_9_28 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_28" -m "fixes 0.9.28 branch" $0'`\
254-`   git rev-list --in-commit-order  --reverse   main..fixes_0_9_26 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_26" -m "fixes 0.9.26 branch" $0'`\
255-`   git rev-list --in-commit-order  --reverse   main..fixes_0_9_24 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_24" -m "fixes 0.9.24 branch" $0'`\
256-`   `\
257-`   git rev-list --in-commit-order  --reverse   main..free-sparta | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-free-sparta" -m "free-sparta branch" $0'`\
258-`   git rev-list --in-commit-order  --reverse   main..gtk-splitup | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-gtk-splitup" -m "gtk-splitup branch" $0'`\
259-`   git rev-list --in-commit-order  --reverse   main..lcl-smartlink | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-lcl-smartlink" -m "lcl-smartlink branch" $0'`\
260-`   git rev-list --in-commit-order  --reverse   main..listviewsortindicator | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-listviewsortindicator" -m "listviewsortindicator branch" $0'`\
261-`   git rev-list --in-commit-order  --reverse   main..macosfullkeyboardaccess | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-macosfullkeyboardaccess" -m "macosfullkeyboardaccess branch" $0'`
288+```text
289+ git rev-list --in-commit-order --reverse fixes_2_2..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-2_3" -m "main to version 2.3" $0'
290+ git rev-list --in-commit-order --reverse fixes_2_0..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-2_1" -m "main to version 2.1" $0'
291+ git rev-list --in-commit-order --reverse fixes_1_8..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_9" -m "main to version 1.9" $0'
292+ git rev-list --in-commit-order --reverse fixes_1_6..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_7" -m "main to version 1.7" $0'
293+ git rev-list --in-commit-order --reverse fixes_1_4..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_5" -m "main to version 1.5" $0'
294+ git rev-list --in-commit-order --reverse fixes_1_2..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_3" -m "main to version 1.3" $0'
295+ git rev-list --in-commit-order --reverse fixes_1_0..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-1_1" -m "main to version 1.1" $0'
296+ git rev-list --in-commit-order --reverse fixes_0_9_30..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_31" -m "main to version 0.9.31" $0'
297+ git rev-list --in-commit-order --reverse fixes_0_9_28..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_29" -m "main to version 0.9.29" $0'
298+ git rev-list --in-commit-order --reverse fixes_0_9_26..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_27" -m "main to version 0.9.27" $0'
299+ git rev-list --in-commit-order --reverse fixes_0_9_24..main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_9_25" -m "main to version 0.9.25" $0'
300+ git rev-list --in-commit-order --reverse main | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "main-0_0" -m "main init" $0'
301+
302+ git rev-list --in-commit-order --reverse main..fixes_2_2 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-2_2" -m "fixes 2.2 branch" $0'
303+ git rev-list --in-commit-order --reverse main..fixes_2_0 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-2_0" -m "fixes 2.0 branch" $0'
304+ git rev-list --in-commit-order --reverse main..fixes_1_8 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_8" -m "fixes 1.8 branch" $0'
305+ git rev-list --in-commit-order --reverse main..fixes_1_6 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_6" -m "fixes 1.6 branch" $0'
306+ git rev-list --in-commit-order --reverse main..fixes_1_4 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_4" -m "fixes 1.4 branch" $0'
307+ git rev-list --in-commit-order --reverse main..fixes_1_2 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_2" -m "fixes 1.2 branch" $0'
308+ git rev-list --in-commit-order --reverse main..fixes_1_0 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-1_0" -m "fixes 1.0 branch" $0'
309+ git rev-list --in-commit-order --reverse main..fixes_0_9_30 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_30" -m "fixes 0.9.30 branch" $0'
310+ git rev-list --in-commit-order --reverse main..fixes_0_9_28 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_28" -m "fixes 0.9.28 branch" $0'
311+ git rev-list --in-commit-order --reverse main..fixes_0_9_26 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_26" -m "fixes 0.9.26 branch" $0'
312+ git rev-list --in-commit-order --reverse main..fixes_0_9_24 | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-fixes-0_9_24" -m "fixes 0.9.24 branch" $0'
313+
314+ git rev-list --in-commit-order --reverse main..free-sparta | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-free-sparta" -m "free-sparta branch" $0'
315+ git rev-list --in-commit-order --reverse main..gtk-splitup | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-gtk-splitup" -m "gtk-splitup branch" $0'
316+ git rev-list --in-commit-order --reverse main..lcl-smartlink | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-lcl-smartlink" -m "lcl-smartlink branch" $0'
317+ git rev-list --in-commit-order --reverse main..listviewsortindicator | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-listviewsortindicator" -m "listviewsortindicator branch" $0'
318+ git rev-list --in-commit-order --reverse main..macosfullkeyboardaccess | head -n 1 | xargs -L1 /bin/sh -c 'git tag -a "t-macosfullkeyboardaccess" -m "macosfullkeyboardaccess branch" $0'
319+```
262320
263321## Finish
264322
265323edit HEAD to point to main
266324
267-`   gedit HEAD`
325+```text
326+ gedit HEAD
327+```
268328
269-`   git remote add origin `[`https://gitlab.com/freepascal.org/lazarus-ide/lazarus_test_conversion_X.git`](https://gitlab.com/freepascal.org/lazarus-ide/lazarus_test_conversion_X.git)
329+```text
330+ git remote add origin https://gitlab.com/freepascal.org/lazarus-ide/lazarus_test_conversion_X.git
331+```
270332
271-`   git push --all origin`\
272-`   git push --tags origin`
333+```text
334+ git push --all origin
335+ git push --tags origin
336+```
273337
274338On gitlab
275339
276340- Settings / Repository
277341 - set default gitlab branch\
278342 \- no autoclose issues on default branch // decide later
279343 - set "reject unverified users"
280344 - protect branches * // no force push
281345 - protect tags: fixes* lazarus* release* main* // maintainers only
282346
283347- Settings / Integrations
284348 - External wiki
285349
286350- Settings / General
287351 - Disable Wiki, Snippets, Papges, Requirements, Operations, Service Desk, Container, Packages\
288352 For now also CI, until we use it
289353 - Merge request approvals: Enable "Prevent users from modifying MR approval rules"
290354 - set the avatar
291355 - Add "description"
292356 - Make public
293357 - Disable "Users can request access"
294358
295359# Comparing data before/after filter-branch
296360
297361With subject line / Will show changes in subject
298362
299-`   git log --pretty='format:%ae %an %cd  %s %d' --graph --all > ../log.txt`
363+```text
364+ git log --pretty='format:%ae %an %cd %s %d' --graph --all > ../log.txt
365+```
300366
301367Without subject line / Should have no diff
302368
303369- This compares the graph and committers =\> Thus it will show if all commits are present, and if all branches are correct
304370
305-`   git log --pretty='format:%ae %an %cd %d' --graph --all > ../log.txt`
371+```text
372+ git log --pretty='format:%ae %an %cd %d' --graph --all > ../log.txt
373+```
306374
307375- compare the changes to files (gitignore / gitattributes will diff for the top commit(s)) / --graph can be added too
308376
309377
310378(slow)
311379
312-`   git log --all --pretty='%ae %an %cd %d' --stat > ../statlog.txt`
380+```text
381+ git log --all --pretty='%ae %an %cd %d' --stat > ../statlog.txt
382+```
313383
314384- Compare the overall amount of lines in the log.
315385
316-`   git log --all | wc -l`
386+```text
387+ git log --all | wc -l
388+```
317389
318390Make sure you do that after "clean up" in each step. Otherwise the internal subgit or filter-branch revs will go into the compare.
319391
320392Also "removing the binaries" introduces a diff.
321393
322394# Data
323395
324396Please mail me for any changes. Do not make changes here. Otherwise the changes will not make it into the conversion.
325397
326398## .gitignore
327399
328-`   **/*.o`\
329-`   **/*.ppu`\
330-`   **/*.exe`\
331-`   **/*.bak`\
332-`   **/*.diff`\
333-`   **/*.patch`\
334-`   **/units/`\
335-`   **/lib/`\
336-`   **/*;[1-9]`\
337-`   **/*.~*`\
338-`   **/*.*~`\
339-`   **/*.fpcunit.ini`\
340-`   **/*.lps`\
341-`   **/*.compiled`\
342-`   /docs/chm/**/*.chm`\
343-`   /docs/chm/**/*.xct`\
344-`   /docs/chm/**/*.kwd`\
345-`   /docs/chm/**/*.txt`\
346-`   /libeay32.dll`\
347-`   /ssleay32.dll`\
348-`   /lazarus.cfg`\
349-`   ide/revision.inc`\
350-`   `\
351-`   !**/patches/*.patch`\
352-`   !**/patches/*.diff`
400+```text
401+ **/*.o
402+ **/*.ppu
403+ **/*.exe
404+ **/*.bak
405+ **/*.diff
406+ **/*.patch
407+ **/units/
408+ **/lib/
409+ **/*;[1-9]
410+ **/*.~*
411+ **/*.*~
412+ **/*.fpcunit.ini
413+ **/*.lps
414+ **/*.compiled
415+ /docs/chm/**/*.chm
416+ /docs/chm/**/*.xct
417+ /docs/chm/**/*.kwd
418+ /docs/chm/**/*.txt
419+ /libeay32.dll
420+ /ssleay32.dll
421+ /lazarus.cfg
422+ ide/revision.inc
423+
424+ !**/patches/*.patch
425+ !**/patches/*.diff
426+```
353427
354428## .gitattributes
355429
356-`   * text=auto !eol`\
357-`   **/*.pp text`\
358-`   **/*.pas text`\
359-`   **/*.inc text`\
360-`   **/*.lfm text`\
361-`   **/*.lrs text`\
362-`   **/*.lps text`\
363-`   **/*.lpr text`\
364-`   **/*.lpi text`\
365-`   **/*.lpk text`\
366-`   **/*.lpl text`\
367-`   **/*.lrj text`\
368-`   **/*.dpr text`\
369-`   **/*.dfm text`\
370-`   **/*.pot text`\
371-`   **/*.po text`\
372-`   **/*.rc text`\
373-`   **/*.txt text`\
374-`   **/*.txt.sample text`\
375-`   **/*.ini text`\
376-`   **/*.cfg text`\
377-`   **/*.iss text`\
378-`   **/*.isl text`\
379-`   **/*.xml text`\
380-`   **/*.xsl text`\
381-`   **/*.html text`\
382-`   **/*.css text`\
383-`   **/*.php text`\
384-`   **/*.js text`\
385-`   **/.htaccess text`\
386-`   **/*.patch text`\
387-`   **/*.md text`\
388-`   **/*.bat text`\
389-`   **/*.sh text`\
390-`   **/*.compiled text`\
391-`   **/*.bdsproj text`\
392-`   **/*.plist text`\
393-`   **/*.h text`\
394-`   **/*.c text`\
395-`   **/*.cpp text`\
396-`   **/*.in text`\
397-`   **/*.xpm text`\
398-`   **/*.svg text`\
399-`   **/Makefile text`\
400-`   **/Makefile.compiled text`\
401-`   **/Makefile.fpc text`\
402-`   **/*.exe -text`\
403-`   **/*.dll -text`\
404-`   **/*.so -text`\
405-`   **/*.gif -text`\
406-`   **/*.jpg -text`\
407-`   **/*.ico -text`\
408-`   **/*.bmp -text`\
409-`   **/*.res -text`\
410-`   **/*.ttf -text`\
411-`   **/*.cur -text`\
412-`   **/*.db3 -text`\
413-`   **/*.dbf -text`\
414-`   **/*.mbf -text`\
415-`   **/*.mdx -text`\
416-`   **/*.fbk -text`\
417-`   **/*.odt -text`\
418-`   **/*.ods -text`\
419-`   **/*.odg -text`\
420-`   **/*.odp -text`\
421-`   **/*.xls -text`\
422-`   **/*.pdf -text`\
423-`   **/*.zip -text`\
424-`   **/*.rar -text`\
425-`   **/*.tar -text`\
426-`   **/*.tgz -text`\
427-`   **/*.gz -text`\
428-`   **/*.icns -text`\
429-`   **/*.dcr -text`\
430-`   components/aggpas/**/*.ppm -text`\
431-`   **/*.app/Contents/MacOS/* -text`
430+```text
431+ * text=auto !eol
432+ **/*.pp text
433+ **/*.pas text
434+ **/*.inc text
435+ **/*.lfm text
436+ **/*.lrs text
437+ **/*.lps text
438+ **/*.lpr text
439+ **/*.lpi text
440+ **/*.lpk text
441+ **/*.lpl text
442+ **/*.lrj text
443+ **/*.dpr text
444+ **/*.dfm text
445+ **/*.pot text
446+ **/*.po text
447+ **/*.rc text
448+ **/*.txt text
449+ **/*.txt.sample text
450+ **/*.ini text
451+ **/*.cfg text
452+ **/*.iss text
453+ **/*.isl text
454+ **/*.xml text
455+ **/*.xsl text
456+ **/*.html text
457+ **/*.css text
458+ **/*.php text
459+ **/*.js text
460+ **/.htaccess text
461+ **/*.patch text
462+ **/*.md text
463+ **/*.bat text
464+ **/*.sh text
465+ **/*.compiled text
466+ **/*.bdsproj text
467+ **/*.plist text
468+ **/*.h text
469+ **/*.c text
470+ **/*.cpp text
471+ **/*.in text
472+ **/*.xpm text
473+ **/*.svg text
474+ **/Makefile text
475+ **/Makefile.compiled text
476+ **/Makefile.fpc text
477+ **/*.exe -text
478+ **/*.dll -text
479+ **/*.so -text
480+ **/*.gif -text
481+ **/*.jpg -text
482+ **/*.ico -text
483+ **/*.bmp -text
484+ **/*.res -text
485+ **/*.ttf -text
486+ **/*.cur -text
487+ **/*.db3 -text
488+ **/*.dbf -text
489+ **/*.mbf -text
490+ **/*.mdx -text
491+ **/*.fbk -text
492+ **/*.odt -text
493+ **/*.ods -text
494+ **/*.odg -text
495+ **/*.odp -text
496+ **/*.xls -text
497+ **/*.pdf -text
498+ **/*.zip -text
499+ **/*.rar -text
500+ **/*.tar -text
501+ **/*.tgz -text
502+ **/*.gz -text
503+ **/*.icns -text
504+ **/*.dcr -text
505+ components/aggpas/**/*.ppm -text
506+ **/*.app/Contents/MacOS/* -text
507+```
432508
433509---
434510*From the Free Pascal wiki, page "Git Conversion Lazarus", as it stood on 2021-07-28 after a change by Martin, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
435511Category: Version Control

Back to history