From 78d6d1dddfc197ab731aaec8461e199209c63aea Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 1 Aug 2026 21:35:12 -1000 Subject: Drop the help tab and its built-in guide --- assets/cgit.css | 27 -------------- cgitrc.5.txt | 6 ---- custom/cgitrc | 4 --- source/cgit.c | 3 -- source/cgit.h | 1 - source/cgit.mk | 1 - source/cmd.c | 10 ------ source/ui-help.c | 93 ------------------------------------------------- source/ui-help.h | 6 ---- source/ui-shared.c | 6 ---- tests/t0200-security.sh | 25 ------------- 11 files changed, 182 deletions(-) delete mode 100644 source/ui-help.c delete mode 100644 source/ui-help.h diff --git a/assets/cgit.css b/assets/cgit.css index ba7d7b1..56beb78 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -610,33 +610,6 @@ div#cgit .markdown td { div#cgit .markdown th { background: var(--surface-2); } -/* ---- Help page -------------------------------------------------------- */ - -div#cgit div.help { - max-width: 52em; - line-height: 1.6; -} - -div#cgit div.help h2 { - font-size: 125%; - font-weight: bold; - margin: 1.3em 0 0.4em; -} - -div#cgit div.help p { - margin: 0.5em 0; -} - -div#cgit div.help pre.urls { - background: var(--surface-2); - border: 1px solid var(--border); - border-radius: var(--radius); - padding: 0.6em 0.9em; - font-family: var(--font-mono); - font-size: 90%; - overflow-x: auto; -} - div#cgit div#blob { border: solid 1px var(--border-strong); } diff --git a/cgitrc.5.txt b/cgitrc.5.txt index ed11563..dba9751 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -168,12 +168,6 @@ enable-follow-links:: Flag which, when set to "1", allows users to follow a file in the log view. Default value: "0". -enable-help:: - Flag which, when set to "1", adds a "help" tab to the repository index - with a built-in guide to the interface, covering the URL patterns for - common workflows such as comparing two tags or downloading a snapshot. - Default value: "1". - enable-git-config:: Flag which, when set to "1", will allow cgit to use git config to set any repo specific settings. This option is used in conjunction with diff --git a/custom/cgitrc b/custom/cgitrc index 85929d4..fd4ac34 100644 --- a/custom/cgitrc +++ b/custom/cgitrc @@ -197,10 +197,6 @@ enable-commit-graph=0 # Default is 0. enable-follow-links=0 -# Add a help tab to the index page with a built-in guide to the interface. -# Values are 0 or 1. Default is 1. -enable-help=1 - # Generate extra summary, commit and tree links per repo on the index. Values # are 0 or 1. Default is 0. enable-index-links=0 diff --git a/source/cgit.c b/source/cgit.c index 74600a7..c824da6 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -183,8 +183,6 @@ static void config_cb(const char *name, const char *value) ctx.cfg.enable_filter_overrides = atoi(value); else if (!strcmp(name, "enable-follow-links")) ctx.cfg.enable_follow_links = atoi(value); - else if (!strcmp(name, "enable-help")) - ctx.cfg.enable_help = atoi(value); else if (!strcmp(name, "enable-stats")) ctx.cfg.enable_stats = atoi(value); else if (!strcmp(name, "enable-http-clone")) @@ -414,7 +412,6 @@ static void prepare_context(void) ctx.cfg.logo = "/cgit.png"; ctx.cfg.favicon = "/favicon.ico"; ctx.cfg.local_time = 0; - ctx.cfg.enable_help = 1; ctx.cfg.enable_http_clone = 1; ctx.cfg.enable_index_owner = 1; ctx.cfg.enable_tree_linenumbers = 1; diff --git a/source/cgit.h b/source/cgit.h index 966851c..78129b5 100644 --- a/source/cgit.h +++ b/source/cgit.h @@ -229,7 +229,6 @@ struct cgit_config { int embedded; int enable_filter_overrides; int enable_follow_links; - int enable_help; int enable_stats; int enable_http_clone; int enable_index_links; diff --git a/source/cgit.mk b/source/cgit.mk index eb8790c..b2d7dfc 100644 --- a/source/cgit.mk +++ b/source/cgit.mk @@ -106,7 +106,6 @@ CGIT_OBJ_NAMES += ui-blob.o CGIT_OBJ_NAMES += ui-clone.o CGIT_OBJ_NAMES += ui-commit.o CGIT_OBJ_NAMES += ui-diff.o -CGIT_OBJ_NAMES += ui-help.o CGIT_OBJ_NAMES += ui-log.o CGIT_OBJ_NAMES += ui-patch.o CGIT_OBJ_NAMES += ui-plain.o diff --git a/source/cmd.c b/source/cmd.c index 84a9d33..510c957 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -23,7 +23,6 @@ #include "ui-repolist.h" #include "ui-snapshot.h" #include "ui-stats.h" -#include "ui-help.h" #include "ui-summary.h" #include "ui-tag.h" #include "ui-tree.h" @@ -33,14 +32,6 @@ static void HEAD_fn(void) cgit_clone_head(); } -static void help_fn(void) -{ - if (ctx.cfg.enable_help) - cgit_print_help(); - else - cgit_print_error_page(404, "Not found", "Help is disabled"); -} - static void atom_fn(void) { cgit_print_atom(ctx.qry.head, ctx.qry.path, ctx.cfg.max_atom_items); @@ -196,7 +187,6 @@ struct cgit_cmd *cgit_get_cmd(void) def_cmd(blob, 1, 0, 0), def_cmd(commit, 1, 1, 0), def_cmd(diff, 1, 1, 0), - def_cmd(help, 0, 0, 0), def_cmd(info, 1, 0, 1), def_cmd(log, 1, 1, 0), def_cmd(ls_cache, 0, 0, 0), diff --git a/source/ui-help.c b/source/ui-help.c deleted file mode 100644 index 981733d..0000000 --- a/source/ui-help.c +++ /dev/null @@ -1,93 +0,0 @@ -/* ui-help.c: built-in guide to the cgit interface - * - * Copyright (C) 2006-2018 cgit Development Team - * - * Licensed under GNU General Public License v2 - * (see LICENSE.txt for full license text) - */ - -#include "cgit.h" -#include "ui-help.h" -#include "html.h" -#include "ui-shared.h" - -static void print_workflow(const char *title, const char *intro, - const char *pattern, const char *example) -{ - html("

"); - html_txt(title); - html("

\n

"); - html_txt(intro); - html("

\n"); - if (pattern) { - html("
");
-		html_txt(pattern);
-		if (example) {
-			html("\n");
-			html_txt(example);
-		}
-		html("
\n"); - } -} - -void cgit_print_help(void) -{ - cgit_print_layout_start(); - html("
\n"); - - html("

Every page on this site has a stable address, so anything " - "you can see can also be linked, scripted or fetched. The " - "patterns below cover the common workflows. Angle brackets " - "mark the parts you replace.

\n"); - - print_workflow("Browse a repository", - "Each repository has a summary page, and the tabs on it lead " - "to the branch and tag list, the commit history and the file " - "tree.", - "// //refs/ //log/ //tree/", - NULL); - - print_workflow("Pin what you are looking at", - "Add h= to select a branch, or id= to select any commit, tag " - "or object hash. They work on nearly every page, so a pinned " - "URL always shows the same content.", - "//tree/?h= //tree/?id=", - "/linux/tree/?h=stable /linux/tree/?id=v6.1"); - - print_workflow("View a file", - "Append a path to the tree page for the rendered view, use " - "plain for the raw bytes, and blame to see which commit last " - "touched each line.", - "//tree/ //plain/ //blame/", - "/linux/tree/kernel/fork.c?h=v6.1"); - - print_workflow("Compare two points in history", - "The diff page compares id2, the older point, with id, the " - "newer one. Both accept tags, branches and commit hashes. " - "Use rawdiff for the plain patch text.", - "//diff/?id=&id2=", - "/linux/diff/?id=v6.2&id2=v6.1"); - - print_workflow("Follow the history of a path", - "The log page takes a path to limit history to it. The " - "search box above the log searches the message, author or " - "committer, and the range type accepts any revision range.", - "//log/ //log/?qt=range&q=..", - "/linux/log/?qt=range&q=v6.1..v6.2"); - - print_workflow("Download a release or a patch", - "Snapshots are archives of a tag or commit, named after the " - "repository and version. The patch page emits a single " - "commit as an emailable patch.", - "//snapshot/-.tar.gz //patch/?id=", - "/linux/snapshot/linux-v6.1.tar.gz"); - - print_workflow("Subscribe to changes", - "Every repository serves an Atom feed of its history, and " - "h= scopes it to a branch.", - "//atom/ //atom/?h=", - NULL); - - html("
\n"); - cgit_print_layout_end(); -} diff --git a/source/ui-help.h b/source/ui-help.h deleted file mode 100644 index 85a4db7..0000000 --- a/source/ui-help.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef UI_HELP_H -#define UI_HELP_H - -extern void cgit_print_help(void); - -#endif /* UI_HELP_H */ diff --git a/source/ui-shared.c b/source/ui-shared.c index 16ff875..ace06b2 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1193,12 +1193,6 @@ void cgit_print_pageheader(void) NULL, NULL, 0, 1); html("\n"); } - if (ctx.cfg.enable_help) { - html("
  • "); - site_link("help", "help", "How to use this site", hc("help"), - NULL, NULL, 0, 1); - html("
  • \n"); - } html("\n"); html("