aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2009-08-24cgit.c: respect repo-local 'snapshots' option for --scan-pathLars Hjemli1-0/+10
The repo-specific 'snapshots' option is bitwise AND'ed with the global 'snapshots' option during parsing, and since the global cgitrc hasn't been parsed when --scan-path is processed the global 'snapshots' will always be 0 (i.e. no repo-specific 'snapshots' setting will have any effect). This patch fixes the issue by setting the global 'snapshots' mask to 0xFF (hence relying on later parsing of the generated cgitrc repolist to do the right thing). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgit.c: only print first line of repo.desc in print_repo()Lars Hjemli1-2/+14
Since repo.desc might have been populated by reading the 'description' file in GIT_DIR, it may contain newlines. And by printing the literal value, we may then generate an invalid cgitrc include-file. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24Add and use cgit_find_stats_periodname() in print_repo()Lars Hjemli3-0/+12
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgit.c: generate repo.snapshots in print_repo()Lars Hjemli1-0/+25
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgit.c: add missing options to print_repo()Lars Hjemli1-0/+18
Note: print_repo() still ignores repo.max-stats and repo.snapshots, which both requires additional work since these settings are represented internally as an enum and a bitmap. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24shared.c: initialize cgit_repo structs properlyLars Hjemli1-0/+1
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24Add config option 'enable-filter-overrides'Lars Hjemli3-11/+26
This option must be enabled if repo-specific cgitrc files should be allowed to override any of the 'filter' options. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgitrc.5.txt: fix markup errorsLars Hjemli1-9/+10
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24ui-repolist: handle empty sections similar to NULL sectionsLars Hjemli2-7/+12
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24Add support for repo-local cgitrc fileLars Hjemli5-13/+39
When recursively scanning a directory tree looking for git repositories, cgit will now parse cgitrc files found within such repositories. The repo-specific config files can include any repo-specific options except 'repo.url' and 'repo.path'. Also, in such config files the 'repo.' prefix can not be used, i.e. the valid options then becomes: * name * clone-url * desc * ower * defbranch * snapshots * enable-log-filecount * enable-log-linecount * max-stats * module-link * section * about-filter * commit-filter * source-filter * readme Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgit.c: refactor repo_config() from config_cb()Lars Hjemli1-41/+48
The new function repo_config() is used to handle all 'simple' repo options, for the following reasons: * code readability * parser performance * upcoming support for repo-local cgitrc files during scanning Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24ui-repolist.c: sort by section name, repo name as defaultLars Hjemli1-0/+15
When no sorting is requested by the client, cgit will now sort by section name followed by repo name. This allows repos to be registered/ discovered independently of their display order. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24Add config option 'repo.section'Lars Hjemli2-0/+5
This option can be used to specify the section name for the current repository. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24Introduce 'section' as canonical spelling for 'repo.group'Lars Hjemli6-17/+22
The 'repo.' prefix should be reserved for repo-specific options, but the option 'repo.group' must still be honored to stay backwards compatible. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24Add support for --scan-path command line optionLars Hjemli1-1/+2
This is an alias for --scan-tree (which might be deprecated in the future). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24Rename 'repo.scan' to 'scan-path'Lars Hjemli2-10/+10
The 'repo.' prefix will soon be reserved for repo-specific config options. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgitrc.5.txt: document repo.scan and cache-scanrc-ttlLars Hjemli1-0/+9
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgit.c: add support for caching autodetected repositoriesLars Hjemli2-1/+75
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgit.c: make print_repolist() and print_repo() reusable for cachingLars Hjemli1-12/+12
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cache.h: export hash_str()Lars Hjemli1-0/+2
This function will be reused to cache the result of tree scanning. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgit.c: add support for cgitrc option 'repo.scan'Lars Hjemli1-0/+2
When specified, the specified path will be scanned for repositories. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24scan-tree: detect non-bare repository and stop scanning earlyLars Hjemli1-0/+4
We don't want to descend into every subdirectory of a git repository with a workdir. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-24cgitrc.5.txt: fix description and markup for 'snapshots' optionLars Hjemli1-8/+3
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-20scan-tree: split the pw_gecos field at the ',' to get the real nameStefan Naewe1-0/+3
Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-20cgit.c: fix caching keyed on PATH_INFO with no QUERY_STRINGLars Hjemli1-1/+1
When generating a hash for caching, ctx.qry.raw is used as key. And since cgit_parse_url() zero-terminates it's argument (after the repo path), ctx.qry.raw must xstrdup(ctx.qry.url). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-18Add and use a common readfile() functionLars Hjemli4-23/+34
This function is used to read the full content of a textfile into a newly allocated buffer (with zerotermination). It replaces the earlier readfile() in scan-tree.c (which was rather error-prone[1]), and is reused by read_agefile() in ui-repolist.c. 1: No checks for EINTR and EAGAIN, fixed-size buffer Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-18Merge branch 'stable'Lars Hjemli2-0/+2
2009-08-18truncate buffer before reading empty filesSimon Arlott2-0/+2
If readfile() reads an empty file, fgets() won't truncate the buffer and it'll still contain the contents of the previously read file. [lh: fixed similar issue in ui-repolist.c] Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-18Merge branch 'stable'Lars Hjemli1-8/+11
2009-08-18ui-shared: don't print header <img/> if there isn't a logo definedMatthew Metnetsky1-8/+11
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-17Merge branch 'stable'Lars Hjemli2-1/+7
2009-08-17cgit.c: do not segfault on unexpected query-string formatLars Hjemli1-0/+3
The querystring_cb() function will be invoked with a NULL value when the querystring contains a name not followed by a '='. Such a value used to cause a segfault, which this patch fixes. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-17ui-tag.c: do not segfault when id is missing from query-stringLars Hjemli1-1/+4
The purpose of the tag page is to print info about a specific tag, but if no tag was specified on the query-string cgit used to segfault. With this patch, cgit will fallback to the value of the 'h' parameter instead (which is never NULL due to prepare_repo_cmd() in cgit.c). It will now also verify that the specified tagname is in fact a valid ref in the 'refs/tags/' namespace, i.e. specifying 'id=master' will trigger a 'Bad tag reference' error. Noticed-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-16ui-log.c: handle lightweight tags when printing commit decorationsLars Hjemli1-0/+4
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-16ui-refs.c: improve handling of lightweight tagsStefan Bühler1-1/+18
When a lightweight tag is referencing a commit object, cgit now uses the commit date when comparing tag age. Also, the commitdate and author info is printed in the refs view, making lightweight tags appear similar to annotated tags. Signed-off-by: Stefan Bühler <lighttpd@stbuehler.de> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-16Use GIT-1.6.3.4Lars Hjemli2-1/+1
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-11Merge branch 'lh/embedded'Lars Hjemli3-39/+63
2009-08-11ui-shared: add support for header/footer options when embedded=1Lars Hjemli1-5/+12
When embedded=1, cgit used to ignore the header and footer options. But honoring these options when embedded=1 makes it possible to "frame" the html fragment generated by cgit with any kind of static content, i.e. it should become easier to integrate cgit with site-specfic layouts. Original-patch-by: Mark Constable <markc@renta.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-10cgitrc.5.txt: describe where/how cgit will locate cgitrcLars Hjemli1-0/+7
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-10cgit.c: make '/cgit.png' the default value for 'logo' optionLars Hjemli2-2/+2
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-10cgit.css: align commit message with subject in expanded log listingLars Hjemli1-1/+1
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-10ui-shared: add support for NO_HTTP=1/--nohttpLars Hjemli3-1/+6
cgit_print_http_headers() used to do nothing if 'embedded' was specified in cgitrc, but that was wrong - we never want to skip the headers when invoked as a CGI app. Sadly, there's no easy way to detect if we're invoked as a CGI app or if we're invoked by another CGI app, so for the latter case cgit needs to be invoked with either --nohttp on the command line or NO_HTTP=1 in the environment. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-10Cleanup handling of environment variablesLars Hjemli3-33/+45
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-09Add some example filter scriptsLars Hjemli2-0/+51
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-09Merge branch 'lh/about'Lars Hjemli8-10/+48
Conflicts: cgit.h
2009-08-09Merge branch 'lh/plugins'Lars Hjemli7-32/+125
Conflicts: cgit.c cgit.h
2009-08-09Merge branch 'lh/mimetypes'Lars Hjemli4-5/+45
2009-08-09Add 'about-filter' and 'repo.about-filter' optionsLars Hjemli6-2/+28
These options can be used to execute a filter command on each about-page, both top-level and for each repository (repo.about-filter can be used to override the current about-filter). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-09ui-summary: enable arbitrary paths below repo.readmeLars Hjemli3-8/+20
This change makes it possible to include any number of pages below the 'about' tab for a repository. The path is assumed to be located in the same directory as the 'repo.readme' file. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-09cgit.c: allow repo.*-filter options to unset the current defaultLars Hjemli1-1/+1
If e.g. repo.commit-filter is specified as an empty string, this is now properly handled as disabling the global commit-filter setting for the current repository. Signed-off-by: Lars Hjemli <hjemli@gmail.com>