summaryrefslogtreecommitdiff
path: root/file
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-10-30 17:25:53 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-10-30 17:25:53 (GMT)
commit08655f46fe0f737a0a1af457a2d9e6504307ac49 (patch)
tree1f3ae9658bbc40045114f6c0950bc22b7c65c7bb /file
parent96ef3e03ac812f3c0fbc863b89e860cd336a9293 (diff)
downloadeeshow-08655f46fe0f737a0a1af457a2d9e6504307ac49.zip
eeshow-08655f46fe0f737a0a1af457a2d9e6504307ac49.tar.gz
eeshow-08655f46fe0f737a0a1af457a2d9e6504307ac49.tar.bz2
file/git-hist.c (vcs_git_long_for_pango): optionally show full commit message
Diffstat (limited to 'file')
-rw-r--r--file/git-hist.c6
-rw-r--r--file/git-hist.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/file/git-hist.c b/file/git-hist.c
index 237fd19..93fe69f 100644
--- a/file/git-hist.c
+++ b/file/git-hist.c
@@ -379,7 +379,7 @@ static char *append(char *s, char *add)
*/
char *vcs_git_long_for_pango(const struct vcs_hist *h,
- char *(*formatter)(const char *fmt, ...))
+ char *(*formatter)(const char *fmt, ...), bool full)
{
git_buf buf = { 0 };
const git_signature *sig;
@@ -397,9 +397,11 @@ char *vcs_git_long_for_pango(const struct vcs_hist *h,
"%s<span background=\"#00e00080\"><b> %s </b></span>",
i ? " " : "", h->branches[i]));
s = append(s, formatter(
- "%s<b>%s</b> %s%s &lt;%s&gt;<small>\n%s</small>",
+ "%s<b>%s</b> %s%s &lt;%s&gt;<small>\n%s%s</small>",
h->n_branches ? "\n" : "",
buf.ptr, ctime(&sig->when.time), sig->name, sig->email,
+ full ? "\n" : "",
+ full ? git_commit_message(h->commit) :
git_commit_summary(h->commit)));
git_buf_free(&buf);
return s;
diff --git a/file/git-hist.h b/file/git-hist.h
index 908b2d6..da865a9 100644
--- a/file/git-hist.h
+++ b/file/git-hist.h
@@ -60,7 +60,7 @@ const char *vcs_git_summary(const struct vcs_hist *hist);
char *vcs_git_summary_for_pango(const struct vcs_hist *hist,
char *(*formatter)(const char *fmt, ...));
char *vcs_git_long_for_pango(const struct vcs_hist *hist,
- char *(*formatter)(const char *fmt, ...));
+ char *(*formatter)(const char *fmt, ...), bool full);
unsigned threads_number(const struct vcs_history *history);
enum thread *threads_classify(const struct vcs_history *history,