diff --git a/cgit.h b/cgit.h
index b6bedd3..9a7d495 100644
--- a/cgit.h
+++ b/cgit.h
@@ -142,6 +142,7 @@ struct commitinfo {
char *subject;
char *msg;
char *msg_encoding;
+ char *change_id;
};
struct taginfo {
diff --git a/parsing.c b/parsing.c
index 115ce81..2274dd7 100644
--- a/parsing.c
+++ b/parsing.c
@@ -169,8 +169,18 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
if (!ret->msg_encoding)
ret->msg_encoding = xstrdup("UTF-8");
- while (!end_of_header(p))
- p = next_header_line(p);
+ while (!end_of_header(p)) {
+ if (p && skip_prefix(p, "change-id ", &p)) {
+ t = strchr(p, '\n');
+ if (t) {
+ ret->change_id = substr(p, t + 1);
+ p = t + 1;
+ }
+ } else {
+ p = next_header_line(p);
+ }
+ }
+
while (p && *p == '\n')
p++;
if (!p)
diff --git a/shared.c b/shared.c
index 07b38ba..86be047 100644
--- a/shared.c
+++ b/shared.c
@@ -108,6 +108,9 @@ void cgit_free_commitinfo(struct commitinfo *info)
free(info->subject);
free(info->msg);
free(info->msg_encoding);
+ if (info->change_id) {
+ free(info->change_id);
+ }
free(info);
}
diff --git a/ui-commit.c b/ui-commit.c
index 5536ffc..12de4c7 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -73,7 +73,15 @@ void cgit_print_commit(char *hex, const char *prefix)
html_txt(show_date(info->committer_date, info->committer_tz,
cgit_date_mode(DATE_ISO8601)));
html("</td></tr>\n");
+
+ if (info->change_id) {
+ html("<tr><th>change</th><td colspan='2' class='sha1'>");
+ html_txt(info->change_id);
+ html("</td></tr>\n");
+ }
+
html("<tr><th>commit</th><td colspan='2' class='oid'>");
+
tmp = oid_to_hex(&commit->object.oid);
cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix);
html(" (");
|