]> granicus.if.org Git - cgit/log
cgit
15 years agoshared.c: initialize cgit_repo structs properly
Lars Hjemli [Mon, 24 Aug 2009 08:14:02 +0000 (10:14 +0200)]
shared.c: initialize cgit_repo structs properly

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd config option 'enable-filter-overrides'
Lars Hjemli [Mon, 24 Aug 2009 06:53:21 +0000 (08:53 +0200)]
Add config option 'enable-filter-overrides'

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>
15 years agocgitrc.5.txt: fix markup errors
Lars Hjemli [Mon, 24 Aug 2009 05:51:48 +0000 (07:51 +0200)]
cgitrc.5.txt: fix markup errors

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-repolist: handle empty sections similar to NULL sections
Lars Hjemli [Mon, 24 Aug 2009 05:42:03 +0000 (07:42 +0200)]
ui-repolist: handle empty sections similar to NULL sections

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for repo-local cgitrc file
Lars Hjemli [Sun, 23 Aug 2009 22:04:58 +0000 (00:04 +0200)]
Add support for repo-local cgitrc file

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>
15 years agocgit.c: refactor repo_config() from config_cb()
Lars Hjemli [Sun, 23 Aug 2009 21:23:20 +0000 (23:23 +0200)]
cgit.c: refactor repo_config() from config_cb()

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>
15 years agoui-repolist.c: sort by section name, repo name as default
Lars Hjemli [Sun, 23 Aug 2009 21:09:31 +0000 (23:09 +0200)]
ui-repolist.c: sort by section name, repo name as default

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>
15 years agoAdd config option 'repo.section'
Lars Hjemli [Sun, 23 Aug 2009 21:00:28 +0000 (23:00 +0200)]
Add config option 'repo.section'

This option can be used to specify the section name for the current
repository.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoIntroduce 'section' as canonical spelling for 'repo.group'
Lars Hjemli [Sun, 23 Aug 2009 20:58:39 +0000 (22:58 +0200)]
Introduce 'section' as canonical spelling for 'repo.group'

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>
15 years agoAdd support for --scan-path command line option
Lars Hjemli [Sun, 23 Aug 2009 17:36:45 +0000 (19:36 +0200)]
Add support for --scan-path command line option

This is an alias for --scan-tree (which might be deprecated in the
future).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoRename 'repo.scan' to 'scan-path'
Lars Hjemli [Sun, 23 Aug 2009 17:35:56 +0000 (19:35 +0200)]
Rename 'repo.scan' to 'scan-path'

The 'repo.' prefix will soon be reserved for repo-specific config
options.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: document repo.scan and cache-scanrc-ttl
Lars Hjemli [Thu, 20 Aug 2009 15:42:14 +0000 (17:42 +0200)]
cgitrc.5.txt: document repo.scan and cache-scanrc-ttl

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: add support for caching autodetected repositories
Lars Hjemli [Thu, 20 Aug 2009 15:41:54 +0000 (17:41 +0200)]
cgit.c: add support for caching autodetected repositories

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: make print_repolist() and print_repo() reusable for caching
Lars Hjemli [Wed, 19 Aug 2009 15:47:24 +0000 (17:47 +0200)]
cgit.c: make print_repolist() and print_repo() reusable for caching

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocache.h: export hash_str()
Lars Hjemli [Wed, 19 Aug 2009 15:43:47 +0000 (17:43 +0200)]
cache.h: export hash_str()

This function will be reused to cache the result of tree scanning.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: add support for cgitrc option 'repo.scan'
Lars Hjemli [Tue, 11 Aug 2009 08:09:06 +0000 (10:09 +0200)]
cgit.c: add support for cgitrc option 'repo.scan'

When specified, the specified path will be scanned for repositories.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoscan-tree: detect non-bare repository and stop scanning early
Lars Hjemli [Tue, 11 Aug 2009 08:08:12 +0000 (10:08 +0200)]
scan-tree: detect non-bare repository and stop scanning early

