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 { |