diff options
| author | la-ninpre <leobrekalini@gmail.com> | 2022-04-19 00:24:23 +0300 |
|---|---|---|
| committer | la-ninpre <leobrekalini@gmail.com> | 2022-04-19 00:32:37 +0300 |
| commit | 8d962aabf74c42c3afdc38f2f85fa7b06fd04ef0 (patch) | |
| tree | e5054517b940e5c535a4c7282d7faa7b6462e794 /_posts/2020-12-06-fossil-to-git.md | |
| parent | 9f4b181b36418669462c0300c2e090d0f4547dc8 (diff) | |
| download | aaoth.xyz-8d962aabf74c42c3afdc38f2f85fa7b06fd04ef0.tar.gz aaoth.xyz-8d962aabf74c42c3afdc38f2f85fa7b06fd04ef0.zip | |
reimplement website using shell scripts
major change, i know. now i'm using ssg and rssg by roman zolotarev.
okay, well, not exactly. ssg is modified to generate pages for gemini
too. it's hard to maintain two different things simultaneously.
bye-bye jekyll!
Diffstat (limited to '_posts/2020-12-06-fossil-to-git.md')
| -rw-r--r-- | _posts/2020-12-06-fossil-to-git.md | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/_posts/2020-12-06-fossil-to-git.md b/_posts/2020-12-06-fossil-to-git.md deleted file mode 100644 index cacb4c9..0000000 --- a/_posts/2020-12-06-fossil-to-git.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: fossil export to git -author: la-ninpre -tags: fossil git tutorial ---- - -i was trying to export my website repo to fossil using suggested method from -[fossil website][1]: - -``` -git fast-export --all | fossil import --git repo.fossil -``` - -[1]:https://www.fossil-scm.org/home/doc/trunk/www/inout.wiki - -but i didn't like that fossil recognizes my email as username and so commit -messages user was `user@example.com` instead of `user`. - -<!--more--> - -i then read a bit about options of `git fast-export` and found `--anonymize` -flag. but it's results weren't satisfying either. - -when i looked on a raw output of `git fast-export`, i noticed that commit author -is specified there as - -``` -author user <user@example.com> -``` - -and then it's flashed in my head: why not pipe git export through sed and just -replace the contents of `<>` with username instead of email. - -so the final command looks like this: - -``` -git fast-export --all | \ - sed -E 's/^((author)|(committer))[[:blank:]]+([[:graph:]]+)[[:blank:]]+(<[[:alnum:]]+@[[:alnum:]]+\.[[:alnum:]]+>)/\1 \4 <\4>/' | \ - fossil import --git repo.fossil -``` - -and it converts - -``` -author user <user@example.com> -``` - -to - -``` -author user <user> -``` - -which is odd, but fine for fossil import. - ---- - -update: i tested this on a bigger repo with older history and found that this -regexp was not perfect, i updated it to handle situations like -`user@example.co.uk` and also names that consist of more than one word. - -``` -git fast-export --all | \ - sed -E 's/^((author)|(committer))[[:blank:]]+([[:graph:]]+([[:blank:]]+[[:graph:]]+)*)[[:blank:]]+(<[[:graph:]]+@[[:graph:]]+(\.[[:graph:]]+)+>)/\1 \4<\4>/' | \ - fossil import --git repo.fossil -``` - -it's veery evil looking horrible thing, but it works. |
