From e79b624d05d0ed899a2cf490a0ffaddbf7f9df4c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 19 Jul 2026 17:41:15 -1000 Subject: Remove the owner filter hook --- cgitrc.5.txt | 18 ------------------ examples/cgitrc | 9 --------- source/cgit.c | 6 ------ source/cgit.h | 4 +--- source/filter.c | 6 ------ source/shared.c | 1 - source/ui-repolist.c | 6 +----- source/ui-shared.c | 8 +------- 8 files changed, 3 insertions(+), 55 deletions(-) diff --git a/cgitrc.5.txt b/cgitrc.5.txt index a456ddf..5644aa7 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -364,15 +364,6 @@ noheader:: Flag which, when set to "1", will make cgit omit the standard header on all pages. Default value: none. See also: "embedded". -owner-filter:: - Specifies a command which will be invoked to format the Owner - column of the main page. The command will get the owner on STDIN, - and the STDOUT from the command will be included verbatim in the - table. This can be used to link to additional context such as an - owners home page. When active this filter is used instead of the - default owner query url. Default value: none. - See also: "FILTER API". - project-list:: A list of subdirectories inside of scan-path, relative to it, that should loaded as git repositories. This must be defined prior to @@ -627,10 +618,6 @@ repo.owner:: A value used to identify the owner of the repository. Default value: none. -repo.owner-filter:: - Override the default owner-filter. Default value: none. See also: - "enable-filter-overrides". See also: "FILTER API". - repo.path:: An absolute path to the repository directory. For non-bare repositories this is the .git-directory. Default value: none. @@ -773,11 +760,6 @@ email filter:: expected to write to standard output the formatted text to be included in the page. -owner filter:: - This filter is given no arguments. The owner text is available on - standard input and the filter is expected to write to standard - output. The output is included in the Owner column. - source filter:: This filter is given a single parameter: the filename of the source file to filter. The filter can use the filename to determine (for diff --git a/examples/cgitrc b/examples/cgitrc index e049d6c..0e82bd2 100644 --- a/examples/cgitrc +++ b/examples/cgitrc @@ -298,11 +298,6 @@ enable-filter-overrides=0 # Default is none. #email-filter=lua:/usr/share/cgit/extensions/email-gravatar.lua -# Filter command used to format the Owner column. The owner is shown without -# a filter, so this only reformats it. Value is a command optionally prefixed -# with exec or lua. Default is none. -#owner-filter=exec:/path/to/your-command - # Filter command used to format plaintext blobs in the tree view. Without it # cgit serves the text plain. For syntax highlighting, the shipped filter # below uses the Scintillua lexers and needs the lpeg module installed too, @@ -564,7 +559,3 @@ noplainemail=0 # email-filter value. #repo.email-filter=lua:/usr/share/cgit/extensions/email-gravatar.lua -# Per-repo override of the owner-filter. Allowed in a repo cgitrc only when -# enable-filter-overrides is 1. Value is a command. Default is the global -# owner-filter value. -#repo.owner-filter=exec:/path/to/your-command diff --git a/source/cgit.c b/source/cgit.c index d0d454d..bdfed0b 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -126,8 +126,6 @@ void cgit_repo_config(struct cgit_repo *repo, const char *name, const char *valu repo->source_filter = cgit_new_filter(value, SOURCE); else if (!strcmp(name, "email-filter")) repo->email_filter = cgit_new_filter(value, EMAIL); - else if (!strcmp(name, "owner-filter")) - repo->owner_filter = cgit_new_filter(value, OWNER); } } @@ -243,8 +241,6 @@ static void config_cb(const char *name, const char *value) ctx.cfg.commit_filter = cgit_new_filter(value, COMMIT); else if (!strcmp(name, "email-filter")) ctx.cfg.email_filter = cgit_new_filter(value, EMAIL); - else if (!strcmp(name, "owner-filter")) - ctx.cfg.owner_filter = cgit_new_filter(value, OWNER); else if (!strcmp(name, "auth-filter")) ctx.cfg.auth_filter = cgit_new_filter(value, AUTH); else if (!strcmp(name, "embedded")) @@ -864,8 +860,6 @@ static void print_repo(FILE *f, struct cgit_repo *repo) cgit_fprintf_filter(repo->source_filter, f, "repo.source-filter="); if (repo->email_filter && repo->email_filter != ctx.cfg.email_filter) cgit_fprintf_filter(repo->email_filter, f, "repo.email-filter="); - if (repo->owner_filter && repo->owner_filter != ctx.cfg.owner_filter) - cgit_fprintf_filter(repo->owner_filter, f, "repo.owner-filter="); if (repo->snapshots != ctx.cfg.snapshots) { char *tmp = build_snapshot_setting(repo->snapshots); fprintf(f, "repo.snapshots=%s\n", tmp ? tmp : ""); diff --git a/source/cgit.h b/source/cgit.h index 727067a..4187bb1 100644 --- a/source/cgit.h +++ b/source/cgit.h @@ -63,7 +63,7 @@ typedef enum { } diff_type; typedef enum { - ABOUT, COMMIT, SOURCE, EMAIL, AUTH, OWNER + ABOUT, COMMIT, SOURCE, EMAIL, AUTH } filter_type; struct cgit_filter { @@ -115,7 +115,6 @@ struct cgit_repo { struct cgit_filter *commit_filter; struct cgit_filter *source_filter; struct cgit_filter *email_filter; - struct cgit_filter *owner_filter; struct string_list submodules; int hide; int ignore; @@ -276,7 +275,6 @@ struct cgit_config { struct cgit_filter *commit_filter; struct cgit_filter *source_filter; struct cgit_filter *email_filter; - struct cgit_filter *owner_filter; struct cgit_filter *auth_filter; }; diff --git a/source/filter.c b/source/filter.c index 2932a32..7f7942d 100644 --- a/source/filter.c +++ b/source/filter.c @@ -28,14 +28,12 @@ void cgit_cleanup_filters(void) reap_filter(ctx.cfg.commit_filter); reap_filter(ctx.cfg.source_filter); reap_filter(ctx.cfg.email_filter); - reap_filter(ctx.cfg.owner_filter); reap_filter(ctx.cfg.auth_filter); for (i = 0; i < cgit_repolist.count; ++i) { reap_filter(cgit_repolist.repos[i].about_filter); reap_filter(cgit_repolist.repos[i].commit_filter); reap_filter(cgit_repolist.repos[i].source_filter); reap_filter(cgit_repolist.repos[i].email_filter); - reap_filter(cgit_repolist.repos[i].owner_filter); } } @@ -428,10 +426,6 @@ struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype) argument_count = 2; break; - case OWNER: - argument_count = 0; - break; - case SOURCE: case ABOUT: argument_count = 1; diff --git a/source/shared.c b/source/shared.c index 2adb5f9..8125909 100644 --- a/source/shared.c +++ b/source/shared.c @@ -80,7 +80,6 @@ struct cgit_repo *cgit_add_repo(const char *url) ret->commit_filter = ctx.cfg.commit_filter; ret->source_filter = ctx.cfg.source_filter; ret->email_filter = ctx.cfg.email_filter; - ret->owner_filter = ctx.cfg.owner_filter; ret->clone_url = ctx.cfg.clone_url; ret->submodules.strdup_strings = 1; ret->hide = ret->ignore = 0; diff --git a/source/ui-repolist.c b/source/ui-repolist.c index 4fdce04..c54ca32 100644 --- a/source/ui-repolist.c +++ b/source/ui-repolist.c @@ -363,11 +363,7 @@ void cgit_print_repolist(void) html(""); if (ctx.cfg.enable_index_owner) { html(""); - if (ctx.repo->owner_filter) { - cgit_open_filter(ctx.repo->owner_filter); - html_txt(ctx.repo->owner); - cgit_close_filter(ctx.repo->owner_filter); - } else { + { char *currenturl = cgit_currenturl(); html(""); - if (ctx.repo->owner_filter) { - cgit_open_filter(ctx.repo->owner_filter); - html_txt(ctx.repo->owner); - cgit_close_filter(ctx.repo->owner_filter); - } else { - html_txt(ctx.repo->owner); - } + html_txt(ctx.repo->owner); html("

\n"); } else if (ctx.cfg.root_desc) { html("

"); -- cgit v2.8.0