Git v2.29 がリリースされた
先日 Git v.2.29 がリリースされた。
SHA-2 コミット・ハッシュの実験的サポート
v2.29 ではコミット・ハッシュに関する重大な仕様変更がある。
Git 2.29 includes experimental support for writing your repository’s objects using a SHA-256 hash of their contents, instead of using SHA-1.
といっても今回は実験的なサポート(experimental support)で,試すのであれば以下のような感じでできるらしい。
$ git init --object-format=sha256 sample-repo
Initialized empty Git repository in /home/username/sample-repo/.git/
$ cd sample-repo
$ echo 'Hello, SHA-256!' >README.md
$ git add README.md
$ git commit -m "README.md: initial commit"
[main (root-commit) 6d45449] README.md: initial commit
1 file changed, 1 insertion(+)
create mode 100644 README.md
$ git rev-parse HEAD
6d45449028a8e76500adbfe7330e779d5dc4a3a14fca58ff08ec354c58727b2c
当然ながら SHA-1 ベースのコミット・ハッシュと SHA-2 (SHA256) ベースのコミット・ハッシュとの間には互換性がない。 当面は2系統のリポジトリを使い分けて運用することになりそうだ。 ただし,将来的には両者を相互運用できるようにするらしい。
In future releases, Git will support interoperating between repositories with different object formats by computing both a SHA-1 and SHA-256 hash of each object it writes, and storing a translation table between them. This will eventually allow repositories that store their objects using SHA-256 to interact with (sufficiently up-to-date) SHA-1 clients, and vice-versa. It will also allow converted SHA-256 repositories to have their references to older SHA-1 commits still function as normal (e.g., if I write a commit whose message references an earlier commit by its SHA-1 name, then Git will still be able to follow that reference even after the repository is converted to use SHA-256 by consulting the translation table).
ここまで到達すれば SHA-2 ベースへ本格的に切り替えていってもいいかも知れない。
Windows 版 Git Credential Manager のアップグレード
Git for Windows では,もうひとつ重大な変更がある。
This version upgrades existing users of Git Credential Manager for Windows (which was just deprecated) to Git Credential Manager Core (“GCM Core”, which is the designated successor of the former). This is necessary because GitHub deprecated password-based authentication and intends to remove support for it soon, and GCM Core is prepared for this change..
GitHub リポジトリに HTTPS でアクセスしている場合は注意が必要かも知れない(Git for Windows を使ってないので,どの程度影響するか分かってない。ゴメンペコン 🙇)。
ブックマーク
-
Release Git for Windows 2.29.0 · git-for-windows/git · GitHub
-
Release Git for Windows 2.29.1 · git-for-windows/git · GitHub
-
Release Git for Windows 2.29.2 · git-for-windows/git · GitHub
-
さようなら SHA-1 : SHA-1 の危殆化について Zenn でまとめ記事を書いてみた
参考図書
- 暗号技術入門 第3版 秘密の国のアリス
- 結城 浩 (著)
- SBクリエイティブ 2015-08-25 (Release 2015-09-17)
- Kindle版
- B015643CPE (ASIN)
- 評価
SHA-3 や Bitcoin/Blockchain など新しい知見や技術要素を大幅追加。暗号技術を使うだけならこれ1冊でとりあえず無問題。