Skip to content

Each hash implementation should define git_hash_global_init#5026

Merged
ethomson merged 1 commit into
libgit2:masterfrom
tenderlove:define-hash-global-init-consnstently
Mar 25, 2019
Merged

Each hash implementation should define git_hash_global_init#5026
ethomson merged 1 commit into
libgit2:masterfrom
tenderlove:define-hash-global-init-consnstently

Conversation

@tenderlove
Copy link
Copy Markdown
Contributor

This means the forward declaration isn't necessary. The forward
declaration can cause compilation errors as it conflicts with the
GIT_INLINE declaration (the signatures are different).

/cc @rafeca

This means the forward declaration isn't necessary.  The forward
declaration can cause compilation errors as it conflicts with the
`GIT_INLINE` declaration (the signatures are different).
@ethomson
Copy link
Copy Markdown
Member

This seems reasonable. But if you're using anything but SHA1DC then that's a Big Red Flag.

@ethomson
Copy link
Copy Markdown
Member

This seems reasonable. But if you're using anything but SHA1DC then that's a Big Red Flag.

Oh, I see. The only implementation that wouldn't throw a warning is the win32 implementation since it's the only one that's not GIT_INLINE'd?

OK. Seems reasonable enough.

@tenderlove
Copy link
Copy Markdown
Contributor Author

Oh, I see. The only implementation that wouldn't throw a warning is the win32 implementation since it's the only one that's not GIT_INLINE'd?

Yep, that's correct.

Looks like the x86 mingw build is failing due to what looks like a network error. I don't think the failure is related to this change.

@ethomson
Copy link
Copy Markdown
Member

Cool. Thanks!

@ethomson ethomson merged commit 7f1ba19 into libgit2:master Mar 25, 2019
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Mar 29, 2019

Yeah, this has also been part of #4438 👍 So thanks for this, less stuff to review in the other PR ;)

@csware
Copy link
Copy Markdown
Contributor

csware commented Apr 4, 2019

This commit makes compiling libgit2 with VS2017 15.9.10 fail:

libgit2\src\hash\hash_win32.h(145): error C2065: "hash_prov": undeclared identifier,
libgit2\src\hash\hash_win32.h(151): error C2065: "git_hash_global_shutdown": undeclared identifier
and
libgit2\src\global.h(36): error C2371: "git__on_shutdown": redefinition; different basic types

@ethomson
Copy link
Copy Markdown
Member

ethomson commented Apr 4, 2019

@csware I can't reproduce this, I'm building with VS 2017 (15.9.5) with no problem.

@ethomson
Copy link
Copy Markdown
Member

ethomson commented Apr 4, 2019

@csware Oh, I see. You must be building with the Win32 SHA1 provider.

First, I would encourage you not to do that. As Linus mentioned, Git doesn't use SHA1, it uses SHA1DC. We haven't removed the other options because it doesn't make sense given the impending move to SHA256.

Regardless, I'll push up a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants