[PATCH 1/1] global: remove functionality we deprecated for cgit v1.0

Christian Hesse list at eworm.de
Mon Jun 18 11:51:41 CEST 2018


From: Christian Hesse <mail at eworm.de>

The man page states these were deprecated for v1.0. We are past v1.1,
so remove the functionality.

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 cgit.c        | 17 +++--------------
 cgit.h        |  3 ---
 cgitrc.5.txt  | 21 ---------------------
 ui-repolist.c |  3 ---
 ui-shared.c   |  2 --
 5 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/cgit.c b/cgit.c
index ca0a89c..223dfc8 100644
--- a/cgit.c
+++ b/cgit.c
@@ -111,7 +111,7 @@ static void config_cb(const char *name, const char *value)
 {
 	const char *arg;
 
-	if (!strcmp(name, "section") || !strcmp(name, "repo.group"))
+	if (!strcmp(name, "section"))
 		ctx.cfg.section = xstrdup(value);
 	else if (!strcmp(name, "repo.url"))
 		ctx.repo = cgit_add_repo(value);
@@ -139,20 +139,14 @@ static void config_cb(const char *name, const char *value)
 		ctx.cfg.header = xstrdup(value);
 	else if (!strcmp(name, "logo"))
 		ctx.cfg.logo = xstrdup(value);
-	else if (!strcmp(name, "index-header"))
-		ctx.cfg.index_header = xstrdup(value);
-	else if (!strcmp(name, "index-info"))
-		ctx.cfg.index_info = xstrdup(value);
 	else if (!strcmp(name, "logo-link"))
 		ctx.cfg.logo_link = xstrdup(value);
 	else if (!strcmp(name, "module-link"))
 		ctx.cfg.module_link = xstrdup(value);
 	else if (!strcmp(name, "strict-export"))
 		ctx.cfg.strict_export = xstrdup(value);
-	else if (!strcmp(name, "virtual-root")) {
+	else if (!strcmp(name, "virtual-root"))
 		ctx.cfg.virtual_root = ensure_end(value, '/');
-	} else if (!strcmp(name, "nocache"))
-		ctx.cfg.nocache = atoi(value);
 	else if (!strcmp(name, "noplainemail"))
 		ctx.cfg.noplainemail = atoi(value);
 	else if (!strcmp(name, "noheader"))
@@ -236,7 +230,7 @@ static void config_cb(const char *name, const char *value)
 	else if (!strcmp(name, "project-list"))
 		ctx.cfg.project_list = xstrdup(expand_macros(value));
 	else if (!strcmp(name, "scan-path"))
-		if (!ctx.cfg.nocache && ctx.cfg.cache_size)
+		if (ctx.cfg.cache_size)
 			process_cached_repolist(expand_macros(value));
 		else if (ctx.cfg.project_list)
 			scan_projects(expand_macros(value),
@@ -355,7 +349,6 @@ static void prepare_context(void)
 {
 	memset(&ctx, 0, sizeof(ctx));
 	ctx.cfg.agefile = "info/web/last-modified";
-	ctx.cfg.nocache = 0;
 	ctx.cfg.cache_size = 0;
 	ctx.cfg.cache_max_create_time = 5;
 	ctx.cfg.cache_root = CGIT_CACHE_ROOT;
@@ -973,8 +966,6 @@ static void cgit_parse_args(int argc, const char **argv)
 		}
 		if (skip_prefix(argv[i], "--cache=", &arg)) {
 			ctx.cfg.cache_root = xstrdup(arg);
-		} else if (!strcmp(argv[i], "--nocache")) {
-			ctx.cfg.nocache = 1;
 		} else if (!strcmp(argv[i], "--nohttp")) {
 			ctx.env.no_http = "1";
 		} else if (skip_prefix(argv[i], "--query=", &arg)) {
@@ -1095,8 +1086,6 @@ int cmd_main(int argc, const char **argv)
 	else
 		ctx.page.expires += ttl * 60;
 	if (!ctx.env.authenticated || (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD")))
-		ctx.cfg.nocache = 1;
-	if (ctx.cfg.nocache)
 		ctx.cfg.cache_size = 0;
 	err = cache_process(ctx.cfg.cache_size, ctx.cfg.cache_root,
 			    ctx.qry.raw, ttl, process_request);
diff --git a/cgit.h b/cgit.h
index 0798dc5..6feca68 100644
--- a/cgit.h
+++ b/cgit.h
@@ -197,8 +197,6 @@ struct cgit_config {
 	char *footer;
 	char *head_include;
 	char *header;
-	char *index_header;
-	char *index_info;
 	char *logo;
 	char *logo_link;
 	char *mimetype_file;
@@ -248,7 +246,6 @@ struct cgit_config {
 	int max_repodesc_len;
 	int max_blob_size;
 	int max_stats;
-	int nocache;
 	int noplainemail;
 	int noheader;
 	int renamelimit;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 3bfacfa..acfae91 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -238,18 +238,6 @@ include::
 	Name of a configfile to include before the rest of the current config-
 	file is parsed. Default value: none. See also: "MACRO EXPANSION".
 
-index-header::
-	The content of the file specified with this option will be included
-	verbatim above the repository index. This setting is deprecated, and
-	will not be supported by cgit-1.0 (use root-readme instead). Default
-	value: none.
-
-index-info::
-	The content of the file specified with this option will be included
-	verbatim below the heading on the repository index page. This setting
-	is deprecated, and will not be supported by cgit-1.0 (use root-desc
-	instead). Default value: none.
-
 local-time::
 	Flag which, if set to "1", makes cgit print commit and tag times in the
 	servers timezone. Default value: "0".
@@ -323,11 +311,6 @@ module-link::
 	formatstring are the path and SHA1 of the submodule commit. Default
 	value: none.
 
-nocache::
-	If set to the value "1" caching will be disabled. This settings is
-	deprecated, and will not be honored starting with cgit-1.0. Default
-	value: "0".
-
 noplainemail::
 	If set to "1" showing full author email addresses will be disabled.
 	Default value: "0".
@@ -359,10 +342,6 @@ renamelimit::
 	 "-1" uses the compiletime value in git (for further info, look at
 	  `man git-diff`). Default value: "-1".
 
-repo.group::
-	Legacy alias for "section". This option is deprecated and will not be
-	supported in cgit-1.0.
-
 repository-sort::
 	The way in which repositories in each section are sorted. Valid values
 	are "name" for sorting by the repo name or "age" for sorting by the
diff --git a/ui-repolist.c b/ui-repolist.c
index af52f9b..41424c0 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -288,9 +288,6 @@ void cgit_print_repolist(void)
 	cgit_print_docstart();
 	cgit_print_pageheader();
 
-	if (ctx.cfg.index_header)
-		html_include(ctx.cfg.index_header);
-
 	if (ctx.qry.sort)
 		sorted = sort_repolist(ctx.qry.sort);
 	else if (ctx.cfg.section_sort)
diff --git a/ui-shared.c b/ui-shared.c
index b773a9c..ba88106 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -977,8 +977,6 @@ static void print_header(void)
 	} else {
 		if (ctx.cfg.root_desc)
 			html_txt(ctx.cfg.root_desc);
-		else if (ctx.cfg.index_info)
-			html_include(ctx.cfg.index_info);
 	}
 	html("</td></tr></table>\n");
 }


More information about the CGit mailing list