]> git.cameronkatri.com Git - cgit.git/log
cgit.git
14 years agoClear the whole context
Daniel Milde [Sun, 21 Feb 2010 13:38:59 +0000 (14:38 +0100)]
Clear the whole context

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared.c: fix segfault when repo is empty
Florian Pritz [Mon, 1 Feb 2010 16:55:37 +0000 (17:55 +0100)]
ui-shared.c: fix segfault when repo is empty

PATH_INFO="/$REPONAME/commit/?id=1" QUERY_STRING="id=1" ./cgit.cgi
triggers segfault when the repository is empty and therefore
ctx.qry.head is unset

Signed-off-by: Florian Pritz <bluewind@xssn.at>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agohtml: properly percent-escape URLs
Mark Lodato [Tue, 9 Feb 2010 15:12:43 +0000 (10:12 -0500)]
html: properly percent-escape URLs

The only valid characters for a URL are unreserved characters
a-zA-Z0-9_-.~ and the reserved characters !*'();:@&=+$,/?%#[] , as per
RFC 3986.  Everything else must be escaped.  Additionally, the # and
? always have special meaning, and the &, =, and + have special meaning
in a query string, so they too must be escaped.  To make this easier,
a table of escapes is now used so that we do not have to call fmt() for
each character; if the entry is 0, no escaping is needed.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agohtml: make all strings 'const char *'
Mark Lodato [Tue, 9 Feb 2010 04:04:41 +0000 (23:04 -0500)]
html: make all strings 'const char *'

None of the html_* functions modify their argument, so they can all be
'const char *' instead of a simple 'char *'.  This removes the need to
cast (or copy) when trying to print a const string.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agoui-plain: print directory listings
Mark Lodato [Sun, 31 Jan 2010 19:25:03 +0000 (14:25 -0500)]
ui-plain: print directory listings

When a user requests a plain view of a tree (as opposed to a blob),
print out a directory listing rather than giving a 404 Not Found.

Also, fix a segfault when ctx->qry.path is NULL - i.e, when /plain is
requested without a path.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agoui-plain: more efficient walk_tree()
Mark Lodato [Sun, 31 Jan 2010 06:07:41 +0000 (01:07 -0500)]
ui-plain: more efficient walk_tree()

Git's read_tree_recursive() already filters out the objects by pathname,
so we only have to compare baselen to the expected.  That is, no string
matching is required.

Additionally, if the requested path is a directory, the old code would
walk through all of its immediate children.  This is not necessary, this
so we no longer do that.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agoui-plain: remove unused curr_rev variable
Mark Lodato [Sun, 31 Jan 2010 04:54:16 +0000 (23:54 -0500)]
ui-plain: remove unused curr_rev variable

Signed-off-by: Mark Lodato <lodatom@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Sat, 12 Dec 2009 11:09:47 +0000 (12:09 +0100)]
Merge branch 'stable'

15 years agoCGIT 0.8.3.1 v0.8.3.1
Lars Hjemli [Sat, 12 Dec 2009 11:08:14 +0000 (12:08 +0100)]
CGIT 0.8.3.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFix segfault on ppc when browsing tree
Martins Polakovs [Thu, 10 Dec 2009 15:35:42 +0000 (17:34 +0159)]
Fix segfault on ppc when browsing tree

15 years agoAdd .tar.xz-snapshot support
Andreas Wiese [Tue, 8 Dec 2009 21:18:11 +0000 (22:18 +0100)]
Add .tar.xz-snapshot support

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/remote-branches'
Lars Hjemli [Tue, 8 Dec 2009 18:34:30 +0000 (19:34 +0100)]
Merge branch 'lh/remote-branches'

15 years agoMerge branch 'ro/ssdiff'
Lars Hjemli [Tue, 8 Dec 2009 18:32:48 +0000 (19:32 +0100)]
Merge branch 'ro/ssdiff'

15 years agoMerge branch 'master' of http://op-co.de/cgit
Lars Hjemli [Tue, 8 Dec 2009 17:31:07 +0000 (18:31 +0100)]
Merge branch 'master' of http://op-co.de/cgit

