diff options
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | cgit.c | 5 | ||||
| -rw-r--r-- | cgit.css | 99 | ||||
| -rw-r--r-- | cgit.h | 2 | ||||
| -rw-r--r-- | cgitrc.5.txt | 4 | ||||
| -rw-r--r-- | ui-commit.c | 11 | ||||
| -rw-r--r-- | ui-diff.c | 62 | ||||
| -rw-r--r-- | ui-log.c | 4 | ||||
| -rw-r--r-- | ui-refs.c | 2 | ||||
| -rw-r--r-- | ui-shared.c | 34 | ||||
| -rw-r--r-- | ui-shared.h | 5 | ||||
| -rw-r--r-- | ui-ssdiff.c | 369 | ||||
| -rw-r--r-- | ui-ssdiff.h | 13 |
13 files changed, 586 insertions, 25 deletions
| @@ -93,6 +93,7 @@ OBJECTS += ui-refs.o | |||
| 93 | OBJECTS += ui-repolist.o | 93 | OBJECTS += ui-repolist.o |
| 94 | OBJECTS += ui-shared.o | 94 | OBJECTS += ui-shared.o |
| 95 | OBJECTS += ui-snapshot.o | 95 | OBJECTS += ui-snapshot.o |
| 96 | OBJECTS += ui-ssdiff.o | ||
| 96 | OBJECTS += ui-stats.o | 97 | OBJECTS += ui-stats.o |
| 97 | OBJECTS += ui-summary.o | 98 | OBJECTS += ui-summary.o |
| 98 | OBJECTS += ui-tag.o | 99 | OBJECTS += ui-tag.o |
| @@ -184,6 +184,8 @@ void config_cb(const char *name, const char *value) | |||
| 184 | ctx.cfg.summary_branches = atoi(value); | 184 | ctx.cfg.summary_branches = atoi(value); |
| 185 | else if (!strcmp(name, "summary-tags")) | 185 | else if (!strcmp(name, "summary-tags")) |
| 186 | ctx.cfg.summary_tags = atoi(value); | 186 | ctx.cfg.summary_tags = atoi(value); |
| 187 | else if (!strcmp(name, "side-by-side-diffs")) | ||
| 188 | ctx.cfg.ssdiff = atoi(value); | ||
| 187 | else if (!strcmp(name, "agefile")) | 189 | else if (!strcmp(name, "agefile")) |
| 188 | ctx.cfg.agefile = xstrdup(value); | 190 | ctx.cfg.agefile = xstrdup(value); |
| 189 | else if (!strcmp(name, "renamelimit")) | 191 | else if (!strcmp(name, "renamelimit")) |
| @@ -242,6 +244,8 @@ static void querystring_cb(const char *name, const char *value) | |||
| 242 | ctx.qry.showmsg = atoi(value); | 244 | ctx.qry.showmsg = atoi(value); |
| 243 | } else if (!strcmp(name, "period")) { | 245 | } else if (!strcmp(name, "period")) { |
| 244 | ctx.qry.period = xstrdup(value); | 246 | ctx.qry.period = xstrdup(value); |
| 247 | } else if (!strcmp(name, "ss")) { | ||
| 248 | ctx.qry.ssdiff = atoi(value); | ||
| 245 | } | 249 | } |
| 246 | } | 250 | } |
| 247 | 251 | ||
| @@ -284,6 +288,7 @@ static void prepare_context(struct cgit_context *ctx) | |||
| 284 | ctx->cfg.summary_branches = 10; | 288 | ctx->cfg.summary_branches = 10; |
| 285 | ctx->cfg.summary_log = 10; | 289 | ctx->cfg.summary_log = 10; |
| 286 | ctx->cfg.summary_tags = 10; | 290 | ctx->cfg.summary_tags = 10; |
| 291 | ctx->cfg.ssdiff = 0; | ||
| 287 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); | 292 | ctx->env.cgit_config = xstrdupn(getenv("CGIT_CONFIG")); |
| 288 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); | 293 | ctx->env.http_host = xstrdupn(getenv("HTTP_HOST")); |
| 289 | ctx->env.https = xstrdupn(getenv("HTTPS")); | 294 | ctx->env.https = xstrdupn(getenv("HTTPS")); |
| @@ -606,3 +606,102 @@ table.hgraph div.bar { | |||
| 606 | background-color: #eee; | 606 | background-color: #eee; |
| 607 | height: 1em; | 607 | height: 1em; |
| 608 | } | 608 | } |
| 609 | |||
| 610 | table.ssdiff { | ||
| 611 | width: 100%; | ||
| 612 | } | ||
| 613 | |||
| 614 | table.ssdiff td { | ||
| 615 | font-size: 75%; | ||
| 616 | font-family: monospace; | ||
| 617 | white-space: pre; | ||
| 618 | padding: 1px 4px 1px 4px; | ||
| 619 | border-left: solid 1px #aaa; | ||
| 620 | border-right: solid 1px #aaa; | ||
| 621 | } | ||
| 622 | |||
| 623 | table.ssdiff td.add { | ||
| 624 | color: black; | ||
| 625 | background: #cfc; | ||
| 626 | min-width: 50%; | ||
| 627 | } | ||
| 628 | |||
| 629 | table.ssdiff td.add_dark { | ||
| 630 | color: black; | ||
| 631 | background: #aca; | ||
| 632 | min-width: 50%; | ||
| 633 | } | ||
| 634 | |||
| 635 | table.ssdiff span.add { | ||
| 636 | background: #cfc; | ||
| 637 | font-weight: bold; | ||
| 638 | } | ||
| 639 | |||
| 640 | table.ssdiff td.del { | ||
| 641 | color: black; | ||
| 642 | background: #fcc; | ||
| 643 | min-width: 50%; | ||
| 644 | } | ||
| 645 | |||
| 646 | table.ssdiff td.del_dark { | ||
| 647 | color: black; | ||
| 648 | background: #caa; | ||
| 649 | min-width: 50%; | ||
| 650 | } | ||
| 651 | |||
| 652 | table.ssdiff span.del { | ||
| 653 | background: #fcc; | ||
| 654 | font-weight: bold; | ||
| 655 | } | ||
| 656 | |||
| 657 | table.ssdiff td.changed { | ||
| 658 | color: black; | ||
| 659 | background: #ffc; | ||
| 660 | min-width: 50%; | ||
| 661 | } | ||
| 662 | |||
| 663 | table.ssdiff td.changed_dark { | ||
| 664 | color: black; | ||
| 665 | background: #cca; | ||
| 666 | min-width: 50%; | ||
| 667 | } | ||
| 668 | |||
| 669 | table.ssdiff td.lineno { | ||
| 670 | color: black; | ||
| 671 | background: #eee; | ||
| 672 | text-align: right; | ||
| 673 | width: 3em; | ||
| 674 | min-width: 3em; | ||
| 675 | } | ||
| 676 | |||
| 677 | table.ssdiff td.hunk { | ||
| 678 | color: #black; | ||
| 679 | background: #ccf; | ||
| 680 | border-top: solid 1px #aaa; | ||
| 681 | border-bottom: solid 1px #aaa; | ||
| 682 | } | ||
| 683 | |||
| 684 | table.ssdiff td.head { | ||
| 685 | border-top: solid 1px #aaa; | ||
| 686 | border-bottom: solid 1px #aaa; | ||
| 687 | } | ||
| 688 | |||
| 689 | table.ssdiff td.head div.head { | ||
| 690 | font-weight: bold; | ||
| 691 | color: black; | ||
| 692 | } | ||
| 693 | |||
| 694 | table.ssdiff td.foot { | ||
| 695 | border-top: solid 1px #aaa; | ||
| 696 | border-left: none; | ||
| 697 | border-right: none; | ||
| 698 | border-bottom: none; | ||
| 699 | } | ||
| 700 | |||
| 701 | table.ssdiff td.space { | ||
| 702 | border: none; | ||
| 703 | } | ||
| 704 | |||
| 705 | table.ssdiff td.space div { | ||
| 706 | min-height: 3em; | ||
| 707 | } \ No newline at end of file | ||
| @@ -143,6 +143,7 @@ struct cgit_query { | |||
| 143 | int nohead; | 143 | int nohead; |
| 144 | char *sort; | 144 | char *sort; |
| 145 | int showmsg; | 145 | int showmsg; |
| 146 | int ssdiff; | ||
| 146 | }; | 147 | }; |
| 147 | 148 | ||
| 148 | struct cgit_config { | 149 | struct cgit_config { |
| @@ -195,6 +196,7 @@ struct cgit_config { | |||
| 195 | int summary_branches; | 196 | int summary_branches; |
| 196 | int summary_log; | 197 | int summary_log; |
| 197 | int summary_tags; | 198 | int summary_tags; |
| 199 | int ssdiff; | ||
| 198 | struct string_list mimetypes; | 200 | struct string_list mimetypes; |
| 199 | struct cgit_filter *about_filter; | 201 | struct cgit_filter *about_filter; |
| 200 | struct cgit_filter *commit_filter; | 202 | struct cgit_filter *commit_filter; |
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index e69140b..70e4c78 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
| @@ -245,6 +245,10 @@ section:: | |||
| 245 | after this option will inherit the current section name. Default value: | 245 | after this option will inherit the current section name. Default value: |
| 246 | none. | 246 | none. |
| 247 | 247 | ||
| 248 | side-by-side-diffs:: | ||
| 249 | If set to "1" shows side-by-side diffs instead of unidiffs per | ||
| 250 | default. Default value: "0". | ||
| 251 | |||
| 248 | snapshots:: | 252 | snapshots:: |
| 249 | Text which specifies the default set of snapshot formats generated by | 253 | Text which specifies the default set of snapshot formats generated by |
| 250 | cgit. The value is a space-separated list of zero or more of the | 254 | cgit. The value is a space-separated list of zero or more of the |
diff --git a/ui-commit.c b/ui-commit.c index f5b0ae5..b5e3c01 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
| @@ -58,9 +58,14 @@ void cgit_print_commit(char *hex) | |||
| 58 | html("</td></tr>\n"); | 58 | html("</td></tr>\n"); |
| 59 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); | 59 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); |
| 60 | tmp = sha1_to_hex(commit->object.sha1); | 60 | tmp = sha1_to_hex(commit->object.sha1); |
| 61 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp); | 61 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, 0); |
| 62 | html(" ("); | 62 | html(" ("); |
| 63 | cgit_patch_link("patch", NULL, NULL, NULL, tmp); | 63 | cgit_patch_link("patch", NULL, NULL, NULL, tmp); |
