]> granicus.if.org Git - cgit/log
cgit
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>
16 years agoMerge branch 'stable'
Lars Hjemli [Tue, 27 Jan 2009 22:03:05 +0000 (23:03 +0100)]
Merge branch 'stable'

16 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>
16 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>
16 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>
16 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>
16 years agoCGIT 0.8.1.1 v0.8.1.1
Lars Hjemli [Tue, 27 Jan 2009 19:35:49 +0000 (20:35 +0100)]
CGIT 0.8.1.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'og/tree-view-selection'
Lars Hjemli [Tue, 27 Jan 2009 19:21:56 +0000 (20:21 +0100)]
Merge branch 'og/tree-view-selection'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/stats'
Lars Hjemli [Tue, 27 Jan 2009 19:16:37 +0000 (20:16 +0100)]
Merge branch 'lh/stats'

Conflicts:
cgit.c
cgit.css
cgit.h
ui-tree.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Mon, 12 Jan 2009 07:57:23 +0000 (08:57 +0100)]
Merge branch 'stable'

16 years agoMakefile: install cgit.{css,png} in CGIT_DATA_PATH
Todd Zullinger [Sun, 11 Jan 2009 23:23:59 +0000 (18:23 -0500)]
Makefile: install cgit.{css,png} in CGIT_DATA_PATH

CGIT_DATA_PATH defaults to CGIT_SCRIPT_PATH, but allows users to
install the cgi and the data files in different locations.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: add INSTALL var to set install command
Todd Zullinger [Sun, 11 Jan 2009 23:23:52 +0000 (18:23 -0500)]
Makefile: add INSTALL var to set install command

This also explicitly sets the modes for installed files (755 for the
.cgi, 644 for the .css and .png).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix tar.bz2 snapshot example
Todd Zullinger [Sun, 11 Jan 2009 23:23:39 +0000 (18:23 -0500)]
Fix tar.bz2 snapshot example

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Sun, 11 Jan 2009 21:00:25 +0000 (22:00 +0100)]
Merge branch 'stable'

16 years agoAvoid SEGFAULT on invalid requests
Lars Hjemli [Sun, 11 Jan 2009 20:23:04 +0000 (21:23 +0100)]
Avoid SEGFAULT on invalid requests

When an unknown page is requested, either on the querystring or via
PATH_INFO, we end up with a null-referencing cgit_cmd. This null-
pointer is then used as argument to the hc() function (which decides
what tab to render as 'active'), but this function failed to check if a
valid cmd was specified and a SEGFAULT would occur. This patch fixes the
issue by introducing a 'fallback-cmd' which specifies what tab to render
as 'active' when no valid cmd is requested.

While at it, we now also keep track of the active repository even if an
invalid cmd was requested since we want to show the error message about
the invalid request in the correct context.

Noticed-by: Robin Redeker <elmex@ta-sa.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMake all tags viewable
Robin Redeker [Sun, 11 Jan 2009 15:25:01 +0000 (16:25 +0100)]
Make all tags viewable

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Sun, 11 Jan 2009 15:38:19 +0000 (16:38 +0100)]
Merge branch 'stable'

16 years agoui-tag: escape tagnames properly
Lars Hjemli [Sun, 11 Jan 2009 15:37:47 +0000 (16:37 +0100)]
ui-tag: escape tagnames properly

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoChange toggle to more meaningful term
Justin Waters [Fri, 9 Jan 2009 22:35:10 +0000 (17:35 -0500)]
Change toggle to more meaningful term

In the log interface, there is a toggle link at the top, but it isn't clear
what's being toggled.  I've changed it to "Expand" and "Collapse" to make it
clear that you are getting more and less information, respectively.

Signed-off-by: Justin Waters <justin.waters@timesys.com>
16 years agoMerge branch 'snapshot-fixes'
Lars Hjemli [Sun, 11 Jan 2009 11:22:46 +0000 (12:22 +0100)]
Merge branch 'snapshot-fixes'

16 years agoMerge branch 'lh/mimetypes'
Lars Hjemli [Sun, 11 Jan 2009 11:22:31 +0000 (12:22 +0100)]
Merge branch 'lh/mimetypes'

16 years agoMerge branch 'lh/virtual-root'
Lars Hjemli [Sun, 11 Jan 2009 11:22:19 +0000 (12:22 +0100)]
Merge branch 'lh/virtual-root'

16 years agoMerge branch 'stable'
Lars Hjemli [Sun, 11 Jan 2009 11:18:25 +0000 (12:18 +0100)]
Merge branch 'stable'

16 years agoui-log: show name-decorations in log output
Lars Hjemli [Sun, 11 Jan 2009 11:16:18 +0000 (12:16 +0100)]
ui-log: show name-decorations in log output

Commits are now decorated with a clickable 'label' for each ref pointing
at it, similar to how gitweb and gitk displays commit decorations.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: avoid libcurl when building git
Lars Hjemli [Sat, 10 Jan 2009 14:18:18 +0000 (15:18 +0100)]
Makefile: avoid libcurl when building git