We don't want to descend into every subdirectory of a git repository
with a workdir.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: fix description and markup for 'snapshots' option
Lars Hjemli [Mon, 24 Aug 2009 06:00:37 +0000 (08:00 +0200)]
cgitrc.5.txt: fix description and markup for 'snapshots' option

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoscan-tree: split the pw_gecos field at the ',' to get the real name
Stefan Naewe [Thu, 20 Aug 2009 06:24:51 +0000 (08:24 +0200)]
scan-tree: split the pw_gecos field at the ',' to get the real name

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: fix caching keyed on PATH_INFO with no QUERY_STRING
Lars Hjemli [Thu, 20 Aug 2009 08:07:51 +0000 (10:07 +0200)]
cgit.c: fix caching keyed on PATH_INFO with no QUERY_STRING

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>
15 years agoAdd and use a common readfile() function
Lars Hjemli [Tue, 18 Aug 2009 15:17:41 +0000 (17:17 +0200)]
Add and use a common readfile() function

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>
15 years agoMerge branch 'stable'
Lars Hjemli [Tue, 18 Aug 2009 15:21:52 +0000 (17:21 +0200)]
Merge branch 'stable'

15 years agotruncate buffer before reading empty files
Simon Arlott [Sat, 7 Mar 2009 00:06:24 +0000 (00:06 +0000)]
truncate buffer before reading empty files

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>
15 years agoMerge branch 'stable'
Lars Hjemli [Tue, 18 Aug 2009 11:14:11 +0000 (13:14 +0200)]
Merge branch 'stable'

15 years agoui-shared: don't print header <img/> if there isn't a logo defined
Matthew Metnetsky [Tue, 30 Jun 2009 01:27:51 +0000 (21:27 -0400)]
ui-shared: don't print header <img/> if there isn't a logo defined

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Mon, 17 Aug 2009 08:17:23 +0000 (10:17 +0200)]
Merge branch 'stable'

15 years agocgit.c: do not segfault on unexpected query-string format
Lars Hjemli [Mon, 17 Aug 2009 07:05:13 +0000 (09:05 +0200)]
cgit.c: do not segfault on unexpected query-string format

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>
15 years agoui-tag.c: do not segfault when id is missing from query-string
Lars Hjemli [Mon, 17 Aug 2009 07:19:05 +0000 (09:19 +0200)]
ui-tag.c: do not segfault when id is missing from query-string

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>
15 years agoui-log.c: handle lightweight tags when printing commit decorations
Lars Hjemli [Sun, 16 Aug 2009 17:52:27 +0000 (19:52 +0200)]
ui-log.c: handle lightweight tags when printing commit decorations

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-refs.c: improve handling of lightweight tags
Stefan Bühler [Sun, 16 Aug 2009 17:35:18 +0000 (19:35 +0200)]
ui-refs.c: improve handling of lightweight tags

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>
15 years agoUse GIT-1.6.3.4
Lars Hjemli [Thu, 13 Aug 2009 05:11:41 +0000 (07:11 +0200)]
Use GIT-1.6.3.4

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/embedded'
Lars Hjemli [Tue, 11 Aug 2009 08:12:53 +0000 (10:12 +0200)]
Merge branch 'lh/embedded'

15 years agoui-shared: add support for header/footer options when embedded=1
Lars Hjemli [Tue, 11 Aug 2009 08:12:35 +0000 (10:12 +0200)]
ui-shared: add support for header/footer options when embedded=1

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>
15 years agocgitrc.5.txt: describe where/how cgit will locate cgitrc
Lars Hjemli [Mon, 10 Aug 2009 16:58:29 +0000 (18:58 +0200)]
cgitrc.5.txt: describe where/how cgit will locate cgitrc

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: make '/cgit.png' the default value for 'logo' option
Lars Hjemli [Mon, 10 Aug 2009 16:14:12 +0000 (18:14 +0200)]
cgit.c: make '/cgit.png' the default value for 'logo' option

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.css: align commit message with subject in expanded log listing
Lars Hjemli [Mon, 10 Aug 2009 16:03:31 +0000 (18:03 +0200)]
cgit.css: align commit message with subject in expanded log listing

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-shared: add support for NO_HTTP=1/--nohttp
Lars Hjemli [Mon, 10 Aug 2009 07:20:17 +0000 (09:20 +0200)]
ui-shared: add support for NO_HTTP=1/--nohttp

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>
15 years agoCleanup handling of environment variables
Lars Hjemli [Mon, 10 Aug 2009 06:21:09 +0000 (08:21 +0200)]
Cleanup handling of environment variables

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd some example filter scripts
Lars Hjemli [Sun, 9 Aug 2009 12:56:23 +0000 (14:56 +0200)]
Add some example filter scripts

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/about'
Lars Hjemli [Sun, 9 Aug 2009 11:46:34 +0000 (13:46 +0200)]
Merge branch 'lh/about'

