1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-26 07:13:08 +02:00

eeshow/git-hist.c (vcs_git_get_rev), git-hist.h: revision string from history

This commit is contained in:
Werner Almesberger 2016-08-06 01:18:43 -03:00
parent a58bc93d69
commit 8fb867105c
2 changed files with 10 additions and 0 deletions

View File

@ -187,6 +187,15 @@ struct hist *vcs_git_hist(const char *path)
}
char *vcs_git_get_rev(struct hist *h)
{
const git_oid *oid = git_commit_id(h->commit);
char *s = alloc_size(GIT_OID_HEXSZ + 1);
return git_oid_tostr(s, GIT_OID_HEXSZ + 1, oid);
}
const char *vcs_git_summary(struct hist *h)
{
const char *summary;

View File

@ -33,6 +33,7 @@ struct hist {
bool vcs_git_try(const char *path);
struct hist *vcs_git_hist(const char *path);
char *vcs_git_get_rev(struct hist *h);
const char *vcs_git_summary(struct hist *hist);
void hist_iterate(struct hist *h,
void (*fn)(void *user, struct hist *h), void *user);