aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-13 12:04:52 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2014-01-14 10:00:07 (JST)
commita5e15537268410e268c7b26aa69d03b347c326c8 (patch)
tree77f42b7f03788d4741bfd60b49719fbc649181ff /cgit.c
parent800380dde797ae35d738a644acdae2fabb9a0d44 (diff)
downloadcgit-a5e15537268410e268c7b26aa69d03b347c326c8.zip
cgit-a5e15537268410e268c7b26aa69d03b347c326c8.tar.gz
filter: add support for email filter
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 725fd65..f3fe56b 100644
--- a/cgit.c
+++ b/cgit.c
@@ -89,6 +89,8 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
89 repo->commit_filter = cgit_new_filter(value, COMMIT); 89 repo->commit_filter = cgit_new_filter(value, COMMIT);
90 else if (!strcmp(name, "source-filter")) 90 else if (!strcmp(name, "source-filter"))
91 repo->source_filter = cgit_new_filter(value, SOURCE); 91 repo->source_filter = cgit_new_filter(value, SOURCE);
92 else if (!strcmp(name, "email-filter"))
93 repo->email_filter = cgit_new_filter(value, EMAIL);
92 } 94 }
93} 95}
94 96
@@ -188,6 +190,8 @@ static void config_cb(const char *name, const char *value)
188 ctx.cfg.about_filter = cgit_new_filter(value, ABOUT); 190 ctx.cfg.about_filter = cgit_new_filter(value, ABOUT);
189 else if (!strcmp(name, "commit-filter")) 191 else if (!strcmp(name, "commit-filter"))
190 ctx.cfg.commit_filter = cgit_new_filter(value, COMMIT); 192 ctx.cfg.commit_filter = cgit_new_filter(value, COMMIT);
193 else if (!strcmp(name, "email-filter"))
194 ctx.cfg.email_filter = cgit_new_filter(value, EMAIL);
191 else if (!strcmp(name, "embedded")) 195 else if (!strcmp(name, "embedded"))
192 ctx.cfg.embedded = atoi(value); 196 ctx.cfg.embedded = atoi(value);
193 else if (!strcmp(name, "max-atom-items")) 197 else if (!strcmp(name, "max-atom-items"))
@@ -711,6 +715,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
711 cgit_fprintf_filter(repo->commit_filter, f, "repo.commit-filter="); 715 cgit_fprintf_filter(repo->commit_filter, f, "repo.commit-filter=");
712 if (repo->source_filter && repo->source_filter != ctx.cfg.source_filter) 716 if (repo->source_filter && repo->source_filter != ctx.cfg.source_filter)
713 cgit_fprintf_filter(repo->source_filter, f, "repo.source-filter="); 717 cgit_fprintf_filter(repo->source_filter, f, "repo.source-filter=");
718 if (repo->email_filter && repo->email_filter != ctx.cfg.email_filter)
719 cgit_fprintf_filter(repo->email_filter, f, "repo.email-filter=");
714 if (repo->snapshots != ctx.cfg.snapshots) { 720 if (repo->snapshots != ctx.cfg.snapshots) {
715 char *tmp = build_snapshot_setting(repo->snapshots); 721 char *tmp = build_snapshot_setting(repo->snapshots);
716 fprintf(f, "repo.snapshots=%s\n", tmp ? tmp : ""); 722 fprintf(f, "repo.snapshots=%s\n", tmp ? tmp : "");