forked from lix-project/lix
0f840483c7
This is primarily useful for version string generation, where we need a monotonically increasing number. The revcount is the preferred thing to use, but isn't available for GitHub flakes (since it requires fetching the entire history). The last commit timestamp OTOH can be extracted from GitHub tarballs.
24 lines
358 B
C++
24 lines
358 B
C++
#pragma once
|
|
|
|
#include "store-api.hh"
|
|
|
|
#include <regex>
|
|
|
|
namespace nix {
|
|
|
|
struct GitInfo
|
|
{
|
|
Path storePath;
|
|
std::string ref;
|
|
Hash rev{htSHA1};
|
|
uint64_t revCount;
|
|
time_t lastModified;
|
|
};
|
|
|
|
GitInfo exportGit(ref<Store> store, std::string uri,
|
|
std::optional<std::string> ref,
|
|
std::optional<Hash> rev,
|
|
const std::string & name);
|
|
|
|
}
|