Conflicts:
cgit.h

15 years agoMerge branch 'lh/plugins'
Lars Hjemli [Sun, 9 Aug 2009 11:46:01 +0000 (13:46 +0200)]
Merge branch 'lh/plugins'

Conflicts:
cgit.c
cgit.h

15 years agoMerge branch 'lh/mimetypes'
Lars Hjemli [Sun, 9 Aug 2009 11:45:36 +0000 (13:45 +0200)]
Merge branch 'lh/mimetypes'

15 years agoAdd 'about-filter' and 'repo.about-filter' options
Lars Hjemli [Sun, 9 Aug 2009 11:27:21 +0000 (13:27 +0200)]
Add 'about-filter' and 'repo.about-filter' options

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>
15 years agoui-summary: enable arbitrary paths below repo.readme
Lars Hjemli [Sun, 9 Aug 2009 09:50:34 +0000 (11:50 +0200)]
ui-summary: enable arbitrary paths below repo.readme

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>
15 years agocgit.c: allow repo.*-filter options to unset the current default
Lars Hjemli [Sun, 9 Aug 2009 11:39:44 +0000 (13:39 +0200)]
cgit.c: allow repo.*-filter options to unset the current default

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>
15 years agoAdd support for repo.commit-filter and repo.source-filter
Lars Hjemli [Sun, 9 Aug 2009 11:22:00 +0000 (13:22 +0200)]
Add support for repo.commit-filter and repo.source-filter

These options can be used to override the default commit- and source-
filter settings per repository.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoExpose file extension in tree lists as class to allow nicer tree styling
Martin Szulecki [Fri, 7 Aug 2009 12:06:02 +0000 (14:06 +0200)]
Expose file extension in tree lists as class to allow nicer tree styling

Signed-off-by: Martin Szulecki <opensuse@sukimashita.com>
15 years agoIntroduce noplainemail option to hide email adresses from spambots
Martin Szulecki [Fri, 7 Aug 2009 12:05:17 +0000 (14:05 +0200)]
Introduce noplainemail option to hide email adresses from spambots

Signed-off-by: Martin Szulecki <opensuse@sukimashita.com>
15 years agoui-commit: add support for 'commit-filter' option
Lars Hjemli [Fri, 31 Jul 2009 15:42:57 +0000 (17:42 +0200)]
ui-commit: add support for 'commit-filter' option

This new option specifies a filter which is executed on the commit
message, i.e. the commit message is written to the filters STDIN and
the filters STDOUT is included verbatim as the commit message.

This can be used to implement commit linking by creating a simple
shell script in e.g. /usr/bin/cgit-commit-filter.sh like this:

#/bin/sh
sed -re 's|\b([0-9a-fA-F]{6,40})\b|<a href="./?id=\1">\1</a>|g'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tree: add support for source-filter option
Lars Hjemli [Fri, 31 Jul 2009 14:55:27 +0000 (16:55 +0200)]
ui-tree: add support for source-filter option

This new option is used to specify an external command which will be
executed when displaying blob content in the tree view. Blob content
will be written to STDIN of the filter and STDOUT from the filter
will be included verbatim in the html output from cgit. The file name
of the blob will be passed as the only argument to the filter command.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-snapshot: use cgit_{open|close}_filter() to execute compressors
Lars Hjemli [Fri, 31 Jul 2009 13:52:57 +0000 (15:52 +0200)]
ui-snapshot: use cgit_{open|close}_filter() to execute compressors

