Skip to content
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

Remove GetGitRevisionDescription.cmake #416

Merged
merged 1 commit into from Dec 27, 2014
Merged

Remove GetGitRevisionDescription.cmake #416

merged 1 commit into from Dec 27, 2014

Conversation

Ereski
Copy link

@Ereski Ereski commented Dec 27, 2014

GetGitRevisionDescription.cmake uses a somewhat contrived method to obtain the
hash of the commit pointed by the repository's HEAD. This method fails on
unusual, but still valid repository layouts.

This commit removes cmake/GetGitRevisionDescription.cmake{,.in}, replacing its
functionality with direct use of Git's plumbing.

GetGitRevisionDescription.cmake uses a somewhat contrived method to obtain the
hash of the commit pointed by the repository's HEAD. This method fails on
unusual, but still valid repository layouts.

This commit removes cmake/GetGitRevisionDescription.cmake{,.in}, replacing its
functionality with direct use of Git's plumbing.
@zinnschlag
Copy link
Contributor

I don't understand what problem this change is supposed to fix.

This method fails on
unusual, but still valid repository layouts.

Okay, but it works with the OpenMW repository layout, right? So we actually do not need to change anything.

@Ereski
Copy link
Author

Ereski commented Dec 27, 2014

Sorry, bad wording. It's the layout of the .git directory. It fails if it is not actually a directory (.git can actually be a file), or if the refs are packed and .git/logs/refs/heads/<branch> doesn't exist. In other words, it tries to get the information in a completely ad-hoc way, failing on valid repositories that deviate from the author's expectations. Case in point: it did fail on my machine.

OTOH, Git already knows how to handle every corner case.

@zinnschlag zinnschlag merged commit d92cd2f into OpenMW:master Dec 27, 2014
@Ereski Ereski deleted the remove-git-cmake-module branch December 27, 2014 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants