一度登録してみると、スキル偏差値はプレミアム本会員になるギリギリの60でした。
実際どのくらいなのだろう60。定量的な値になってると良いのだけれど。
さて、 GitHub には大学とは関係ない個人のプロダクトとかを載せていました。
大学での課題やプロダクトは大学の Mercurial Repository に残しています。
ですが、この際 GitHub にも載せることにしました。
単にスキル偏差値を上げたいだけとも言う。
単に bitbucket に上げても良いのだけれどそれだと Findy に拾って貰えないので。
環境構築
Mercurial から Git への変換は fast-export を使います。
- $ git clone https://github.com/frej/fast-export
こいつは python を内部で使ってるのでその調整も必要です。
- $ easy_install mercurial
とかかな。
私は python2 を brew で明示的に入れてるので
- $ vim fast-export/hg-fast-export.sh
- python -> python2
- $ pip2 install mercurial
とか。実行時にエラーが出なければOKだと思います。
自分だけが Author の Mercurial Repository の変換
fast-export のセットアップが終わったら、変換します。
- $ mkdir git_repo
- $ cd git_repo
- $ git init
- $ ../fast-export/hg-fast-export.sh -r /path/to/hg_repo
これで Mercurial の Repository を元に git に commit しまくってくれます。
きちんと時刻とかも残るので便利。
Author Information が気に入らない場合
私は大学時代の時は大学のメールアドレスで commit していたので、GitHub にはアイコンが無い。
これはちょっ悲しいので Author の情報を変更する。
具体的には username と email ですね。変更するには
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='atton'; GIT_AUTHOR_EMAIL='e115763@gmail.com'; GIT_COMMITTER_NAME='atton'; GIT_COMMITTER_EMAIL='e115763@gmail.com';" HEAD |
とかすると良い。長いけれど1コマンドです。
これは他人の commit も変更できちゃうので完全に悪用厳禁ですね。
他の人も commit している repository の変換
最初にやることは変わらずに変換。
- $ ../fast-export/hg-fast-export.sh -r /path/to/hg_repo
んで、 Author を変更する時に発行するコマンドを変えます。
if 文で自分の変えたい username+email を指定してあげています。
これで指定したものだけが変更されます。便利。
こっちも長いけれど1コマンドですね。
これで他人の成果をきちんと残したまま、自分の気に入らないメールアドレスを書き換えられます。
やっぱり悪用厳禁なコマンドなので注意。
fast-export で変換した Repository List
どうせなので公開できる成果物のリストを残しておきます。
- GitHub - atton/agda-proofs: Agda proofs
- GitHub - atton/delta_monad: My Thesis(Notation of Program Modifications)
- GitHub - atton/dockerfiles
- GitHub - atton/FileWrite: Exercise of Operating Systems in University
- GitHub - atton/heroes_and_daemons: Battle Game for exercise in University
- GitHub - atton/similar_monad: prototype of delta monad
- GitHub - atton/slideshow-cr: Slideshow theme for cr-ryukyu
- GitHub - atton/slideshow-s6cr: Slideshow theme for cr-ryukyu(S6)
- GitHub - atton/tapl: Types and Programming Languages
- GitHub - atton/unity-network-sample
思ってたよりありますね。仕事してたなー。
この成果物が誰かの参考になれば幸いです。
オチ
この後 Findy で GitHub 再連携をしたところ、算出方法が変わったようで51に下がりました。かなしい。
環境
- OS: macOS 10.12.6
- fast-export (cc8fefe0083bc38c781341a86a1779dc5941f6e2)
- python: 2.7.10
- pip: 9.0.1
- mercurial: 4.3.3
- Mercurial: 4.3.3
- Git: 2.14.3
0 件のコメント:
コメントを投稿