aboutsummaryrefslogtreecommitdiffstats
path: root/parsing.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2007-06-26Add trim_end() and use it to remove trailing slashes from repo pathsLars Hjemli1-1/+1
The new function removes all trailing instances of an arbitrary character from a copy of the supplied char array. This is then used to remove any trailing slashes from cgit_query_path. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-31Check for NULL commit buffer in cgit_parse_commit()Ondrej Jirman1-0/+3
This can be NULL, so try not to segfault. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-31Handle single-line and empty commit subjectsOndrej Jirman1-3/+8
If commit object ends with \0 after subject line, then info->subject was not set. This commit fixes this and also sets subject to ** empty ** if it would otherwise be empty, so that there is something to click on. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-18Don't be fooled by trailing '/' in url-parameterLars Hjemli1-1/+2
cgit_parse_url() didn't check if the path-part of urls contained a real path or just a trailing slash. This made the log-page die since the path filtering supplied an invalid path argument. This fixes it. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-18Enable url=value querystring parameterLars Hjemli1-0/+43
This makes is possible to use repo-urls like '/pub/scm/git/git.git' and even add path specifications, like '/pub/scm/git/git.git/log/documentation'. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-15Restrict deep nesting of configfilesLars Hjemli1-4/+6
There is no point in restricting the number of included config- files, but there is a point in restricting the nestinglevel of configfiles: to avoid recursive inclusions. This is easily achieved by decrementing the static nesting-variable upon exit from cgit_read_config(). Also fix some whitespace breakage. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-14Add include-parameter to config filesLars Hjemli1-6/+8
This parameter can be used to include another config-file, like a standalone repository listing. Suggested in a patch by Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-08Update to libgit 1.5.2-rc2Lars Hjemli1-3/+3
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-02-04Do not die if tag has no messageLars Hjemli1-2/+2
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-17Add function cgit_parse_tag()Lars Hjemli1-0/+47
Teach cgit how to extract author info from a tag. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-16Handle empty/malformed commit messagesLars Hjemli1-6/+13
An empty commit message would trigger a segfault in the current cgit_parse_commit(). Also, make sure that all char-pointers are properly initialized.
2007-01-04Handle %xx encoding in querystringLars Hjemli1-0/+21
Convert valid %xx expressions in querystring to ascii, ignore invalid expressions (i.e. eat the three characters %xx). Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
2006-12-28Handle '+' in querystringLars Hjemli1-0/+2
Translate '+' to ' ' in querystring parser (still doesn't handle %xx) Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16Teach commit parser about author/committer email + timestampLars Hjemli1-2/+10
We want all four of these when showing a commit, so save them in the commitinfo struct. Btw: There's probably no good reason to save committer timestamp since it's already available in commit->date. But it doesn't hurt us either, and it makes the parser look more complete, so we just do it. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16Add ui-commit.c + misc ui cleanupsLars Hjemli1-0/+1
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-15Add a common commit parserLars Hjemli1-0/+53
Make a better commit parser, replacing the ugly one in ui-log.c Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-11Rename config.c to parsing.c + move cgit_parse_query from cgit.c to parsing.cLars Hjemli1-0/+25
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-10Add license file and copyright noticesLars Hjemli1-0/+8
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-10Add caching infrastructureLars Hjemli1-2/+2
This enables internal caching of page output. Page requests are split into four groups: 1) repo listing (front page) 2) repo summary 3) repo pages w/symbolic references in query string 4) repo pages w/constant sha1's in query string Each group has a TTL specified in minutes. When a page is requested, a cached filename is stat(2)'ed and st_mtime is compared to time(2). If TTL has expired (or the file didn't exist), the cached file is regenerated. When generating a cached file, locking is used to avoid parallell processing of the request. If multiple processes tries to aquire the same lock, the ones who fail to get the lock serves the (expired) cached file. If the cached file don't exist, the process instead calls sched_yield(2) before restarting the request processing. Signed-off-by: Lars Hjemli <hjemli@gmail.com>