summaryrefslogtreecommitdiffstatshomepage
path: root/cache.c
Commit message (Expand)AuthorAge
* Update copyright informationLukas Fleischer2014-01-08
* cache.c: cache ls_cache output properlyJohn Keeping2013-05-22
* cache.c: fix cache_lsJohn Keeping2013-05-18
* use struct strbuf instead of static buffersJohn Keeping2013-04-08
* Mark several functions/variables staticLukas Fleischer2013-03-04
* White space around control verbs.Jason A. Donenfeld2013-03-04
* Fix several whitespace errorsLukas Fleischer2013-03-04
* Fix some warnings to allow -WerrorRamsay Jones2008-11-06
* cache.c: use %zd for off_t argumentLars Hjemli2008-09-01
* cache.c: fix error checking in print_slot()Lars Hjemli2008-05-20
* cache.c: do not ignore errors from print_slot()Lars Hjemli2008-05-18
* cache.c: use xread()/xwrite() from libgitLars Hjemli2008-05-18
* cache.c: make all io-related functions return errno on errorLars Hjemli2008-05-18
* cache.c: read(2) returns -1 on error, not 0Lars Hjemli2008-05-18
* Add page 'ls_cache'Lars Hjemli2008-04-28
* Redesign the caching layerLars Hjemli2008-04-28
* Add cache.hLars Hjemli2008-03-27
* Move cgit_repo into cgit_contextLars Hjemli2008-02-16
* Add all config variables into struct cgit_contextLars Hjemli2008-02-16
* Introduce struct cgit_contextLars Hjemli2008-02-16
* cache_safe_filename() needs more buffersLars Hjemli2007-05-18
* Enable url=value querystring parameterLars Hjemli2007-05-18
* Remove troublesome chars from cachefile namesLars Hjemli2007-01-12
* Move cache_prepare() to cgitLars Hjemli2007-01-12
* Allow relative paths for cgit_cache_rootLars Hjemli2006-12-16
* cache_lock: do xstrdup/free on lockfileLars Hjemli2006-12-12
* Don't truncate valid cachefilesLars Hjemli2006-12-11
* Avoid infinite loops in caching layerLars Hjemli2006-12-11
* Fix cache algorithm loopholeLars Hjemli2006-12-11
* Add license file and copyright noticesLars Hjemli2006-12-10
* Add caching infrastructureLars Hjemli2006-12-10
ss="cm"> * (see COPYING for full license text) */ #include "cgit.h" #include "ui-tag.h" #include "html.h" #include "ui-shared.h" static void print_tag_content(char *buf) { char *p; if (!buf) return; html("<div class='commit-subject'>"); p = strchr(buf, '\n'); if (p) *p = '\0'; html_txt(buf); html("</div>"); if (p) { html("<div class='commit-msg'>"); html_txt(++p); html("</div>"); } } static void print_download_links(char *revname) { html("<tr><th>download</th><td class='sha1'>"); cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, revname, ctx.repo->snapshots); html("</td></tr>"); } void cgit_print_tag(char *revname) { struct strbuf fullref = STRBUF_INIT; unsigned char sha1[20]; struct object *obj; struct tag *tag; struct taginfo *info; if (!revname) revname = ctx.qry.head; strbuf_addf(&fullref, "refs/tags/%s", revname); if (get_sha1(fullref.buf, sha1)) { cgit_print_error("Bad tag reference: %s", revname); goto cleanup; } obj = parse_object(sha1); if (!obj) { cgit_print_error("Bad object id: %s", sha1_to_hex(sha1)); goto cleanup; } if (obj->type == OBJ_TAG) { tag = lookup_tag(sha1); if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { cgit_print_error("Bad tag object: %s", revname); goto cleanup; } html("<table class='commit-info'>\n"); htmlf("<tr><td>tag name</td><td>"); html_txt(revname); htmlf(" (%s)</td></tr>\n", sha1_to_hex(sha1)); if (info->tagger_date > 0) { html("<tr><td>tag date</td><td>"); cgit_print_date(info->tagger_date, FMT_LONGDATE, ctx.cfg.local_time); html("</td></tr>\n"); } if (info->tagger) { html("<tr><td>tagged by</td><td>"); html_txt(info->tagger); if (info->tagger_email && !ctx.cfg.noplainemail) { html(" "); html_txt(info->tagger_email); } html("</td></tr>\n"); } html("<tr><td>tagged object</td><td class='sha1'>"); cgit_object_link(tag->tagged); html("</td></tr>\n"); if (ctx.repo->snapshots) print_download_links(revname); html("</table>\n"); print_tag_content(info->msg); } else { html("<table class='commit-info'>\n"); htmlf("<tr><td>tag name</td><td>"); html_txt(revname); html("</td></tr>\n"); html("<tr><td>Tagged object</td><td class='sha1'>"); cgit_object_link(obj); html("</td></tr>\n"); if (ctx.repo->snapshots) print_download_links(revname); html("</table>\n"); } cleanup: strbuf_release(&fullref); }