diff options
| author | Jason A. Donenfeld | 2012-10-09 06:56:14 -0400 |
|---|---|---|
| committer | Jason A. Donenfeld | 2012-10-17 16:30:09 +0200 |
| commit | 521e10c884055c800078e6dada97ccf6c5193aad (patch) | |
| tree | f4a8398b2d64b171de909d57893441830a280712 /shared.c | |
| parent | c366bd6fa88fb7dbe1e42c84d56e2bda0b1682c5 (diff) | |
| download | cgit-521e10c884055c800078e6dada97ccf6c5193aad.tar.gz cgit-521e10c884055c800078e6dada97ccf6c5193aad.tar.bz2 cgit-521e10c884055c800078e6dada97ccf6c5193aad.zip | |
scan-tree: Unify gitweb.* and cgit.* settings into one config option.
After some back and forth with Jamie and René, it looks like the git
config semantics are going to be like this:
- gitweb.category maps to the cgit repo config key "section"
- gitweb.description maps to the cgit repo config key "desc"
- gitweb.owner maps to the cgit repo config key "owner"
- cgit.* maps to all cgit repo config keys
This option can be enabled with "enable-git-config=1", and replaces
all previous "enable-gitweb-*" config keys.
The order of operations is as follows:
- git config settings are applied in the order that they exist in
the git config file
- if the owner is not set from git config, get the owner using the
usual getpwuid call
- if the description is not set from git config, look inside the
static $path/description file
- if section-from-path=1, override whatever previous settings were
inside of git config using the section-from-path logic
- parse $path/cgitrc for local repo.* settings, that override all
previous settings
Diffstat (limited to 'shared.c')
| -rw-r--r-- | shared.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -33,6 +33,7 @@ int chk_non_negative(int result, char *msg) | |||
| 33 | return result; | 33 | return result; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | char *cgit_default_repo_desc = "[no description]"; | ||
| 36 | struct cgit_repo *cgit_add_repo(const char *url) | 37 | struct cgit_repo *cgit_add_repo(const char *url) |
| 37 | { | 38 | { |
| 38 | struct cgit_repo *ret; | 39 | struct cgit_repo *ret; |
| @@ -52,7 +53,7 @@ struct cgit_repo *cgit_add_repo(const char *url) | |||
| 52 | ret->url = trim_end(url, '/'); | 53 | ret->url = trim_end(url, '/'); |
| 53 | ret->name = ret->url; | 54 | ret->name = ret->url; |
| 54 | ret->path = NULL; | 55 | ret->path = NULL; |
| 55 | ret->desc = "[no description]"; | 56 | ret->desc = cgit_default_repo_desc; |
| 56 | ret->owner = NULL; | 57 | ret->owner = NULL; |
| 57 | ret->section = ctx.cfg.section; | 58 | ret->section = ctx.cfg.section; |
| 58 | ret->snapshots = ctx.cfg.snapshots; | 59 | ret->snapshots = ctx.cfg.snapshots; |