This simplifies the code in ui-snapshot.c and makes the test-suite
verify the new filter-functions.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd generic filter/plugin infrastructure
Lars Hjemli [Fri, 31 Jul 2009 15:38:38 +0000 (17:38 +0200)]
Add generic filter/plugin infrastructure

The functions cgit_open_filter() and cgit_close_filter() can be used to
execute filters on the output stream from cgit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for mime type registration and lookup
Lars Hjemli [Fri, 13 Feb 2009 19:43:30 +0000 (20:43 +0100)]
Add support for mime type registration and lookup

This patch makes it possible to register mappings from filename
extension to mime type in cgitrc and use this mapping when returning
blob content in `plain` view.

The reason for adding this mapping to cgitrc (as opposed to parsing
something like /etc/mime.types) is to allow quick lookup of a limited
number of filename extensions (/etc/mime-types on my machine currently
contains over 700 entries).

NB: A nice addition to this patch would be to parse /etc/mime.types
when `plain` view is requested for a file with an extension for which
there is no mapping registered in cgitrc.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/embedded'
Lars Hjemli [Sat, 25 Jul 2009 10:29:22 +0000 (12:29 +0200)]
Merge branch 'lh/embedded'

Conflicts:
cgitrc.5.txt
ui-shared.c

15 years agocgit.h: keep config flags sorted
Lars Hjemli [Sat, 25 Jul 2009 10:25:06 +0000 (12:25 +0200)]
cgit.h: keep config flags sorted

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: document 'embedded' and 'noheader'
Lars Hjemli [Sat, 25 Jul 2009 10:23:30 +0000 (12:23 +0200)]
cgitrc.5.txt: document 'embedded' and 'noheader'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for 'noheader' option
Lars Hjemli [Sat, 25 Jul 2009 10:19:31 +0000 (12:19 +0200)]
Add support for 'noheader' option

This option can be used to disable the standard cgit page header, which
might be useful in combination with the 'embedded' option.

Suggested-by: Mark Constable <markc@renta.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'ml/head-include'
Lars Hjemli [Sat, 25 Jul 2009 10:04:08 +0000 (12:04 +0200)]
Merge branch 'ml/head-include'

15 years agocgitrc.5.txt: document 'head-include'
Lars Hjemli [Sat, 25 Jul 2009 10:03:54 +0000 (12:03 +0200)]
cgitrc.5.txt: document 'head-include'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'plain-etag'
Lars Hjemli [Sat, 25 Jul 2009 09:59:22 +0000 (11:59 +0200)]
Merge branch 'plain-etag'

Conflicts:
ui-shared.c

15 years agoMerge branch 'rt/plain-binary'
Lars Hjemli [Sat, 25 Jul 2009 09:51:57 +0000 (11:51 +0200)]
Merge branch 'rt/plain-binary'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-blob: return 'application/octet-stream' for binary blobs
Lars Hjemli [Sat, 25 Jul 2009 09:51:19 +0000 (11:51 +0200)]
ui-blob: return 'application/octet-stream' for binary blobs

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-plain: Return 'application/octet-stream' for binary files.
Remko Tronçon [Sat, 25 Jul 2009 09:45:18 +0000 (11:45 +0200)]
ui-plain: Return 'application/octet-stream' for binary files.

Signed-off-by: Remko Tronçon <git@el-tramo.be>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'do/https'
Lars Hjemli [Sat, 25 Jul 2009 09:40:25 +0000 (11:40 +0200)]
Merge branch 'do/https'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agouse cgit_httpscheme() for atom feed
Diego Ongaro [Wed, 10 Jun 2009 23:18:34 +0000 (18:18 -0500)]
use cgit_httpscheme() for atom feed

15 years agoadd cgit_httpscheme() -> http:// or https://
Diego Ongaro [Wed, 10 Jun 2009 23:09:55 +0000 (18:09 -0500)]
add cgit_httpscheme() -> http:// or https://

