Skip to content

Commit

Permalink
Don't store complete hash
Browse files Browse the repository at this point in the history
This change is technically not backwards compatible, it will print long hashes when using old indices
  • Loading branch information
RobinTF committed Feb 1, 2024
1 parent d042e57 commit 257f074
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/CompilationInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#pragma once
#include <string_view>
namespace qlever::version {
// The git hash of the commit that was used to QLever.
extern const std::string_view GitHash;
// Short version of GitHash
// Short version of the hash of the commit that was used to QLever.
extern const std::string_view GitShortHash;
// The date and time at which QLever was compiled.
extern const std::string_view DatetimeOfCompilation;
Expand Down
5 changes: 2 additions & 3 deletions src/index/IndexImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ void IndexImpl::setPrefixCompression(bool compressed) {
void IndexImpl::writeConfiguration() const {
// Copy the configuration and add the current commit hash.
auto configuration = configurationJson_;
configuration["git-hash"] = qlever::version::GitHash;
configuration["git-hash"] = qlever::version::GitShortHash;
configuration["index-format-version"] = qlever::indexFormatVersion;
auto f = ad_utility::makeOfstream(onDiskBase_ + CONFIGURATION_FILE);
f << configuration;
Expand All @@ -896,8 +896,7 @@ void IndexImpl::readConfiguration() {
f >> configurationJson_;
if (configurationJson_.find("git-hash") != configurationJson_.end()) {
LOG(INFO) << "The git hash used to build this index was "
<< configurationJson_["git-hash"].get<std::string_view>().substr(
0, 6)
<< configurationJson_["git-hash"].get<std::string_view>()
<< std::endl;
} else {
LOG(INFO) << "The index was built before git commit hashes were stored in "
Expand Down

0 comments on commit 257f074

Please sign in to comment.