summary refs log tree commit diff
path: root/cgit.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 08d81a1..f1c2224 100644
--- a/cgit.c
+++ b/cgit.c
@@ -56,6 +56,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
 		repo->homepage = xstrdup(value);
 	else if (!strcmp(name, "defbranch"))
 		repo->defbranch = xstrdup(value);
+	else if (!strcmp(name, "default-tab"))
+		repo->default_tab = xstrdup(value);
 	else if (!strcmp(name, "extra-head-content"))
 		repo->extra_head_content = xstrdup(value);
 	else if (!strcmp(name, "snapshots"))
@@ -285,6 +287,10 @@ static void config_cb(const char *name, const char *value)
 		ctx.cfg.clone_url = xstrdup(value);
 	else if (!strcmp(name, "local-time"))
 		ctx.cfg.local_time = atoi(value);
+	else if (!strcmp(name, "default-tab"))
+		ctx.cfg.default_tab = xstrdup(value);
+	else if (!strcmp(name, "root-default-tab"))
+		ctx.cfg.root_default_tab = xstrdup(value);
 	else if (!strcmp(name, "commit-sort")) {
 		if (!strcmp(value, "date"))
 			ctx.cfg.commit_sort = 1;
@@ -373,6 +379,8 @@ static void prepare_context(void)
 	ctx.cfg.cache_scanrc_ttl = 15;
 	ctx.cfg.cache_dynamic_ttl = 5;
 	ctx.cfg.cache_static_ttl = -1;
+	ctx.cfg.default_tab = "summary";
+	ctx.cfg.root_default_tab = "repolist";
 	ctx.cfg.case_sensitive_sort = 1;
 	ctx.cfg.branch_sort = 0;
 	ctx.cfg.commit_sort = 0;
@@ -816,6 +824,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
 		fprintf(f, "repo.homepage=%s\n", repo->homepage);
 	if (repo->clone_url)
 		fprintf(f, "repo.clone-url=%s\n", repo->clone_url);
+	if (repo->default_tab)
+		fprintf(f, "repo.default-tab=%s\n", repo->default_tab);
 	fprintf(f, "repo.enable-blame=%d\n",
 	        repo->enable_blame);
 	fprintf(f, "repo.enable-commit-graph=%d\n",