Git Conversion Lazarus: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | This page has the detailed steps used to convert the Lazarus SVN repro to git. | |
| 2 | 2 | ||
| 3 | 3 | # SubGIT | |
| 4 | 4 | ||
| 5 | 5 | The initial conversion will be done using TMate Subgit. | |
| 6 | 6 | ||
| 7 | 7 | ## Install | |
| 8 | 8 | ||
| 9 | 9 | Unpack subgit to | |
| 10 | 10 | ||
| 11 | - | ||
| 11 | + | ```text | |
| 12 | + | ~/subgit/subgit-3.3.11 | |
| 13 | + | ``` | |
| 12 | 14 | ||
| 13 | 15 | ## Required | |
| 14 | 16 | ||
| 15 | 17 | An author.txt file | |
| 16 | 18 | ||
| 17 | - | ||
| 19 | + | ```text | |
| 20 | + | svn-name - git-name <email> | |
| 21 | + | ``` | |
| 18 | 22 | ||
| 19 | 23 | ## Run / main repro | |
| 20 | 24 | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - | ||
| 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 | + | ``` | |
| 25 | 31 | ||
| 26 | 32 | And add the following (the first line, replaces an existing setting) | |
| 27 | 33 | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - | ||
| 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 | + | ``` | |
| 36 | 44 | ||
| 37 | 45 | The translate options prevent .gitignore and .gitattributes. Those can be translated, but will later be replaced... | |
| 38 | 46 | ||
| 39 | - | ||
| 47 | + | ```text | |
| 48 | + | cp authors.txt laz.git/subgit/authors.txt | |
| 49 | + | ``` | |
| 40 | 50 | ||
| 41 | - | ||
| 51 | + | ```text | |
| 52 | + | ./bin/subgit install laz.git | |
| 53 | + | ``` | |
| 42 | 54 | ||
| 43 | 55 | Without skipping the gitignore/gitattributes, there will be an error at revision 47330. The process will hang. nterrupt it and edit | |
| 44 | 56 | ||
| 45 | - | ||
| 57 | + | ```text | |
| 58 | + | gedit lazarus.git/svn/.metadata | |
| 59 | + | ``` | |
| 46 | 60 | ||
| 47 | 61 | and 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 | |
| 48 | 62 | ||
| 49 | - | ||
| 63 | + | ```text | |
| 64 | + | ./bin/subgit install laz-bin.git | |
| 65 | + | ``` | |
| 50 | 66 | ||
| 51 | 67 | Stop the daemon | |
| 52 | 68 | ||
| 53 | - | ||
| 69 | + | ```text | |
| 70 | + | ./bin/subgit shutdown laz-bin.git/ | |
| 71 | + | ``` | |
| 54 | 72 | ||
| 55 | 73 | ## Run / binaries repro | |
| 56 | 74 | ||
| 57 | - | ||
| 75 | + | ```text | |
| 76 | + | ./bin/subgit configure https://svn.freepascal.org/svn/lazarus laz-bin.git | |
| 77 | + | ``` | |
| 58 | 78 | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 62 | - | ||
| 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 | + | ``` | |
| 63 | 85 | ||
| 64 | - | ||
| 86 | + | ```text | |
| 87 | + | cp authors.txt laz-bin.git/subgit/authors.txt | |
| 88 | + | ``` | |
| 65 | 89 | ||
| 66 | 90 | follow the steps above | |
| 67 | 91 | ||
| 68 | 92 | ## Run / website repro | |
| 69 | 93 | ||
| 70 | - | ||
| 94 | + | ```text | |
| 95 | + | ./bin/subgit configure https://svn.freepascal.org/svn/lazaruswebsite laz-web.git | |
| 96 | + | ``` | |
| 71 | 97 | ||
| 72 | - | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - | ||
| 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 | + | ``` | |
| 76 | 104 | ||
| 77 | - | ||
| 105 | + | ```text | |
| 106 | + | cp authors.txt laz-web.git/subgit/authors.txt | |
| 107 | + | ``` | |
| 78 | 108 | ||
| 79 | 109 | follow the steps above | |
| 80 | 110 | ||
| 81 | 111 | # Part 2 | |
| 82 | 112 | ||
| 83 | 113 | - Updating gitignore | |
| 84 | 114 | - Prefixing all issue references with \# | |
| 85 | 115 | - translating svn revisions to git hashes | |
| 86 | 116 | ||
| 87 | 117 | ## Set a git user | |
| 88 | 118 | ||
| 89 | - | ||
| 90 | - | ||
| 119 | + | ```text | |
| 120 | + | git config --local user.email "lazarus@lazarus-ide.org" | |
| 121 | + | git config --local user.name "lazarus" | |
| 122 | + | ``` | |
| 91 | 123 | ||
| 92 | 124 | ## Clean out left overs from subgit | |
| 93 | 125 | ||
| 94 | - | ||
| 126 | + | ```text | |
| 127 | + | git for-each-ref --format="%(refname)" refs/svn/ | xargs -n 1 git update-ref -d | |
| 128 | + | ``` | |
| 95 | 129 | ||
| 96 | 130 | ## Clean left overs from binaries | |
| 97 | 131 | ||
| 98 | 132 | There are a few tags, that lead to binaries (gdb.exe) ending up in the data | |
| 99 | 133 | ||
| 100 | - | ||
| 101 | - | ||
| 102 | - | ||
| 103 | - | ||
| 104 | - | ||
| 105 | - | ||
| 106 | - | ||
| 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 | + | ``` | |
| 107 | 143 | ||
| 108 | 144 | ## Updating gitignore/gitattributes / Prefix issues with \# | |
| 109 | 145 | ||
| 110 | 146 | The below combines the 2 steps. It can be run in 2 separate calls. | |
| 111 | 147 | ||
| 112 | 148 | It will run for about one hour. | |
| 113 | 149 | ||
| 114 | - | ||
| 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 | + | ``` | |
| 115 | 153 | ||
| 116 | - | ||
| 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 | + | ``` | |
| 117 | 157 | ||
| 118 | 158 | Cleanup | |
| 119 | 159 | ||
| 120 | - | ||
| 121 | - | ||
| 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 | + | ``` | |
| 122 | 164 | ||
| 123 | 165 | ## Translating references to svn rev (r12345) to \#hash | |
| 124 | 166 | ||
| 125 | 167 | This 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. | |
| 126 | 168 | ||
| 127 | 169 | - The first batch will update only commits it branch main. | |
| 128 | 170 | ||
| 129 | 171 | ||
| 130 | 172 | This will also only be references to other commits in main. | |
| 131 | 173 | ||
| 132 | 174 | Merges from branches to main can not be updated. | |
| 133 | 175 | ||
| 134 | 176 | - The 2nd batch will update only commits in branches. This means the hashes for the main branch will be left intact. | |
| 135 | 177 | ||
| 136 | 178 | ||
| 137 | 179 | This will update merges from main to fixes | |
| 138 | 180 | ||
| 139 | 181 | To 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. | |
| 140 | 182 | ||
| 141 | - | ||
| 142 | - | ||
| 143 | - | ||
| 144 | - | ||
| 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 | + | ``` | |
| 145 | 189 | ||
| 146 | - | ||
| 147 | - | ||
| 148 | - | ||
| 149 | - | ||
| 150 | - | ||
| 151 | - | ||
| 152 | - | ||
| 153 | - | ||
| 154 | - | ||
| 155 | - | ||
| 156 | - | ||
| 157 | - | ||
| 158 | - | ||
| 159 | - | ||
| 160 | - | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - | ||
| 164 | - | ||
| 165 | - | ||
| 166 | - | ||
| 167 | - | ||
| 168 | - | ||
| 169 | - | ||
| 170 | - | ||
| 171 | - | ||
| 172 | - | ||
| 173 | - | ||
| 174 | - | ||
| 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 | + | ``` | |
| 175 | 221 | ||
| 176 | - | ||
| 222 | + | ```text | |
| 223 | + | git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d | |
| 224 | + | ``` | |
| 177 | 225 | ||
| 178 | - | ||
| 179 | - | ||
| 180 | - | ||
| 181 | - | ||
| 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 | + | ``` | |
| 182 | 232 | ||
| 183 | - | ||
| 184 | - | ||
| 185 | - | ||
| 186 | - | ||
| 187 | - | ||
| 188 | - | ||
| 189 | - | ||
| 190 | - | ||
| 191 | - | ||
| 192 | - | ||
| 193 | - | ||
| 194 | - | ||
| 195 | - | ||
| 196 | - | ||
| 197 | - | ||
| 198 | - | ||
| 199 | - | ||
| 200 | - | ||
| 201 | - | ||
| 202 | - | ||
| 203 | - | ||
| 204 | - | ||
| 205 | - | ||
| 206 | - | ||
| 207 | - | ||
| 208 | - | ||
| 209 | - | ||
| 210 | - | ||
| 211 | - | ||
| 212 | - | ||
| 213 | - | ||
| 214 | - | ||
| 215 | - | ||
| 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 | + | ``` | |
| 216 | 268 | ||
| 217 | - | ||
| 218 | - | ||
| 219 | - | ||
| 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 | + | ``` | |
| 220 | 274 | ||
| 221 | 275 | ## Updating tags | |
| 222 | 276 | ||
| 223 | 277 | This must be done **after** all filter-branches | |
| 224 | 278 | ||
| 225 | 279 | - Annotate all tags. | |
| 226 | 280 | - Create some more tags | |
| 227 | 281 | ||
| 228 | 282 | This needs the git user being set | |
| 229 | 283 | ||
| 230 | - | ||
| 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 | + | ``` | |
| 231 | 287 | ||
| 232 | - | ||
| 233 | - | ||
| 234 | - | ||
| 235 | - | ||
| 236 | - | ||
| 237 | - | ||
| 238 | - | ||
| 239 | - | ||
| 240 | - | ||
| 241 | - | ||
| 242 | - | ||
| 243 | - | ||
| 244 | - | ||
| 245 | - | ||
| 246 | - | ||
| 247 | - | ||
| 248 | - | ||
| 249 | - | ||
| 250 | - | ||
| 251 | - | ||
| 252 | - | ||
| 253 | - | ||
| 254 | - | ||
| 255 | - | ||
| 256 | - | ||
| 257 | - | ||
| 258 | - | ||
| 259 | - | ||
| 260 | - | ||
| 261 | - | ||
| 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 | + | ``` | |
| 262 | 320 | ||
| 263 | 321 | ## Finish | |
| 264 | 322 | ||
| 265 | 323 | edit HEAD to point to main | |
| 266 | 324 | ||
| 267 | - | ||
| 325 | + | ```text | |
| 326 | + | gedit HEAD | |
| 327 | + | ``` | |
| 268 | 328 | ||
| 269 | - | ||
| 329 | + | ```text | |
| 330 | + | git remote add origin https://gitlab.com/freepascal.org/lazarus-ide/lazarus_test_conversion_X.git | |
| 331 | + | ``` | |
| 270 | 332 | ||
| 271 | - | ||
| 272 | - | ||
| 333 | + | ```text | |
| 334 | + | git push --all origin | |
| 335 | + | git push --tags origin | |
| 336 | + | ``` | |
| 273 | 337 | ||
| 274 | 338 | On gitlab | |
| 275 | 339 | ||
| 276 | 340 | - Settings / Repository | |
| 277 | 341 | - set default gitlab branch\ | |
| 278 | 342 | \- no autoclose issues on default branch // decide later | |
| 279 | 343 | - set "reject unverified users" | |
| 280 | 344 | - protect branches * // no force push | |
| 281 | 345 | - protect tags: fixes* lazarus* release* main* // maintainers only | |
| 282 | 346 | ||
| 283 | 347 | - Settings / Integrations | |
| 284 | 348 | - External wiki | |
| 285 | 349 | ||
| 286 | 350 | - Settings / General | |
| 287 | 351 | - Disable Wiki, Snippets, Papges, Requirements, Operations, Service Desk, Container, Packages\ | |
| 288 | 352 | For now also CI, until we use it | |
| 289 | 353 | - Merge request approvals: Enable "Prevent users from modifying MR approval rules" | |
| 290 | 354 | - set the avatar | |
| 291 | 355 | - Add "description" | |
| 292 | 356 | - Make public | |
| 293 | 357 | - Disable "Users can request access" | |
| 294 | 358 | ||
| 295 | 359 | # Comparing data before/after filter-branch | |
| 296 | 360 | ||
| 297 | 361 | With subject line / Will show changes in subject | |
| 298 | 362 | ||
| 299 | - | ||
| 363 | + | ```text | |
| 364 | + | git log --pretty='format:%ae %an %cd %s %d' --graph --all > ../log.txt | |
| 365 | + | ``` | |
| 300 | 366 | ||
| 301 | 367 | Without subject line / Should have no diff | |
| 302 | 368 | ||
| 303 | 369 | - This compares the graph and committers =\> Thus it will show if all commits are present, and if all branches are correct | |
| 304 | 370 | ||
| 305 | - | ||
| 371 | + | ```text | |
| 372 | + | git log --pretty='format:%ae %an %cd %d' --graph --all > ../log.txt | |
| 373 | + | ``` | |
| 306 | 374 | ||
| 307 | 375 | - compare the changes to files (gitignore / gitattributes will diff for the top commit(s)) / --graph can be added too | |
| 308 | 376 | ||
| 309 | 377 | ||
| 310 | 378 | (slow) | |
| 311 | 379 | ||
| 312 | - | ||
| 380 | + | ```text | |
| 381 | + | git log --all --pretty='%ae %an %cd %d' --stat > ../statlog.txt | |
| 382 | + | ``` | |
| 313 | 383 | ||
| 314 | 384 | - Compare the overall amount of lines in the log. | |
| 315 | 385 | ||
| 316 | - | ||
| 386 | + | ```text | |
| 387 | + | git log --all | wc -l | |
| 388 | + | ``` | |
| 317 | 389 | ||
| 318 | 390 | Make sure you do that after "clean up" in each step. Otherwise the internal subgit or filter-branch revs will go into the compare. | |
| 319 | 391 | ||
| 320 | 392 | Also "removing the binaries" introduces a diff. | |
| 321 | 393 | ||
| 322 | 394 | # Data | |
| 323 | 395 | ||
| 324 | 396 | Please mail me for any changes. Do not make changes here. Otherwise the changes will not make it into the conversion. | |
| 325 | 397 | ||
| 326 | 398 | ## .gitignore | |
| 327 | 399 | ||
| 328 | - | ||
| 329 | - | ||
| 330 | - | ||
| 331 | - | ||
| 332 | - | ||
| 333 | - | ||
| 334 | - | ||
| 335 | - | ||
| 336 | - | ||
| 337 | - | ||
| 338 | - | ||
| 339 | - | ||
| 340 | - | ||
| 341 | - | ||
| 342 | - | ||
| 343 | - | ||
| 344 | - | ||
| 345 | - | ||
| 346 | - | ||
| 347 | - | ||
| 348 | - | ||
| 349 | - | ||
| 350 | - | ||
| 351 | - | ||
| 352 | - | ||
| 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 | + | ``` | |
| 353 | 427 | ||
| 354 | 428 | ## .gitattributes | |
| 355 | 429 | ||
| 356 | - | ||
| 357 | - | ||
| 358 | - | ||
| 359 | - | ||
| 360 | - | ||
| 361 | - | ||
| 362 | - | ||
| 363 | - | ||
| 364 | - | ||
| 365 | - | ||
| 366 | - | ||
| 367 | - | ||
| 368 | - | ||
| 369 | - | ||
| 370 | - | ||
| 371 | - | ||
| 372 | - | ||
| 373 | - | ||
| 374 | - | ||
| 375 | - | ||
| 376 | - | ||
| 377 | - | ||
| 378 | - | ||
| 379 | - | ||
| 380 | - | ||
| 381 | - | ||
| 382 | - | ||
| 383 | - | ||
| 384 | - | ||
| 385 | - | ||
| 386 | - | ||
| 387 | - | ||
| 388 | - | ||
| 389 | - | ||
| 390 | - | ||
| 391 | - | ||
| 392 | - | ||
| 393 | - | ||
| 394 | - | ||
| 395 | - | ||
| 396 | - | ||
| 397 | - | ||
| 398 | - | ||
| 399 | - | ||
| 400 | - | ||
| 401 | - | ||
| 402 | - | ||
| 403 | - | ||
| 404 | - | ||
| 405 | - | ||
| 406 | - | ||
| 407 | - | ||
| 408 | - | ||
| 409 | - | ||
| 410 | - | ||
| 411 | - | ||
| 412 | - | ||
| 413 | - | ||
| 414 | - | ||
| 415 | - | ||
| 416 | - | ||
| 417 | - | ||
| 418 | - | ||
| 419 | - | ||
| 420 | - | ||
| 421 | - | ||
| 422 | - | ||
| 423 | - | ||
| 424 | - | ||
| 425 | - | ||
| 426 | - | ||
| 427 | - | ||
| 428 | - | ||
| 429 | - | ||
| 430 | - | ||
| 431 | - | ||
| 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 | + | ``` | |
| 432 | 508 | ||
| 433 | 509 | --- | |
| 434 | 510 | *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).* | |
| 435 | 511 | Category: Version Control |