15 years agoMerge branch 'stable'
Lars Hjemli [Tue, 8 Dec 2009 17:30:02 +0000 (18:30 +0100)]
Merge branch 'stable'

15 years agoDon't crash when a repo-specific readme file is used
Sami Kyöstilä [Tue, 8 Dec 2009 17:18:10 +0000 (18:18 +0100)]
Don't crash when a repo-specific readme file is used

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years ago"max-blob-size" config var to limit generated HTML size
Georg Lukas [Sat, 28 Nov 2009 02:44:33 +0000 (03:44 +0100)]
"max-blob-size" config var to limit generated HTML size

Sometimes it is not feasible to generate the HTML pretty-print for large
files, especially if a source-filter is involved or binary data is to be
displayed. The "max-blob-size" config var allows to disable HTML output
for blobs bigger than X KBytes. Plain downloads are not affected.

Signed-off-by: Georg Lukas <georg@op-co.de>
15 years agocgit.css: highlight directories in tree
Georg Lukas [Sat, 28 Nov 2009 02:07:34 +0000 (03:07 +0100)]
cgit.css: highlight directories in tree

15 years agosyntax highlighting for all formats supported by "highlight"
Georg Lukas [Thu, 19 Nov 2009 11:14:45 +0000 (12:14 +0100)]
syntax highlighting for all formats supported by "highlight"

The highlight tool can be given any of the supported file extensions
as its -S parameter. This patch replaces the case-switch by extracting
the extension from the supplied file name and passing it to highlight.
However, this requires a shell supporting the ${var##pattern} syntax,
like dash or bash.

Unknown extensions cause a fall-back to plain text using the --force
switch. Error messages are redirected to /dev/null.

A special case maps Makefile and Makefile.* to the "mk" extension.

The total overhead is reduced by calling "exec highlight". No forks are
needed during script execution.

Signed-off-by: Georg Lukas <georg@op-co.de>
15 years agoAdd support for remote branches
Lars Hjemli [Sat, 7 Nov 2009 18:10:58 +0000 (19:10 +0100)]
Add support for remote branches

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Sat, 7 Nov 2009 17:16:50 +0000 (18:16 +0100)]
Merge branch 'stable'

15 years agoshared.c: return original errno
Lars Hjemli [Sat, 7 Nov 2009 17:08:30 +0000 (18:08 +0100)]
shared.c: return original errno

Noticed-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd NO_OPENSSL option
Mikhail Gusarov [Wed, 28 Oct 2009 21:39:55 +0000 (03:39 +0600)]
Add NO_OPENSSL option

Linking with OpenSSL is not always desirable. Add NO_OPENSSL option
to use SHA-1 code bundled with Git.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
15 years agoIn side-by-side diff, add support for marking individual characters.
Ragnar Ouchterlony [Sun, 25 Oct 2009 17:13:22 +0000 (18:13 +0100)]
In side-by-side diff, add support for marking individual characters.

Refuses to do so if the left hand side of the diff has different amount of
differing lines to the right hand side to avoid confusion.

Note that I use the naive dynamic programming approach for calculating the
longest common subsequence. We could probably be more efficient by using a
better algorithm. The LCS calculating function is O(n*m) and uses up n*m
amount of memory too (so if we we compare two strings of length 100, I use
an array of 10000 for calculating the LCS). Might want to not calculate LCS
if the length of the line is too large.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
15 years agoMerge branch 'stable'
Lars Hjemli [Sat, 7 Nov 2009 14:35:36 +0000 (15:35 +0100)]
Merge branch 'stable'

15 years agoClose fd on error in readfile()
Rys Sommefeldt [Sat, 7 Nov 2009 14:24:45 +0000 (15:24 +0100)]
Close fd on error in readfile()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoNov is the correct abbreviation
Danijel Tašov [Mon, 2 Nov 2009 21:10:04 +0000 (22:10 +0100)]
Nov is the correct abbreviation

