}
void write_commits(const std::filesystem::path& base,
const startgit::repository& repo)
const startgit::repository& repo,
const startgit::branch& branch)
{
std::unordered_set<std::string> seen;
for (const auto& branch : repo.get_branches()) {
const git2wrap::object obj = repo.get().revparse(branch.get_name().c_str());
const git2wrap::object obj = repo.get().revparse(branch.get_name().c_str());
git2wrap::revwalk rwalk(repo.get());
rwalk.push(obj.get_id());
while (const auto commit = rwalk.next()) {
const auto hash = commit.get_id().get_hex_string(22);
git2wrap::revwalk rwalk(repo.get());
rwalk.push(obj.get_id());
while (const auto commit = rwalk.next()) {
const auto hash = commit.get_id().get_hex_string(22);
const auto [_, inserted] = seen.insert(hash);
if (!inserted) {
break;
}
const std::string filename = hash + ".html";
std::ofstream ofs(base / filename);
const std::string filename = hash + ".html";
std::ofstream ofs(base / filename);
write_header(ofs,
repo.get_name(),
branch.get_name(),
"Dimitrije Dobrota",
commit.get_summary());
write_title(ofs, repo, branch.get_name(), /*no_nav=*/true);
write_commit_diff(ofs, commit);
write_footer(ofs);
}
write_header(ofs,
repo.get_name(),
branch.get_name(),
"Dimitrije Dobrota",
commit.get_summary());
write_title(ofs, repo, branch.get_name(), "../");
write_commit_diff(ofs, commit);
write_footer(ofs);
}
}