Root/eeshow/file/git-hist.h

1/*
2 * file/git-hist.h - Retrieve revision history from GIT repo
3 *
4 * Written 2016 by Werner Almesberger
5 * Copyright 2016 by Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef FILE_GIT_HIST_H
14#define FILE_GIT_HIST_H
15
16#include <stdbool.h>
17
18#include <git2.h>
19
20
21struct hist {
22    struct git_commit *commit; /* NULL if uncommitted changes */
23
24    unsigned branch; /* branch index */
25
26    struct hist **newer;
27    unsigned n_newer;
28
29    struct hist **older;
30    unsigned n_older;
31};
32
33
34bool vcs_git_try(const char *path);
35struct hist *vcs_git_hist(const char *path);
36char *vcs_git_get_rev(struct hist *h);
37const char *vcs_git_summary(struct hist *hist);
38char *vcs_git_long_for_pango(struct hist *hist,
39    char *(*formatter)(const char *fmt, ...));
40void hist_iterate(struct hist *h,
41    void (*fn)(void *user, struct hist *h), void *user);
42void dump_hist(struct hist *h);
43
44#endif /* !FILE_GIT_HIST_H */
45

Archive Download this file

Branches:
master



interactive