summaryrefslogtreecommitdiffstatshomepage
path: root/cgit.c
Commit message (Expand)AuthorAge
...
* Fix search in repo index even if caching is enabledLars Hjemli2008-04-14
* Reset ctx.repo to NULL when the config parser is finishedLars Hjemli2008-04-08
* Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()Lars Hjemli2008-04-08
* Move function for configfile parsing into configfile.[ch]Lars Hjemli2008-03-28
* Add cache.hLars Hjemli2008-03-27
* Remove global and obsolete cgit_cmdLars Hjemli2008-03-25
* Move cgit_version from shared.c to cgit.cLars Hjemli2008-03-24
* Move non-generic functions from shared.c to cgit.cLars Hjemli2008-03-24
* Add ui-shared.hLars Hjemli2008-03-24
* Add command dispatcherLars 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
* Improve initialization of git directoryLars Hjemli2008-02-16
* 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
* Handle missing default branch and error out on invalid branch namesLars Hjemli2008-01-04
* Add plain patch viewLars Hjemli2007-12-11
* Teach log search about --grep, --author and --committerLars Hjemli2007-10-28
* Add support for refs viewLars Hjemli2007-10-27
* Add prefix parameter to cgit_print_diff()Lars Hjemli2007-10-01
* cgit_print_snapshot_links: use url to specify snapshot nameLars Hjemli2007-07-23
* Merge branch 'master' of git://git.klever.net/patchwork/cgitLars Hjemli2007-07-22
|\
| * allow selective enabling of snapshotsMichael Krelin2007-07-21
| * shorten snapshot names to repo basenameMichael Krelin2007-07-21
| * add support for snapshot tarballsMichael Krelin2007-07-18
* | Add ui-tag.cLars Hjemli2007-07-22
|/
* make config adjustable via env variable CGIT_CONFIGMichael Krelin2007-07-03
* Merge branch 'lh/menu'Lars Hjemli2007-06-29
|\
| * Include querystring as part of cached filename for repo summary pageLars Hjemli2007-06-18
* | Add version info from git-describeLars Hjemli2007-06-18
|/
* Add cgit_diff_link()Lars Hjemli2007-06-17
* ui-log: honor id=sha1 on querystringLars Hjemli2007-06-17
* Add cgit_commit_link() + support for id=sha1 to commit viewLars Hjemli2007-06-17
* ui-tree: unify with ui-view, use path to select tree/blobLars Hjemli2007-06-16
* Add option to disable pager to cgit_print_log().Ondrej Jirman2007-05-31
* Enable url=value querystring parameterLars Hjemli2007-05-18
* Move cgit_get_repoinfo into shared.cLars Hjemli2007-05-18
* Add support for commitdiff via h parameterLars Hjemli2007-05-16
* Change commit-view to expect h parameter, not idLars Hjemli2007-05-16
* Enable default value for head parameterLars Hjemli2007-05-16
* Don't hardcode urls when SCRIPT_NAME is availableLars Hjemli2007-05-15
* Let makefile override the configfile locationLars Hjemli2007-05-14
* cgit.c: fix whitespace breakageLars Hjemli2007-05-14
* Add log filtering by path and link to it from tree viewLars Hjemli2007-05-14
* Add commitdiff between commit and each of it's parentLars Hjemli2007-05-13
* Add max-commit-count parameter to cgitrcLars Hjemli2007-05-13
* Add support for downloading single blobsLars Hjemli2007-05-09
* ui-view: show pathname if specified in querystringLars Hjemli2007-05-08
span> htmlf("deleted file mode %.6o\n", mode1); if (!subproject) { abbrev1 = xstrdup(find_unique_abbrev(sha1, DEFAULT_ABBREV)); abbrev2 = xstrdup(find_unique_abbrev(sha2, DEFAULT_ABBREV)); htmlf("index %s..%s", abbrev1, abbrev2); free(abbrev1); free(abbrev2); if (mode1 != 0 && mode2 != 0) { htmlf(" %.6o", mode1); if (mode2 != mode1) htmlf("..%.6o", mode2); } htmlf("\n--- a/%s\n", path1); htmlf("+++ b/%s\n", path2); } } static void filepair_cb(struct diff_filepair *pair) { unsigned long old_size = 0; unsigned long new_size = 0; int binary = 0; header(pair->one->sha1, pair->one->path, pair->one->mode, pair->two->sha1, pair->two->path, pair->two->mode); if (S_ISGITLINK(pair->one->mode) || S_ISGITLINK(pair->two->mode)) { if (S_ISGITLINK(pair->one->mode)) print_line(fmt("-Subproject %s", sha1_to_hex(pair->one->sha1)), 52); if (S_ISGITLINK(pair->two->mode)) print_line(fmt("+Subproject %s", sha1_to_hex(pair->two->sha1)), 52); return; } if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size, &binary, 0, 0, print_line)) html("Error running diff"); if (binary) html("Binary files differ\n"); } void cgit_print_patch(char *hex, const char *prefix) { struct commit *commit; struct commitinfo *info; unsigned char sha1[20], old_sha1[20]; char *patchname; 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); if (commit->parents && commit->parents->item) hashcpy(old_sha1, commit->parents->item->object.sha1); else hashclr(old_sha1); patchname = fmt("%s.patch", sha1_to_hex(sha1)); ctx.page.mimetype = "text/plain"; ctx.page.filename = patchname; cgit_print_http_headers(&ctx); htmlf("From %s Mon Sep 17 00:00:00 2001\n", sha1_to_hex(sha1)); htmlf("From: %s", info->author); if (!ctx.cfg.noplainemail) { htmlf(" %s", info->author_email); } html("\n"); html("Date: "); cgit_print_date(info->author_date, "%a, %d %b %Y %H:%M:%S %z%n", ctx.cfg.local_time); htmlf("Subject: %s\n\n", info->subject); if (info->msg && *info->msg) { htmlf("%s", info->msg); if (info->msg[strlen(info->msg) - 1] != '\n') html("\n"); } html("---\n"); if (prefix) htmlf("(limited to '%s')\n\n", prefix); cgit_diff_tree(old_sha1, sha1, filepair_cb, prefix, 0); html("--\n"); htmlf("cgit %s\n", CGIT_VERSION); cgit_free_commitinfo(info); }