martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
9.05k stars 315 forks source link

FR: support sha256 git remotes #3813

Open jalil-salame opened 5 months ago

jalil-salame commented 5 months ago

Is your feature request related to a problem? Please describe. I recently tried creating fetching a repo with sha256 commits (created in forgejo) and was surprised to see it didn't work:

$ jj git fetch
Error: unknown remote object format 'sha256'; class=Invalid (3)

According to libgit2 it is an experimental feature since v1.6.0 and was supossedly finished in v1.7.0

Describe the solution you'd like I would like support for sha256 objects to be added/enabled in jj

Describe alternatives you've considered Do nothing, I was trying it out to see if there were any problems I could report. It is not necessary for my workflow c:

Additional context The git documentation talks about why and how sha256 support is being introduced. The main reason is that sha1 was "broken" and you can thus serve a bad commit whose sha1 checksum matches the real commit's hash. This was mitigated by using a hardened version of sha1, but it was decided to also prepare to transition to sha256 which should be more resistant to such attacks.

mati865 commented 1 week ago

It fails because gitoxide doesn't support SHA 256 yet: https://github.com/GitoxideLabs/gitoxide/issues/281