15 years agoReturn http statuscode 404 on unknown branch
Lars Hjemli [Sun, 7 Jun 2009 18:43:08 +0000 (20:43 +0200)]
Return http statuscode 404 on unknown branch

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd head-include configuration option.
Mark Lodato [Sun, 15 Mar 2009 04:11:54 +0000 (00:11 -0400)]
Add head-include configuration option.

This patch adds an option to the configuration file, "head-include",
which works just like "header" or "footer", except the content is put
into the HTML's <head> tag.

15 years agoMerge branch 'stable'
Lars Hjemli [Sun, 15 Mar 2009 08:32:46 +0000 (09:32 +0100)]
Merge branch 'stable'

15 years agoCGIT 0.8.2.1 v0.8.2.1
Lars Hjemli [Sun, 15 Mar 2009 08:31:05 +0000 (09:31 +0100)]
CGIT 0.8.2.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFix doc-related glitches in Makefile and .gitignore
Lars Hjemli [Sun, 15 Mar 2009 08:27:54 +0000 (09:27 +0100)]
Fix doc-related glitches in Makefile and .gitignore

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Sun, 15 Mar 2009 08:06:20 +0000 (09:06 +0100)]
Merge branch 'stable'

15 years agoMerge branch 'asciidoc'
Lars Hjemli [Sun, 15 Mar 2009 08:05:49 +0000 (09:05 +0100)]
Merge branch 'asciidoc'

15 years agoui-snapshot: avoid segfault when no filename is specified
Lars Hjemli [Sun, 15 Mar 2009 07:57:33 +0000 (08:57 +0100)]
ui-snapshot: avoid segfault when no filename is specified

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agofix segfault when displaying empty blobs
Eric Wong [Sun, 15 Mar 2009 01:41:47 +0000 (18:41 -0700)]
fix segfault when displaying empty blobs

When size is zero, subtracting one from it turns it into
ULONG_MAX which causes an out-of-bounds access on buf.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for HEAD requests
Lars Hjemli [Thu, 19 Feb 2009 22:24:15 +0000 (23:24 +0100)]
Add support for HEAD requests

This is a quick 'n dirty hack which makes cgit honor HEAD requests.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for ETag in 'plain' view
Lars Hjemli [Thu, 19 Feb 2009 21:38:36 +0000 (22:38 +0100)]
Add support for ETag in 'plain' view

When downloading a blob identified by its path, the client might want
to know if the blob has been modified since a previous download of the
same path. To this end, an ETag containing the blob SHA1 seems to be
ideal.

Todo: add support for HEAD requests...

Suggested-by: Owen Taylor <otaylor@redhat.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tree: escape ascii-text properly in hexdump view
Lars Hjemli [Thu, 12 Feb 2009 10:26:14 +0000 (11:26 +0100)]
ui-tree: escape ascii-text properly in hexdump view

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMakefile: add doc-related targets
Lars Hjemli [Thu, 12 Feb 2009 09:53:31 +0000 (10:53 +0100)]
Makefile: add doc-related targets

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd cgit-doc.css
Lars Hjemli [Thu, 12 Feb 2009 09:24:25 +0000 (10:24 +0100)]
Add cgit-doc.css

This css is used to tweak the display of asciidoc-generated html for
cgitrc.5.txt.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: un-indent the name section
Lars Hjemli [Thu, 12 Feb 2009 09:12:05 +0000 (10:12 +0100)]
cgitrc.5.txt: un-indent the name section

Otherwise, this section is treated as a preformatted, literal block.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: wrap the example file in an asciidoc LiteralBlock
Lars Hjemli [Thu, 12 Feb 2009 09:02:09 +0000 (10:02 +0100)]
cgitrc.5.txt: wrap the example file in an asciidoc LiteralBlock

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: make the cgitrc options a valid asciidoc labeled list
Lars Hjemli [Thu, 12 Feb 2009 08:58:28 +0000 (09:58 +0100)]
cgitrc.5.txt: make the cgitrc options a valid asciidoc labeled list

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agomake cgitrc.5.txt asciidoc manpage compatible
Matt McCormick (thewtex) [Thu, 12 Feb 2009 05:06:05 +0000 (23:06 -0600)]
make cgitrc.5.txt asciidoc manpage compatible

