summaryrefslogtreecommitdiffstatshomepage
path: root/ui-patch.c
Commit message (Expand)AuthorAge
* Switch to exclusively using global ctxLukas Fleischer2014-01-17
* Update copyright informationLukas Fleischer2014-01-08
* ui-patch.c: Add additional newline after each patchLukas Fleischer2013-08-26
* ui-patch.c: Fix signature delimiterLukas Fleischer2013-08-26
* ui-patch.c: Fix formatting for merge commitsLukas Fleischer2013-08-22
* ui-patch: Rename variablesLukas Fleischer2013-08-20
* Allow for creating patch seriesLukas Fleischer2013-08-20
* ui-patch.c: Use log_tree_commit() to generate diffsLukas Fleischer2013-08-20
* Extract filepair_cb from ui-patch.cLukas Fleischer2013-08-16
* Convert cgit_print_error to a variadic functionJohn Keeping2013-04-08
* Always #include corresponding .h in .c filesJohn Keeping2013-04-08
* ui-patch: use cgit_version not CGIT_VERSIONJohn Keeping2013-03-20
* Format git diff headers correctly when adding or removing files.Michael Halstead2012-11-15
* Add URL parameter 'ignorews' for optionally ignoring whitespace in diffsJohan Herland2010-07-18
* Add URL parameter 'context' for changing the number of context lines in diffsJohan Herland2010-06-19
* ui-patch: Apply path limit to generated patchJohan Herland2010-06-19
* Introduce noplainemail option to hide email adresses from spambotsMartin Szulecki2009-08-08
* Handle binary files in diffsLars Hjemli2009-01-31
* ui-patch: whitespace changes in the patch generation codeTomas Carnecky2008-12-30
* Added `local-time` option to cgitrcStefan Naewe2008-08-01
* Merge branch 'lh/cleanup'Lars Hjemli2008-04-08
|\
| * Add ui-shared.hLars Hjemli2008-03-24
| * Remove obsolete cacheitem parameter to ui-functionsLars Hjemli2008-03-24
| * Add struct cgit_page to cgit_contextLars Hjemli2008-03-24
| * Introduce html.hLars Hjemli2008-03-18
| * Introduce struct cgit_contextLars Hjemli2008-02-16
* | Fix segfault in patch view for root commitLars Hjemli2008-03-17
|/
* Check for NULL-subject in patch viewLars Hjemli2008-01-10
* Add plain patch viewLars Hjemli2007-12-11
_print_commit(char *hex) { struct commit *commit, *parent; struct commitinfo *info; struct commit_list *p; unsigned char sha1[20]; char *tmp; int parents = 0; if (!hex) hex = ctx.qry.head; if (get_sha1(hex, sha1)) { cgit_print_error(fmt("Bad object id: %s", hex)); return; } commit = lookup_commit_reference(sha1); if (!commit) { cgit_print_error(fmt("Bad commit reference: %s", hex)); return; } info = cgit_parse_commit(commit); html("<table summary='commit info' class='commit-info'>\n"); html("<tr><th>author</th><td>"); html_txt(info->author); html(" "); html_txt(info->author_email); html("</td><td class='right'>"); cgit_print_date(info->author_date, FMT_LONGDATE, ctx.cfg.local_time); html("</td></tr>\n"); html("<tr><th>committer</th><td>"); html_txt(info->committer); html(" "); html_txt(info->committer_email); html("</td><td class='right'>"); cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time); html("</td></tr>\n"); html("<tr><th>commit</th><td colspan='2' class='sha1'>"); tmp = sha1_to_hex(commit->object.sha1); cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp); html(" ("); cgit_patch_link("patch", NULL, NULL, NULL, tmp); html(")</td></tr>\n"); html("<tr><th>tree</th><td colspan='2' class='sha1'>"); tmp = xstrdup(hex); cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, ctx.qry.head, tmp, NULL); html("</td></tr>\n"); for (p = commit->parents; p ; p = p->next) { parent = lookup_commit_reference(p->item->object.sha1); if (!parent) { html("<tr><td colspan='3'>"); cgit_print_error("Error reading parent commit"); html("</td></tr>"); continue; } html("<tr><th>parent</th>" "<td colspan='2' class='sha1'>"); cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL, ctx.qry.head, sha1_to_hex(p->item->object.sha1)); html(" ("); cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, sha1_to_hex(p->item->object.sha1), NULL); html(")</td></tr>"); parents++; } if (ctx.repo->snapshots) { html("<tr><th>download</th><td colspan='2' class='sha1'>"); cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, hex, ctx.repo->snapshots); html("</td></tr>"); } html("</table>\n"); html("<div class='commit-subject'>"); html_txt(info->subject); html("</div>"); html("<div class='commit-msg'>"); html_txt(info->msg); html("</div>"); if (parents < 3) { if (parents) tmp = sha1_to_hex(commit->parents->item->object.sha1); else tmp = NULL; cgit_print_diff(ctx.qry.sha1, tmp, NULL); } cgit_free_commitinfo(info); }