-
Notifications
You must be signed in to change notification settings - Fork 130
Add GITSHA1 digest function. #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
GITSHA1 is the digest function used by git. Details here: https://git-scm.com/book/be/v2/Git-Internals-Git-Objects.
|
@jgalmes2 could you provide a but more context here? What is your use case? this was previously discussed in the working group and the decision was to hold until there are more interest |
|
We're trying to integrate Bazel with a remote execution engine whose native hashing algorithm is GITSHA1. |
|
Did you have a conversation with Bazel team about adding such a digest function? Im also curious, how do you do the collision detection? afaik SHA1 in Git is modified with collision in mind. Btw, if you are just looking for git-interop, worth noting that Git upstream dev branches have a few patch sets that include sha256 inter-op with sha1. There has been a bit of progress there in recent months. I wonder if we can do GITSHA256 instead? |
|
Oh yeah Lukács Berki and Chi Wang are fully aware of this change. @lberki @coeuvre |
This used to be the standard until 2017. The problem with probable collision attacks is that most CAS implementations today tend to assume a strong, collision-free cryptographic hash in use, thus skipping on collision check. At the very least, GITSHA1 should be defined as https://github.com/git/git/blob/master/sha1dc/sha1.h, which comes with additional checks against collision attacks. Im also curious: Do you use git tree objects or DirectoryNode proto to present file trees here? |
|
My $.02: I do realize SHA-1 is quite long in the tooth these days. However, my understanding is that migrating a large code base is non-trivial since it changes every commithash and it looks like GitHub doesn't even support SHA-256? In addition to the above adoption concerns, SHA-1 will always be an opt-in on the Bazel side so the default is a secure hash. Does this allay your concerns? |
GITSHA1 is the digest function used by git.
Details here: https://git-scm.com/book/be/v2/Git-Internals-Git-Objects.