15 years agoui-shared.c: prettify download links when generated from tag page
Lars Hjemli [Fri, 16 Oct 2009 00:03:32 +0000 (02:03 +0200)]
ui-shared.c: prettify download links when generated from tag page

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tag: make output more similar to commit view
Lars Hjemli [Tue, 6 Oct 2009 18:33:04 +0000 (20:33 +0200)]
ui-tag: make output more similar to commit view

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tag: add snapshot links
Alexey Nezhdanov [Sun, 27 Sep 2009 19:00:29 +0000 (23:00 +0400)]
ui-tag: add snapshot links

Signed-off-by: Alexey Nezhdanov <snakeru@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoSkip leading "/" in url querystring value
Stefan Bühler [Mon, 14 Sep 2009 21:37:13 +0000 (21:37 +0000)]
Skip leading "/" in url querystring value

Makes it easier to rewrite :)
lighttpd-sandbox: rewrite "/cgit.cgi?url=%{enc:request.path}&%{request.query}";

Signed-off-by: Stefan Bühler <source@stbuehler.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFix repolist search links with virtual root
Geoff Johnstone [Sun, 20 Sep 2009 10:32:07 +0000 (11:32 +0100)]
Fix repolist search links with virtual root

Signed-off-by: Geoff Johnstone <geoff.johnstone@googlemail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFixed side-by-side diff bugs related to binary diff and more.
Ragnar Ouchterlony [Wed, 16 Sep 2009 16:56:26 +0000 (18:56 +0200)]
Fixed side-by-side diff bugs related to binary diff and more.

The fixed bugs:

 * "Binary files differ" did not show up either in unidiff or
   side-by-side-diff.
 * Subproject diffs did not work for side-by-side diffs.
 * The ssdiff link on diff pages did not conserve the path.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoPolishing of how the side-by-side diff looks.
Ragnar Ouchterlony [Tue, 15 Sep 2009 17:44:37 +0000 (19:44 +0200)]
Polishing of how the side-by-side diff looks.

Aligned all different files, so that all side-by-side tables look
the same. Also made sure that the tables take up the whole browser
width.

Also various changes to the css to make things easier on the eye.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd possibility to switch between unidiff and side-by-side-diff.
Ragnar Ouchterlony [Mon, 14 Sep 2009 18:19:02 +0000 (20:19 +0200)]
Add possibility to switch between unidiff and side-by-side-diff.

A new config option side-by-side-diffs added, defaulting to 0,
meaning unidiff. Also a query option (ss) is used toggle this.

In the commit page you can switch between the two diff formats by
clicking on the link on the "commit"-row, to the right of (patch).

In the diff page you can switch by using the link at the start
of the page.

All commit-links and diff-links will remember the choice.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFirst version of side-by-side diff.
Ragnar Ouchterlony [Sun, 13 Sep 2009 17:36:35 +0000 (19:36 +0200)]
First version of side-by-side diff.

This constitutes the first prototype of a side-by-side diff. It is not
possible to switch between unidiff and side-by-side diff at all at this
stage.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: Change repo.group to section in example config.
Loui Chang [Mon, 14 Sep 2009 05:21:11 +0000 (01:21 -0400)]
cgitrc.5.txt: Change repo.group to section in example config.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: Add mansource and manmanual.
Loui Chang [Mon, 14 Sep 2009 05:21:10 +0000 (01:21 -0400)]
cgitrc.5.txt: Add mansource and manmanual.

This prevents FIXMEs from appearing.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoCGIT 0.8.3 v0.8.3
Lars Hjemli [Sun, 13 Sep 2009 20:17:02 +0000 (22:17 +0200)]
CGIT 0.8.3

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Sun, 13 Sep 2009 20:15:38 +0000 (22:15 +0200)]
Merge branch 'stable'

15 years agoCGIT 0.8.2.2 v0.8.2.2
Lars Hjemli [Sun, 13 Sep 2009 20:14:12 +0000 (22:14 +0200)]
CGIT 0.8.2.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/repo-scan'
Lars Hjemli [Sun, 13 Sep 2009 20:02:07 +0000 (22:02 +0200)]
Merge branch 'lh/repo-scan'

