From 673122b0d53c12a35b744d3891bc1b22cf398a1f Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 7 Dec 2015 19:46:07 +0100 Subject: [PATCH] highlight/make bold some fields --- style.css | 4 ++++ urmoms.c | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/style.css b/style.css index 5dc4a53..2481dec 100644 --- a/style.css +++ b/style.css @@ -48,6 +48,10 @@ pre { font-family: monospace; } +pre span.h { + color: blue; +} + pre span.i { color: green; } diff --git a/urmoms.c b/urmoms.c index 757bb38..e467fe5 100644 --- a/urmoms.c +++ b/urmoms.c @@ -165,15 +165,15 @@ printcommit(FILE *fp, git_commit *commit) /* TODO: show tag when commit has it */ git_oid_tostr(buf, sizeof(buf), git_commit_id(commit)); - fprintf(fp, "commit %s\n", + fprintf(fp, "commit %s\n", relpath, buf, buf); if (git_oid_tostr(buf, sizeof(buf), git_commit_parent_id(commit, 0))) - fprintf(fp, "parent %s\n", + fprintf(fp, "parent %s\n", relpath, buf, buf); if ((count = (int)git_commit_parentcount(commit)) > 1) { - fprintf(fp, "Merge:"); + fprintf(fp, "Merge:"); for (i = 0; i < count; ++i) { git_oid_tostr(buf, 8, git_commit_parent_id(commit, i)); fprintf(fp, " %s", @@ -182,13 +182,13 @@ printcommit(FILE *fp, git_commit *commit) fputc('\n', fp); } if ((sig = git_commit_author(commit)) != NULL) { - fprintf(fp, "Author: "); + fprintf(fp, "Author: "); xmlencode(fp, sig->name, strlen(sig->name)); fprintf(fp, " <email, strlen(sig->email)); fputs("\">", fp); xmlencode(fp, sig->email, strlen(sig->email)); - fputs(">\nDate: ", fp); + fputs(">\nDate: ", fp); printtime(fp, &sig->when); fputc('\n', fp); } @@ -238,7 +238,7 @@ printshowfile(git_commit *commit) if (!git_diff_get_stats(&diffstats, diff)) { if (!git_diff_stats_to_buf(&diffstatsbuf, diffstats, GIT_DIFF_STATS_FULL | GIT_DIFF_STATS_SHORT, 80)) { - fprintf(fp, "Diffstat:\n"); + fprintf(fp, "Diffstat:\n"); fputs(diffstatsbuf.ptr, fp); } git_diff_stats_free(diffstats); @@ -253,10 +253,12 @@ printshowfile(git_commit *commit) } delta = git_patch_get_delta(patch); - fprintf(fp, "diff --git a/%s b/%s\n", + fprintf(fp, "diff --git a/%s b/%s\n", relpath, delta->old_file.path, delta->old_file.path, relpath, delta->new_file.path, delta->new_file.path); + /* TODO: add --- and +++ lines */ + #if 0 switch (delta->flags) { case GIT_DIFF_FLAG_BINARY: @@ -273,7 +275,7 @@ printshowfile(git_commit *commit) if (git_patch_get_hunk(&hunk, &nhunklines, patch, j)) break; /* TODO: handle error ? */ - fprintf(fp, "%s\n", hunk->header); + fprintf(fp, "%s\n", hunk->header); for (k = 0; ; k++) { if (git_patch_get_line_in_hunk(&line, patch, j, k)) -- libgit2 1.1.1