According to the instructions and requirements here:
http://www.methods.co.nz/asciidoc/chunked/ar01s20.html

15 years agoAdd support for an 'embedded' option in cgitrc
Lars Hjemli [Thu, 22 Jan 2009 22:33:56 +0000 (23:33 +0100)]
Add support for an 'embedded' option in cgitrc

When activated, cgit will neither generate http headers nor any 'framing'
html elements (like <html> and <body>). Also, all page content is now
wrapped in a <div id='cgit'> element to make it easier to select the
correct cgit classes when embedded/themed.

Suggested-by: Matt Sealey <matt@genesi-usa.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoCGIT 0.8.2 v0.8.2
Lars Hjemli [Sun, 1 Feb 2009 18:31:37 +0000 (19:31 +0100)]
CGIT 0.8.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoUse GIT-1.6.1.1
Lars Hjemli [Sun, 1 Feb 2009 18:30:16 +0000 (19:30 +0100)]
Use GIT-1.6.1.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/binary'
Lars Hjemli [Sun, 1 Feb 2009 18:29:47 +0000 (19:29 +0100)]
Merge branch 'lh/binary'

15 years agoshared.c: avoid SEGFAULT when checking for binary buffers
Lars Hjemli [Sun, 1 Feb 2009 18:29:24 +0000 (19:29 +0100)]
shared.c: avoid SEGFAULT when checking for binary buffers

Before calling buffer_is_binary() we need to verify that the buffer
is valid.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/header'
Lars Hjemli [Sun, 1 Feb 2009 18:17:52 +0000 (19:17 +0100)]
Merge branch 'lh/header'

15 years agoui-tree: show hexdump of binary blobs
Lars Hjemli [Sat, 31 Jan 2009 16:45:48 +0000 (17:45 +0100)]
ui-tree: show hexdump of binary blobs

This teaches ui-tree to detect binary blobs and display them similar
to `hexdump -C` (only wider).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoHandle binary files in diffs
Lars Hjemli [Sat, 31 Jan 2009 09:40:40 +0000 (10:40 +0100)]
Handle binary files in diffs

This teaches all diff-related operations (i.e. ui-log, ui-diff and ui-patch)
how to handle binary files.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Thu, 29 Jan 2009 21:21:24 +0000 (22:21 +0100)]
Merge branch 'stable'

15 years agohtml.c: use correct escaping in html attributes
Lars Hjemli [Thu, 29 Jan 2009 21:21:15 +0000 (22:21 +0100)]
html.c: use correct escaping in html attributes

First, an apostrophe is not a quote. Second, we also need to escape
quotes. And finally, quotes are encoded as '&quot;', not '&quote;'.

Sighned-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for a custom header
Lars Hjemli [Thu, 29 Jan 2009 20:27:39 +0000 (21:27 +0100)]
Add support for a custom header

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Tue, 27 Jan 2009 22:03:05 +0000 (23:03 +0100)]
Merge branch 'stable'

15 years agoMerge branch 'jw/commit-decorations'
Lars Hjemli [Tue, 27 Jan 2009 22:00:40 +0000 (23:00 +0100)]
Merge branch 'jw/commit-decorations'

Conflicts:
cgit.css

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agotests/t0105-commit.sh: expect commit decorations
Lars Hjemli [Tue, 27 Jan 2009 21:59:23 +0000 (22:59 +0100)]
tests/t0105-commit.sh: expect commit decorations

When a commit is referenced by a branch or tag the commit subject-
line will be suffixed with the proper decorations, hence the test
for this line needs to be updated.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.css: minor adjustment of commit decorations
Lars Hjemli [Tue, 27 Jan 2009 21:42:03 +0000 (22:42 +0100)]
cgit.css: minor adjustment of commit decorations

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd decorations to commit pages
Justin Waters [Mon, 12 Jan 2009 15:23:28 +0000 (10:23 -0500)]
Add decorations to commit pages

This adds the tag and branch head decorations to the commit pages.  This is
similar to how commits are displayed in the standard gitweb interface.

Signed-off-by: Justin Waters <justin.waters@timesys.com>