From 8bf328befabb4d95fa7bf8036f6309e4cd26570d Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 23 Feb 2016 20:44:00 +0100 Subject: [PATCH] atom feed: add link, move content order to bottom NOTE: using relative links violates the Atom specification, but relative links are convenient aswell. --- stagit.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/stagit.c b/stagit.c index fd9e937..c22cc17 100644 --- a/stagit.c +++ b/stagit.c @@ -507,6 +507,16 @@ printcommitatom(FILE *fp, struct commitinfo *ci) xmlencode(fp, ci->summary, strlen(ci->summary)); fputs("\n", fp); } + fprintf(fp, "", + ci->oid); + + if (ci->author) { + fputs("", fp); + xmlencode(fp, ci->author->name, strlen(ci->author->name)); + fputs("\n", fp); + xmlencode(fp, ci->author->email, strlen(ci->author->email)); + fputs("\n\n", fp); + } fputs("", fp); fprintf(fp, "commit %s\n", ci->oid); @@ -526,13 +536,7 @@ printcommitatom(FILE *fp, struct commitinfo *ci) xmlencode(fp, ci->msg, strlen(ci->msg)); } fputs("\n\n", fp); - if (ci->author) { - fputs("", fp); - xmlencode(fp, ci->author->name, strlen(ci->author->name)); - fputs("\n", fp); - xmlencode(fp, ci->author->email, strlen(ci->author->email)); - fputs("\n\n", fp); - } + fputs("\n", fp); }