15 years agoMerge branch 'fp/linenumbers'
Lars Hjemli [Sun, 13 Sep 2009 20:01:52 +0000 (22:01 +0200)]
Merge branch 'fp/linenumbers'

15 years agoUse GIT-1.6.4.3
Lars Hjemli [Sun, 13 Sep 2009 19:56:45 +0000 (21:56 +0200)]
Use GIT-1.6.4.3

Signed-off-by: Lars Hjemli <larsh@slackbox.hjemli.net>
15 years agoMerge branch 'stable'
Lars Hjemli [Sun, 6 Sep 2009 17:33:27 +0000 (19:33 +0200)]
Merge branch 'stable'

15 years agoui-plain.c: only return the blob with the specified path
Lars Hjemli [Sun, 6 Sep 2009 17:33:10 +0000 (19:33 +0200)]
ui-plain.c: only return the blob with the specified path

When a path to a directory was specified for the 'plain'
view, each blob in the directory used to be returned to
the client. This patch fixes the issue by matching the
path of each blob against the requested path.

Noticed-by: Lars Stoltenow <penma@penma.de>
Signed-off-by: Lars Hjemli <larsh@slackbox.hjemli.net>
15 years agocgit.c: respect repo-local 'snapshots' option for --scan-path
Lars Hjemli [Mon, 24 Aug 2009 11:31:49 +0000 (13:31 +0200)]
cgit.c: respect repo-local 'snapshots' option for --scan-path

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>
15 years agocgit.c: only print first line of repo.desc in print_repo()
Lars Hjemli [Mon, 24 Aug 2009 11:27:15 +0000 (13:27 +0200)]
cgit.c: only print first line of repo.desc in print_repo()

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>
15 years agoAdd and use cgit_find_stats_periodname() in print_repo()
Lars Hjemli [Mon, 24 Aug 2009 09:02:48 +0000 (11:02 +0200)]
Add and use cgit_find_stats_periodname() in print_repo()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: generate repo.snapshots in print_repo()
Lars Hjemli [Mon, 24 Aug 2009 08:55:01 +0000 (10:55 +0200)]
cgit.c: generate repo.snapshots in print_repo()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: add missing options to print_repo()
Lars Hjemli [Mon, 24 Aug 2009 08:22:21 +0000 (10:22 +0200)]
cgit.c: add missing options to print_repo()

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>
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 agocgit.css: make the blob display in tree view a bit prettier
Lars Hjemli [Fri, 21 Aug 2009 12:37:50 +0000 (14:37 +0200)]
cgit.css: make the blob display in tree view a bit prettier

Adding some padding to the linenumbers while right-aligning them and
removing the background color makes the page more readable.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoRename "linenumbers" to "enable-tree-linenumbers", change default to "1"
Lars Hjemli [Fri, 21 Aug 2009 12:26:52 +0000 (14:26 +0200)]
Rename "linenumbers" to "enable-tree-linenumbers", change default to "1"

This makes the name of the cgitrc option more descriptive and at the
same time changes the default from "0" to "1" in an attempt to stay
backwards compatible - prior to the introduction of "source-filter"
and "linenumbers", cgit always generated linenumber links in the
tree view, but now this feature can be turned off (one might want to
do this if the source-filter performs line-wrapping etc).

While at it, the documentation is updated to match the surrounding
descriptions.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd 'linenumbers' config option
Florian Pritz [Sun, 9 Aug 2009 20:42:45 +0000 (20:42 +0000)]
Add 'linenumbers' config option

Signed-off-by: Florian Pritz <bluewind@xssn.at>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tree.c: show line numbers when highlighting
Florian Pritz [Sun, 9 Aug 2009 13:43:18 +0000 (13:43 +0000)]
ui-tree.c: show line numbers when highlighting

When source-filter is enabled, cgit currently will not display
linenumbers in the tree view. This patch restores the linenumber
function.

Signed-off-by: Florian Pritz <bluewind@xssn.at>
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>