]> git.armaanb.net Git - stagit.git/commitdiff
atom feed: use published for author commit date, updated for committer date
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 1 May 2016 15:20:54 +0000 (17:20 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 1 May 2016 15:20:54 +0000 (17:20 +0200)
this is the same as cgit.

stagit.c

index cb2c1c9ddca556c9d1fe7d9e3bd53678d29749fa..d63607794b50d38c2ea9ad14ea620b7bf0c114b1 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -29,6 +29,7 @@ struct commitinfo {
        char parentoid[GIT_OID_HEXSZ + 1];
 
        const git_signature *author;
+       const git_signature *committer;
        const char          *summary;
        const char          *msg;
 
@@ -169,6 +170,7 @@ commitinfo_getbyoid(const git_oid *id)
        git_oid_tostr(ci->parentoid, sizeof(ci->parentoid), git_commit_parent_id(ci->commit, 0));
 
        ci->author = git_commit_author(ci->commit);
+       ci->committer = git_commit_committer(ci->commit);
        ci->summary = git_commit_summary(ci->commit);
        ci->msg = git_commit_message(ci->commit);
 
@@ -613,8 +615,13 @@ printcommitatom(FILE *fp, struct commitinfo *ci)
 
        fprintf(fp, "<id>%s</id>\n", ci->oid);
        if (ci->author) {
-               fputs("<updated>", fp);
+               fputs("<published>", fp);
                printtimez(fp, &(ci->author->when));
+               fputs("</published>\n", fp);
+       }
+       if (ci->committer) {
+               fputs("<updated>", fp);
+               printtimez(fp, &(ci->committer->when));
                fputs("</updated>\n", fp);
        }
        if (ci->summary) {