We don't need support for fetching/pushing in libgit.a, hence we don't need
to link with libcurl.

Noticed-by: Robin Redeker <elmex@ta-sa.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-refs: avoid SEGFAULT on lightweight tags
Robin Redeker [Sat, 10 Jan 2009 11:44:08 +0000 (12:44 +0100)]
ui-refs: avoid SEGFAULT on lightweight tags

Signed-off-by: Robin Redeker <elmex@ta-sa.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agochanged objects are outputted, allowing for selections of code only
Onne Gorter [Wed, 7 Jan 2009 12:56:14 +0000 (13:56 +0100)]
changed objects are outputted, allowing for selections of code only

16 years agoMerge branch 'stable'
Lars Hjemli [Tue, 6 Jan 2009 20:51:09 +0000 (21:51 +0100)]
Merge branch 'stable'

16 years agoui-tree.c: do not add blank line when displaying blobs
Lars Hjemli [Tue, 6 Jan 2009 20:37:23 +0000 (21:37 +0100)]
ui-tree.c: do not add blank line when displaying blobs

Also, fix a related bug in the test-suite.

Noticed-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Tue, 30 Dec 2008 11:29:50 +0000 (12:29 +0100)]
Merge branch 'stable'

16 years agoui-patch: whitespace changes in the patch generation code
Tomas Carnecky [Tue, 30 Dec 2008 10:14:52 +0000 (11:14 +0100)]
ui-patch: whitespace changes in the patch generation code

Add a space between the committer name and email, and remove
superfluous spaces in the date header.

This makes cgit-generated patches match the output from git-format-patch
almost exactly, at least as far as the email headers go.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agotests/t0107-snapshot.sh: make testscript match updated snapshot behavior
Lars Hjemli [Sun, 28 Dec 2008 09:52:35 +0000 (10:52 +0100)]
tests/t0107-snapshot.sh: make testscript match updated snapshot behavior

Since cgit now returns a 404 error when the snapshot filename cannot be
resolved to a commit object, the testscript needs to request a valid
snapshot name.

Also, the script assumed that the toplevel directory in the snapshot
would get the name of the repository but it's now named similar to
the requested snapshot.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoreturn 404 if snapshot is not found
Natanael Copa [Tue, 2 Dec 2008 10:31:34 +0000 (11:31 +0100)]
return 404 if snapshot is not found

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-snapshot.c: change mime-type for tar.gz and tar.bz2
Lars Hjemli [Fri, 26 Dec 2008 10:33:59 +0000 (11:33 +0100)]
ui-snapshot.c: change mime-type for tar.gz and tar.bz2

The updated mime-types seems to work better than the old ones with both
safari and firefox.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.1
Lars Hjemli [Fri, 26 Dec 2008 10:03:01 +0000 (11:03 +0100)]
Use GIT-1.6.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoshared.c: future-proof usage of git diff-structures
Lars Hjemli [Fri, 26 Dec 2008 10:02:02 +0000 (11:02 +0100)]
shared.c: future-proof usage of git diff-structures

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUntie logic for SCRIPT_NAME and PATH_INFO
Lars Hjemli [Fri, 26 Dec 2008 09:33:01 +0000 (10:33 +0100)]
Untie logic for SCRIPT_NAME and PATH_INFO

SCRIPT_NAME is used as fallback for virtual-root when virtual-root is
unspecified in cgitrc and PATH_INFO is used as fallback for the query-
string parameter 'url' when the latter is unspecified. But until now,
the use of PATH_INFO depended on virtual-root also being unspecified,
i.e. it was impossible to use PATH_INFO when virtual-root was specified.

This commit makes the fallback on SCRIPT_NAME and PATH_INFO independent
code paths, i.e. it is now possible to specify virtual-root in cgitrc
while still using PATH_INFO (instead of rewrite rules) to get 'pretty
urls'.

Noticed-by: Jack Moffitt <jack@chesspark.com>
Noticed-by: LiKai Liu <liulk@cs.bu.edu>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-stats.c: reuse cgit_add_hidden_formfields()
Lars Hjemli [Sun, 7 Dec 2008 14:57:55 +0000 (15:57 +0100)]
ui-stats.c: reuse cgit_add_hidden_formfields()

This makes sure that the currect branch and path is preserved when
changing the stats period or author count.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: externalize add_hidden_formfields()
Lars Hjemli [Sun, 7 Dec 2008 14:52:35 +0000 (15:52 +0100)]
ui-shared: externalize add_hidden_formfields()

This function will be reused by ui-stats.c in the next commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-tree: add link to stats page per path
Lars Hjemli [Sun, 7 Dec 2008 12:34:42 +0000 (13:34 +0100)]
ui-tree: add link to stats page per path

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: add and use cgit_stats_link()
Lars Hjemli [Sun, 7 Dec 2008 12:34:16 +0000 (13:34 +0100)]
ui-shared: add and use cgit_stats_link()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-stats: replace 'enable-stats' setting with 'max-stats'
Lars Hjemli [Sun, 7 Dec 2008 12:17:21 +0000 (13:17 +0100)]
ui-stats: replace 'enable-stats' setting with 'max-stats'

