From 46ff6e1993175057a18b14980696648a1c5e87ab Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 23 Feb 2016 15:14:06 +0100 Subject: [PATCH 01/16] css: fix indentation --- cgit.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cgit.css b/cgit.css index 942c9be..66c6d53 100644 --- a/cgit.css +++ b/cgit.css @@ -18,7 +18,7 @@ div#cgit a:hover { } div#cgit table { - border-collapse: collapse; + border-collapse: collapse; } div#cgit table#header { @@ -803,9 +803,9 @@ div#cgit table.ssdiff td.head div.head { div#cgit table.ssdiff td.foot { border-top: solid 1px #aaa; - border-left: none; - border-right: none; - border-bottom: none; + border-left: none; + border-right: none; + border-bottom: none; } div#cgit table.ssdiff td.space { -- 2.50.1 From c424b5cb0253d8b55d3932efa51aa703dab2bf40 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 23 Feb 2016 15:35:32 +0100 Subject: [PATCH 02/16] tabs: do not use target=_blank --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-shared.c b/ui-shared.c index 2c91e75..3b2dc06 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1000,7 +1000,7 @@ void cgit_print_pageheader(void) if (ctx.repo->homepage) { html("homepage"); + html("'>homepage"); } html(""); html("
Date: Fri, 26 Feb 2016 13:24:35 +0100 Subject: [PATCH 04/16] ui-shared: redirect should not exit early for cache Signed-off-by: Jason A. Donenfeld --- ui-shared.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ui-shared.c b/ui-shared.c index 3b2dc06..9a38aa9 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -702,7 +702,6 @@ void cgit_redirect(const char *url, bool permanent) html("Location: "); html_url_path(url); html("\n\n"); - exit(0); } static void print_rel_vcs_link(const char *url) -- 2.50.1 From 39735d95ca8775204ed4c5f306009707f7da79c6 Mon Sep 17 00:00:00 2001 From: Matt Comben Date: Tue, 8 Mar 2016 12:05:09 +0000 Subject: [PATCH 05/16] Renamed repo-specific configuration for enable-html-serving in cgitrc.5.txt --- cgitrc.5.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 94901bd..2e1912d 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -523,7 +523,7 @@ repo.enable-subject-links:: A flag which can be used to override the global setting `enable-subject-links'. Default value: none. -enable-html-serving:: +repo.enable-html-serving:: A flag which can be used to override the global setting `enable-html-serving`. Default value: none. -- 2.50.1 From 499b23979cd29513df16e4c2acce934932e09f7a Mon Sep 17 00:00:00 2001 From: Tim Nordell Date: Fri, 26 Feb 2016 14:57:30 -0600 Subject: [PATCH 06/16] ui-log: Do not always emit decoration span The decoration span does not need to be emited if there aren't any decorations to show. This modification saves slightly on bandwidth. Signed-off-by: Tim Nordell --- ui-log.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui-log.c b/ui-log.c index 0a3938b..641a5b6 100644 --- a/ui-log.c +++ b/ui-log.c @@ -61,6 +61,8 @@ void show_commit_decorations(struct commit *commit) buf[sizeof(buf) - 1] = 0; deco = get_name_decoration(&commit->object); + if (!deco) + return; html(""); while (deco) { if (starts_with(deco->name, "refs/heads/")) { -- 2.50.1 From 59d8fa1a62e7c19911fdf7ee9ceb0fdf8fa3331c Mon Sep 17 00:00:00 2001 From: Tim Nordell Date: Fri, 26 Feb 2016 14:58:41 -0600 Subject: [PATCH 07/16] ui-log: Simplify decoration code The decoration code inside of git returns the decoration type, so utilize this to create the decoration spans. Additionally, use prettify_refname(...) to get the shorter name for the ref. Signed-off-by: Tim Nordell --- ui-log.c | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/ui-log.c b/ui-log.c index 641a5b6..d6d94f6 100644 --- a/ui-log.c +++ b/ui-log.c @@ -65,36 +65,34 @@ void show_commit_decorations(struct commit *commit) return; html(""); while (deco) { - if (starts_with(deco->name, "refs/heads/")) { - strncpy(buf, deco->name + 11, sizeof(buf) - 1); + strncpy(buf, prettify_refname(deco->name), sizeof(buf) - 1); + switch(deco->type) { + case DECORATION_NONE: + /* If the git-core doesn't recognize it, + * don't display anything. */ + break; + case DECORATION_REF_LOCAL: cgit_log_link(buf, NULL, "branch-deco", buf, NULL, - ctx.qry.vpath, 0, NULL, NULL, - ctx.qry.showmsg, 0); - } - else if (starts_with(deco->name, "tag: refs/tags/")) { - strncpy(buf, deco->name + 15, sizeof(buf) - 1); - cgit_tag_link(buf, NULL, "tag-deco", buf); - } - else if (starts_with(deco->name, "refs/tags/")) { - strncpy(buf, deco->name + 10, sizeof(buf) - 1); + ctx.qry.vpath, 0, NULL, NULL, + ctx.qry.showmsg, 0); + break; + case DECORATION_REF_TAG: cgit_tag_link(buf, NULL, "tag-deco", buf); - } - else if (starts_with(deco->name, "refs/remotes/")) { + break; + case DECORATION_REF_REMOTE: if (!ctx.repo->enable_remote_branches) - goto next; - strncpy(buf, deco->name + 13, sizeof(buf) - 1); + break; cgit_log_link(buf, NULL, "remote-deco", NULL, - oid_to_hex(&commit->object.oid), - ctx.qry.vpath, 0, NULL, NULL, - ctx.qry.showmsg, 0); - } - else { - strncpy(buf, deco->name, sizeof(buf) - 1); + oid_to_hex(&commit->object.oid), + ctx.qry.vpath, 0, NULL, NULL, + ctx.qry.showmsg, 0); + break; + default: cgit_commit_link(buf, NULL, "deco", ctx.qry.head, - oid_to_hex(&commit->object.oid), - ctx.qry.vpath); + oid_to_hex(&commit->object.oid), + ctx.qry.vpath); + break; } -next: deco = deco->next; } html(""); -- 2.50.1 From 86bf5b47916fbe53fe637d7181e93a34d2ad6d0c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 30 Apr 2016 16:57:51 +0200 Subject: [PATCH 08/16] git: update to v2.8.2 Update to git version v2.8.2. * Upstream commit 1a0c8dfd89475d6bb09ddee8c019cf0ae5b3bdc2 (strbuf: give strbuf_getline() to the "most text friendly" variant) changed API. Signed-off-by: Christian Hesse --- Makefile | 2 +- git | 2 +- scan-tree.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c01701c..a7aa08b 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.7.2 +GIT_VER = 2.8.2 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz INSTALL = install COPYTREE = cp -r diff --git a/git b/git index 326e5bc..60115f5 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 326e5bc91eecf73234ead29636207bc516573e79 +Subproject commit 60115f54bda3a127ed3cc8ffc6ab6c771cbceb1b diff --git a/scan-tree.c b/scan-tree.c index 2e87999..1cb4e5d 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -246,7 +246,7 @@ void scan_projects(const char *path, const char *projectsfile, repo_config_fn fn projectsfile, strerror(errno), errno); return; } - while (strbuf_getline(&line, projects, '\n') != EOF) { + while (strbuf_getline(&line, projects) != EOF) { if (!line.len) continue; strbuf_insert(&line, 0, "/", 1); -- 2.50.1 From 80f12b3e7e43edcb06aea9811b790b16ca204c81 Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Wed, 11 May 2016 17:50:09 +0000 Subject: [PATCH 09/16] ui-shared: Simplify cgit_print_error_page() logic --- ui-shared.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index 9a38aa9..bf92747 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -792,13 +792,11 @@ void cgit_print_error_page(int code, const char *msg, const char *fmt, ...) ctx.page.expires = ctx.cfg.cache_dynamic_ttl; ctx.page.status = code; ctx.page.statusmsg = msg; - cgit_print_http_headers(); - cgit_print_docstart(); - cgit_print_pageheader(); + cgit_print_layout_start(); va_start(ap, fmt); cgit_vprint_error(fmt, ap); va_end(ap); - cgit_print_docend(); + cgit_print_layout_end(); } void cgit_print_layout_start(void) -- 2.50.1 From 8d05b398bb1f4effcb59dddc62a3ea1f021f8631 Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Wed, 11 May 2016 18:04:14 +0000 Subject: [PATCH 10/16] ui-shared: HTML-ize DOCTYPE and Get rid of the XHTML headers, bringing cgit slowly to the modern age of HTML. --- ui-shared.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index bf92747..1529ff1 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -12,8 +12,7 @@ #include "html.h" static const char cgit_doctype[] = -"\n"; +"\n"; static char *http_date(time_t t) { @@ -723,7 +722,7 @@ void cgit_print_docstart(void) char *host = cgit_hosturl(); html(cgit_doctype); - html("\n"); + html("\n"); html("\n"); html(""); html_txt(ctx.page.title); -- 2.50.1 From 9afda36ed72083febca5e1a249b7f9f09205fe16 Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi <wub@partyvan.eu> Date: Wed, 11 May 2016 18:04:18 +0000 Subject: [PATCH 11/16] ui-shared: Remove a name attribute with an empty value The name attribute is optional in an input element, but it must not be an empty value. See: https://html.spec.whatwg.org/#attr-fe-name See: https://html.spec.whatwg.org/#the-input-element --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-shared.c b/ui-shared.c index 1529ff1..770b685 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -944,7 +944,7 @@ static void print_header(void) if (ctx.repo->enable_remote_branches) for_each_remote_ref(print_branch_option, ctx.qry.head); html("</select> "); - html("<input type='submit' name='' value='switch'/>"); + html("<input type='submit' value='switch'/>"); html("</form>"); } } else -- 2.50.1 From c34e28835bc06ea9f76f440909f59a697910e9e8 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" <Jason@zx2c4.com> Date: Thu, 12 May 2016 21:29:40 +0200 Subject: [PATCH 12/16] forms: action should not be empty Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> --- ui-shared.c | 2 +- ui-stats.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index 770b685..2c88b72 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -937,7 +937,7 @@ static void print_header(void) cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL); if (ctx.env.authenticated) { html("</td><td class='form'>"); - html("<form method='get' action=''>\n"); + html("<form method='get'>\n"); cgit_add_hidden_formfields(0, 1, ctx.qry.page); html("<select name='h' onchange='this.form.submit();'>\n"); for_each_branch_ref(print_branch_option, ctx.qry.head); diff --git a/ui-stats.c b/ui-stats.c index 8cd9178..7acd358 100644 --- a/ui-stats.c +++ b/ui-stats.c @@ -389,7 +389,7 @@ void cgit_show_stats(void) cgit_print_layout_start(); html("<div class='cgit-panel'>"); html("<b>stat options</b>"); - html("<form method='get' action=''>"); + html("<form method='get'>"); cgit_add_hidden_formfields(1, 0, "stats"); html("<table><tr><td colspan='2'/></tr>"); if (ctx.repo->max_stats > 1) { -- 2.50.1 From 21bf30b043c5bcbf4bb92d7e79cb642ab9c2287d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" <Jason@zx2c4.com> Date: Thu, 12 May 2016 21:38:59 +0200 Subject: [PATCH 13/16] ui-diff: action='.' is not correct Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> --- ui-diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-diff.c b/ui-diff.c index 52ed942..edee793 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -340,7 +340,7 @@ void cgit_print_diff_ctrls(void) html("<div class='cgit-panel'>"); html("<b>diff options</b>"); - html("<form method='get' action='.'>"); + html("<form method='get'>"); cgit_add_hidden_formfields(1, 0, ctx.qry.page); html("<table>"); html("<tr><td colspan='2'/></tr>"); -- 2.50.1 From 41508c091186ece4cdc5d79c5ac0d2eda3d3edef Mon Sep 17 00:00:00 2001 From: Christian Hesse <mail@eworm.de> Date: Thu, 19 May 2016 23:12:03 +0200 Subject: [PATCH 14/16] git: update to v2.8.3 Update to git version v2.8.3, no changes required. Signed-off-by: Christian Hesse <mail@eworm.de> --- Makefile | 2 +- git | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a7aa08b..23f5bc1 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = <openssl/sha.h> -GIT_VER = 2.8.2 +GIT_VER = 2.8.3 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz INSTALL = install COPYTREE = cp -r diff --git a/git b/git index 60115f5..0f8e831 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 60115f54bda3a127ed3cc8ffc6ab6c771cbceb1b +Subproject commit 0f8e831356d4f1a34baf46bb1a6b2d4c89ec9cb8 -- 2.50.1 From a6572ce1762e0d571c3e96b5f4eff7c81015a1f2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" <Jason@zx2c4.com> Date: Tue, 7 Jun 2016 14:31:09 +0200 Subject: [PATCH 15/16] Bump version. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 23f5bc1..30c1dfa 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ all:: -CGIT_VERSION = v0.12 +CGIT_VERSION = v1.0 CGIT_SCRIPT_NAME = cgit.cgi CGIT_SCRIPT_PATH = /var/www/htdocs/cgit CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) -- 2.50.1 From d88ec849c4f7af41a8a41af1a4f79a2b4d41717a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" <Jason@zx2c4.com> Date: Wed, 24 Feb 2016 18:01:42 +0100 Subject: [PATCH 16/16] Hosted on HTTPS now --- README | 4 ++-- cgit.c | 2 +- filters/gentoo-ldap-authentication.lua | 2 +- ui-shared.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README b/README index 917d74a..7a6b4a4 100644 --- a/README +++ b/README @@ -92,8 +92,8 @@ the HTTP headers `Modified` and `Expires`. Online presence --------------- -* The cgit homepage is hosted by cgit at <http://git.zx2c4.com/cgit/about/> +* The cgit homepage is hosted by cgit at <https://git.zx2c4.com/cgit/about/> * Patches, bug reports, discussions and support should go to the cgit mailing list: <cgit@lists.zx2c4.com>. To sign up, visit - <http://lists.zx2c4.com/mailman/listinfo/cgit> + <https://lists.zx2c4.com/mailman/listinfo/cgit> diff --git a/cgit.c b/cgit.c index fc482be..ab3fadb 100644 --- a/cgit.c +++ b/cgit.c @@ -941,7 +941,7 @@ static void cgit_parse_args(int argc, const char **argv) for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "--version")) { - printf("CGit %s | http://git.zx2c4.com/cgit/\n\nCompiled in features:\n", CGIT_VERSION); + printf("CGit %s | https://git.zx2c4.com/cgit/\n\nCompiled in features:\n", CGIT_VERSION); #ifdef NO_LUA printf("[-] "); #else diff --git a/filters/gentoo-ldap-authentication.lua b/filters/gentoo-ldap-authentication.lua index fce5632..6d8eb3e 100644 --- a/filters/gentoo-ldap-authentication.lua +++ b/filters/gentoo-ldap-authentication.lua @@ -4,7 +4,7 @@ -- luacrypto >= 0.3 -- <http://mkottman.github.io/luacrypto/> -- lualdap >= 1.2 --- <http://git.zx2c4.com/lualdap/about/> +-- <https://git.zx2c4.com/lualdap/about/> -- diff --git a/ui-shared.c b/ui-shared.c index 2c88b72..562fa0e 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -776,7 +776,7 @@ void cgit_print_docend(void) if (ctx.cfg.footer) html_include(ctx.cfg.footer); else { - htmlf("<div class='footer'>generated by <a href='http://git.zx2c4.com/cgit/about/'>cgit %s</a> at ", + htmlf("<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit %s</a> at ", cgit_version); html_txt(show_date(time(NULL), 0, cgit_date_mode(DATE_ISO8601))); html("</div>\n"); -- 2.50.1