The new 'max-stats' and 'repo.max-stats' settings makes it possible to
define the maximum statistics period, both globally and per repo. Hence,
it is now feasible to allow statistics on repositories with a high commit
frequency, like linux-2.6, by setting repo.max-stats to e.g. 'month'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-stats: enable path-filtered stats
Lars Hjemli [Sun, 7 Dec 2008 10:45:28 +0000 (11:45 +0100)]
ui-stats: enable path-filtered stats

When a path is specified on the querystring the commit statistics will
now be filtered by this path.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd a 'stats' page to each repo
Lars Hjemli [Sat, 6 Dec 2008 16:38:19 +0000 (17:38 +0100)]
Add a 'stats' page to each repo

This new page, which is disabled by default, can be used to print some
statistics about the number of commits per period in the repository,
where period can be either weeks, months, quarters or years.

The function can be activated globally by setting 'enable-stats=1' in
cgitrc and disabled for individual repos by setting 'repo.enable-stats=0'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Sat, 6 Dec 2008 11:05:21 +0000 (12:05 +0100)]
Merge branch 'stable'

16 years agotests/setup.sh: allow testsuite to fail properly with POSIX standard shells
Lars Hjemli [Sat, 6 Dec 2008 11:03:54 +0000 (12:03 +0100)]
tests/setup.sh: allow testsuite to fail properly with POSIX standard shells

The "((expr))" construct is not implemented by e.g. dash, so this commit
replaces the construct with a more portable one.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agotests/t0010-validate-html.sh: skip tests if 'tidy' is not available
Lars Hjemli [Sat, 6 Dec 2008 10:53:59 +0000 (11:53 +0100)]
tests/t0010-validate-html.sh: skip tests if 'tidy' is not available

Noticed-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'full-log'
Lars Hjemli [Sat, 6 Dec 2008 10:37:37 +0000 (11:37 +0100)]
Merge branch 'full-log'

Conflicts:
cgit.c
cgit.h

16 years agoMerge branch 'lh/sort-repolist'
Lars Hjemli [Sat, 6 Dec 2008 10:35:49 +0000 (11:35 +0100)]
Merge branch 'lh/sort-repolist'

16 years agoMerge branch 'snapshot-fixes'
Lars Hjemli [Sat, 6 Dec 2008 10:34:48 +0000 (11:34 +0100)]
Merge branch 'snapshot-fixes'

16 years agoMerge branch 'stable'
Lars Hjemli [Sat, 6 Dec 2008 10:33:05 +0000 (11:33 +0100)]
Merge branch 'stable'

16 years agoMerge branch 'rj/buildtweaks' into stable
Lars Hjemli [Fri, 5 Dec 2008 18:13:32 +0000 (19:13 +0100)]
Merge branch 'rj/buildtweaks' into stable

16 years agoparsing.c: enable builds with NO_ICONV defined
Lars Hjemli [Fri, 5 Dec 2008 18:10:28 +0000 (19:10 +0100)]
parsing.c: enable builds with NO_ICONV defined

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-repolist: avoid build warning for strcasestr(3)
Lars Hjemli [Fri, 5 Dec 2008 18:04:17 +0000 (19:04 +0100)]
ui-repolist: avoid build warning for strcasestr(3)

The non-standard function strcasestr is only defined if _GNU_SOURCE has
also been defined.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: allow cgit.conf to override platform-specific tweaks
Lars Hjemli [Fri, 5 Dec 2008 17:47:16 +0000 (18:47 +0100)]
Makefile: allow cgit.conf to override platform-specific tweaks

If the makefile doesn't automatically define the correct build variables
it is nice to be able to define them explicitly.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoExtra cygwin-specific changes
Ramsay Jones [Sat, 15 Nov 2008 18:26:32 +0000 (18:26 +0000)]
Extra cygwin-specific changes

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-log: try to disambiguate ref names
Lars Hjemli [Wed, 3 Dec 2008 16:34:23 +0000 (17:34 +0100)]
ui-log: try to disambiguate ref names

The 'h' querystring parameter in cgit is normally used to specify
a branch (i.e. a ref below refs/heads/), but if a repository contains
a tag with the same name as a branch the output from ui-log would use
the tag as start-revision.

This patch tries to fix the issue by checking if the specified ref is
valid as a branch name; if so, the full refname is used in the call
to setup_revisions().

Noticed-by: Takamori Yamaguchi <akschar@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: shorten the sha1 printed by cgit_object_link
Lars Hjemli [Mon, 1 Dec 2008 20:58:59 +0000 (21:58 +0100)]
ui-shared: shorten the sha1 printed by cgit_object_link

Such links was printed as the object type followed by the objects complete
sha1. We still use the complete sha1 in the link but we no longer show it
in all its glory; only the first 10 hex chars are printed.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>