]> granicus.if.org Git - cgit/log
cgit
16 years agoMerge branch 'stable'
Lars Hjemli [Fri, 14 Nov 2008 08:30:28 +0000 (09:30 +0100)]
Merge branch 'stable'

16 years agoui-repolist: handle empty agefiles
Lars Hjemli [Fri, 14 Nov 2008 08:29:22 +0000 (09:29 +0100)]
ui-repolist: handle empty agefiles

When the agefile was empty the old code would happily reuse the static
buffer filled by a previous call to read_agefile().

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Thu, 6 Nov 2008 19:47:19 +0000 (20:47 +0100)]
Merge branch 'stable'

16 years agoUse mode 0644 for non-executable files
Karl Chen [Wed, 5 Nov 2008 10:45:18 +0000 (02:45 -0800)]
Use mode 0644 for non-executable files

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Thu, 6 Nov 2008 18:18:27 +0000 (19:18 +0100)]
Merge branch 'stable'

16 years agoFix tests to work on Ubuntu (dash)
Ramsay Jones [Tue, 4 Nov 2008 19:23:41 +0000 (19:23 +0000)]
Fix tests to work on Ubuntu (dash)

The system shell (/bin/sh) on Ubuntu is dash, which aims to be a
POSIX standard shell.  In particular, dash does not implement any
of the common extensions to the standard that, say, bash and ksh
do.

Replace some non-POSIX constructs in setup.sh with more portable
and mundane code.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix some warnings to allow -Werror
Ramsay Jones [Tue, 4 Nov 2008 19:22:08 +0000 (19:22 +0000)]
Fix some warnings to allow -Werror

The type used to declare the st_size field of a 'struct stat' can
be a 32- or 64-bit sized type, which can vary from one platform to
another, or even from one compilation to another.  In particular,
on linux, if you include the following define:

    #define _FILE_OFFSET_BITS 64

prior to including certain system header files, then the type used
for the st_size field will be __off64_t, otherwise it will be an
__off_t.  Note that the above define is included at the top of
git-compat-util.h.

In cache.c, the "%zd" format specifier expects a "signed size_t",
another type which can vary, when an __off64_t or a __off_t is
provided.  To supress the warning, use the PRIuMAX format specifier
and cast the st_size field to uintmax_t.  This should work an any
platform for which git currently compiles.

In ui-plain.c, the size parameter of sha1_object_info() and
read_sha1_file() is defined to be "unsigned long *" not "size_t *".
So, to supress the warning, simply declare size with the correct type.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.0.3
Lars Hjemli [Thu, 6 Nov 2008 18:13:21 +0000 (19:13 +0100)]
Use GIT-1.6.0.3

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoCGIT 0.8.1 v0.8.1
Lars Hjemli [Sat, 11 Oct 2008 18:22:57 +0000 (20:22 +0200)]
CGIT 0.8.1

16 years agoMerge branch 'stable'
Lars Hjemli [Sat, 11 Oct 2008 18:21:17 +0000 (20:21 +0200)]
Merge branch 'stable'

* stable:
  Makefile: enable compilation on uclibc

16 years agoMakefile: enable compilation on uclibc
Lars Hjemli [Sat, 11 Oct 2008 18:21:06 +0000 (20:21 +0200)]
Makefile: enable compilation on uclibc

Original-patch-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-snapshot: add dwimmery
Lars Hjemli [Sat, 11 Oct 2008 18:09:42 +0000 (20:09 +0200)]
ui-snapshot: add dwimmery

When downloading a snapshot, the snapshot name will often contain the repo
name combined with a tag. This patch tries to exploit this so that the
correct revision is downloaded even if no specific revision is specified.

PS: this only occurs if neither 'h' nor 'id' is specified in the query-
string.

PPS: this also fixes a bug which occurs when trying to download a filename
with an unsupported suffix: it used to try to print an error message to
the user but failed since it didn't prepare the output properly.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd cgit_query.nohead flag
Lars Hjemli [Sat, 11 Oct 2008 17:05:50 +0000 (19:05 +0200)]
Add cgit_query.nohead flag

This flag is set when no HEAD is specified in the querystring. Currently
it has no users, but it will be used by ui-snapshot to invoke a DWIM-mode
where the revision is extracted from the snapshot name.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: specify correct css class for summary tab
Lars Hjemli [Mon, 6 Oct 2008 14:00:42 +0000 (16:00 +0200)]
ui-shared: specify correct css class for summary tab

When introducing cgit_summary_link() in 49ecbbdd I forgot to specify the
css class. This fixes it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoCGIT 0.8 v0.8
Lars Hjemli [Sun, 5 Oct 2008 19:23:39 +0000 (21:23 +0200)]
CGIT 0.8

16 years agoui-summary: use html_url_path()
Lars Hjemli [Sun, 5 Oct 2008 19:21:42 +0000 (21:21 +0200)]
ui-summary: use html_url_path()

This makes the clone urls be properly escaped.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-refs: use cgit_tag_link()
Lars Hjemli [Sun, 5 Oct 2008 19:19:05 +0000 (21:19 +0200)]
ui-refs: use cgit_tag_link()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: add cgit_tag_link()
Lars Hjemli [Sun, 5 Oct 2008 19:18:45 +0000 (21:18 +0200)]
ui-shared: add cgit_tag_link()

This function can be used to generate properly escaped links to the tag
page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: generate proper links in cgit_object_link()
Lars Hjemli [Sun, 5 Oct 2008 19:12:08 +0000 (21:12 +0200)]
ui-shared: generate proper links in cgit_object_link()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: use html_url_path() to get properly escaped url in form action
Lars Hjemli [Sun, 5 Oct 2008 17:25:47 +0000 (19:25 +0200)]
ui-shared: use html_url_path() to get properly escaped url in form action

When a repo uses an url with e.g. '#' or '?' characters this needs to be
properly escaped when used as action in a form tag.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.0.2
Lars Hjemli [Sun, 5 Oct 2008 17:19:59 +0000 (19:19 +0200)]
Use GIT-1.6.0.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: reword the standard page footer
Lars Hjemli [Sun, 5 Oct 2008 17:09:58 +0000 (19:09 +0200)]
ui-shared: reword the standard page footer

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: do not print repo name on the "summary" tab
Lars Hjemli [Sun, 5 Oct 2008 17:00:32 +0000 (19:00 +0200)]
ui-shared: do not print repo name on the "summary" tab

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoReplace cgitrc with cgitrc.5.txt
Lars Hjemli [Sun, 5 Oct 2008 16:55:49 +0000 (18:55 +0200)]
Replace cgitrc with cgitrc.5.txt

The new file describes all cgitrc options in a more structured manner then
the cgitrc example file and it might also work as the source for a cgitrc
man page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/escape-urls'
Lars Hjemli [Sun, 5 Oct 2008 15:16:48 +0000 (17:16 +0200)]
Merge branch 'lh/escape-urls'

* lh/escape-urls:
  ui-repolist + ui-shared: Use cgit_summary_link()
  ui-shared.c: add cgit_summary_link()
  ui-shared.c: use html_url_path() in repolink()
  html.c: add html_url_path

16 years agoui-repolist + ui-shared: Use cgit_summary_link()
Lars Hjemli [Sun, 5 Oct 2008 15:16:36 +0000 (17:16 +0200)]
ui-repolist + ui-shared: Use cgit_summary_link()

This makes is possible to use cgit with repository urls containing special
url characters like '#' and '?'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared.c: add cgit_summary_link()
Lars Hjemli [Sun, 5 Oct 2008 14:55:50 +0000 (16:55 +0200)]
ui-shared.c: add cgit_summary_link()

This function can be used to generate a link to the summary page for the
currently active repo.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared.c: use html_url_path() in repolink()
Lars Hjemli [Sun, 5 Oct 2008 14:54:44 +0000 (16:54 +0200)]
ui-shared.c: use html_url_path() in repolink()

This makes sure that reponames and paths are properly escaped when used
as urls.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agohtml.c: add html_url_path
Lars Hjemli [Sun, 5 Oct 2008 14:52:57 +0000 (16:52 +0200)]
html.c: add html_url_path

This function can be used to generate properly escaped path-components
for links.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/escape-urls'
Lars Hjemli [Sun, 5 Oct 2008 11:13:33 +0000 (13:13 +0200)]
Merge branch 'lh/escape-urls'

* lh/escape-urls:
  ui-shared.c: use html_url_arg()
  html.c: add html_url_arg

16 years agoui-snapshot.c: specify archiver_args.baselen
Lars Hjemli [Sun, 5 Oct 2008 11:13:03 +0000 (13:13 +0200)]
ui-snapshot.c: specify archiver_args.baselen

The struct member was introduces in git commit d53fe8187c38, but the cgit
testsuite failed to detect that cgit always generated archives without
prefixes, i.e. the result from cgit_repobasename was ignored.

This fixes the bug and the testsuite.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared.c: use html_url_arg()
Lars Hjemli [Sun, 5 Oct 2008 10:52:25 +0000 (12:52 +0200)]
ui-shared.c: use html_url_arg()

The link-generating functions are updated to use the new html_url_arg
function, thereby fixing links to strange repos, branches and files.

Also, the test-suite is updated to verify some cases of strange urls.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agohtml.c: add html_url_arg
Lars Hjemli [Sun, 5 Oct 2008 10:49:46 +0000 (12:49 +0200)]
html.c: add html_url_arg

This function can be used to properly escape querystring parameter values.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-diff: make diffstat header a link to the full diff
Lars Hjemli [Tue, 23 Sep 2008 15:54:45 +0000 (17:54 +0200)]
ui-diff: make diffstat header a link to the full diff

When printing a path-filtered diff it wasn't obvious how to get back to
the full diff (clicking the 'diff' tab would do this). Making the diffstat
heading into a link seems to improve the usability.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-diff: fix links from diffstat
Lars Hjemli [Tue, 23 Sep 2008 15:47:26 +0000 (17:47 +0200)]
ui-diff: fix links from diffstat

The links in the diffstat is supposed to work as a filter for the diff,
but this only worked when a single rev was supplied, i.e. the filtered
diff was always against the parent of the specified rev.

With this patch it is now possible to use the diffstat as a 'filter menu'
for urls like http://hjemli.net/git/cgit/diff/?id=v0.7.2&id2=v0.7.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd LDFLAGS to makefile.
Harley Laue [Fri, 19 Sep 2008 02:06:18 +0000 (21:06 -0500)]
Add LDFLAGS to makefile.

This will allow for creating static builds which is useful for chrooted
environments.

Signed-off-by: Harley Laue <losinggeneration@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-repolist: enable filtering of repos by path
Lars Hjemli [Sun, 14 Sep 2008 18:18:10 +0000 (20:18 +0200)]
ui-repolist: enable filtering of repos by path

If a repo url is specified but no exact match is found in the list of
repos the url will now be used as a prefix-filter.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd support for --scan-tree=<path> option to cgit
Lars Hjemli [Sun, 14 Sep 2008 22:07:12 +0000 (00:07 +0200)]
Add support for --scan-tree=<path> option to cgit

This option makes cgit scan a directory tree looking for git repositories,
generating suitable definitions for a cgitrc file on stdout.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoTeach cgit how to use PATH_INFO
Lars Hjemli [Sat, 9 Aug 2008 19:11:41 +0000 (21:11 +0200)]
Teach cgit how to use PATH_INFO

This commit makes cgit use the cgi variables SCRIPT_NAME and PATH_INFO
when virtual-root is unspecified in cgitrc and no url-parameter is
specified on the querystring. This has two nice effects:

* Virtual urls works out of the box, no more need for rewrite-rules in httpd.
* Virtual urls with special querystring characters are handled correctly.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/parsing'
Lars Hjemli [Mon, 15 Sep 2008 20:41:25 +0000 (22:41 +0200)]
Merge branch 'lh/parsing'

* lh/parsing:
  ui-tag: show the taggers email
  parsing.c: be prepared for unexpected content in commit/tag objects

16 years agoui-tag: show the taggers email
Lars Hjemli [Mon, 15 Sep 2008 20:40:02 +0000 (22:40 +0200)]
ui-tag: show the taggers email

If it's specified there's no point in hiding it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoparsing.c: be prepared for unexpected content in commit/tag objects
Lars Hjemli [Sun, 14 Sep 2008 07:45:37 +0000 (09:45 +0200)]
parsing.c: be prepared for unexpected content in commit/tag objects

When parsing commits and tags cgit made too many assumptions about the
formatting of said objects. This patch tries to make the code be more
prepared to handle 'malformed' objects.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'ew/http_host'
Lars Hjemli [Mon, 15 Sep 2008 19:47:14 +0000 (21:47 +0200)]
Merge branch 'ew/http_host'

* ew/http_host:
  use Host: header to generate cgit_hosturl

16 years agoUpdate Makefile to use GIT-1.6.0.1
Lars Hjemli [Tue, 2 Sep 2008 22:18:09 +0000 (00:18 +0200)]
Update Makefile to use GIT-1.6.0.1

When updating the git submodule to 1.6.0.1 (and 1.6.0), the Makefile was
left behind. This fixes it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agouse Host: header to generate cgit_hosturl
Eric Wong [Mon, 1 Sep 2008 06:30:33 +0000 (23:30 -0700)]
use Host: header to generate cgit_hosturl

I run an instance of lighttpd for cgit behind nginx (nginx
doesn't execute CGI).  So the port (SERVER_PORT=33333) that
lighttpd runs on sends to cgit is different from the standard
port 80 that public clients connect to (via nginx).

This was causing the Atom feed URL to show the private port
number that lighttpd was running on.

Since the HTTP/1.1 "Host" header includes the port number if
running on a non-standard port, it allows non-client-facing HTTP
servers to transparently generate public URLs that clients can
see.

So use the "Host" header if it is available and fall back to
SERVER_NAME/SERVER_PORT for some clients that don't set
HTTP_HOST.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agoUse GIT-1.6.0.1
Lars Hjemli [Mon, 1 Sep 2008 23:06:27 +0000 (01:06 +0200)]
Use GIT-1.6.0.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-plain: handle subdirectories
Lars Hjemli [Mon, 1 Sep 2008 22:53:04 +0000 (00:53 +0200)]
ui-plain: handle subdirectories

The callback from read_tree_recursive just needs to check the type of
each tree entry; if it's a dir we want to continue scanning, if it's a
regular file we'll assume it's the one we requested.

And while at it, remove some stray fprintfs.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.0
Lars Hjemli [Mon, 1 Sep 2008 20:50:35 +0000 (22:50 +0200)]
Use GIT-1.6.0

16 years agoMerge branch 'lh/plain'
Lars Hjemli [Mon, 1 Sep 2008 20:40:55 +0000 (22:40 +0200)]
Merge branch 'lh/plain'

* lh/plain:
  Supply status description to html_status()
  ui-tree: link to plain view instead of blob view
  Implement plain view

16 years agoMerge branch 'lh/clone'
Lars Hjemli [Mon, 1 Sep 2008 20:40:24 +0000 (22:40 +0200)]
Merge branch 'lh/clone'

* lh/clone:
  Add support for cloning over http

Conflicts:
cmd.c

16 years agocache.c: use %zd for off_t argument
Lars Hjemli [Sun, 10 Aug 2008 07:24:24 +0000 (09:24 +0200)]
cache.c: use %zd for off_t argument

Signed-off-by: Lars Hjemli <hjemli@gmail>
16 years agoSupply status description to html_status()
Lars Hjemli [Wed, 6 Aug 2008 20:57:44 +0000 (22:57 +0200)]
Supply status description to html_status()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.0.rc1
Lars Hjemli [Wed, 6 Aug 2008 17:08:19 +0000 (19:08 +0200)]
Use GIT-1.6.0.rc1

Now that rc1 is released as a tarball `make get-git` should start working
again.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: Git dependency, take 3
Lars Hjemli [Wed, 6 Aug 2008 16:52:27 +0000 (18:52 +0200)]
Makefile: Git dependency, take 3

In commit a1266edfe the build instructions for the git libs where moved
to their real targets, which in turn depended on the phony target `git`.
But since `git` is an actual directory in cgit the git libs wouldn't be
recompiled when needed.

So with this patch (third time lucky), cgit is declared to depend on the
really phony target `libgit` and the build instructions for `libgit` is
to unconditionally rebuild git/libgit.a and git/xdiff/lib.a.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-tree: link to plain view instead of blob view
Lars Hjemli [Wed, 6 Aug 2008 09:07:13 +0000 (11:07 +0200)]
ui-tree: link to plain view instead of blob view

The urls for plain view makes it possible to download blobs without knowing
their SHA1, but the function needs to be promoted and the link from tree
view seems like a perfect fit.

PS: Although hidden, the blob view still is nice for direct blob access so
there's no point in removing it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoImplement plain view
Lars Hjemli [Wed, 6 Aug 2008 08:53:50 +0000 (10:53 +0200)]
Implement plain view

This implements a way to access plain blobs by path (similar to the
tree view) instead of by sha1.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd support for cloning over http
Lars Hjemli [Tue, 5 Aug 2008 23:20:24 +0000 (01:20 +0200)]
Add support for cloning over http

This patch implements basic support for cloning over http, based on the
work on git-http-backend by Shawn O. Pearce.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/atom'
Lars Hjemli [Wed, 6 Aug 2008 07:50:10 +0000 (09:50 +0200)]
Merge branch 'lh/atom'

16 years agocgitrc: explain new local-time option
Stefan Naewe [Tue, 5 Aug 2008 07:20:07 +0000 (09:20 +0200)]
cgitrc: explain new local-time option

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd atom-support
Lars Hjemli [Wed, 21 May 2008 06:17:54 +0000 (08:17 +0200)]
Add atom-support

This enables a page which generates atom feeds for the current branch and
path, heavily inspired by the atom-support in gitweb.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdded `local-time` option to cgitrc
Stefan Naewe [Fri, 1 Aug 2008 12:54:38 +0000 (14:54 +0200)]
Added `local-time` option to cgitrc

When `local-time` is set, commit, tag and patch timestamps will be printed
in the servers timezone. Also, regardless of the value of `local-time`,
these timestamps will now always show the timezone.

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: another take on git dependency rules
Lars Hjemli [Thu, 31 Jul 2008 23:25:51 +0000 (01:25 +0200)]
Makefile: another take on git dependency rules

When building cgit we depend on xdiff/lib.a and libgit.a in the git
directory, but the previous attempt on describing this dependency
failed since the build instructions for the libs was placed under the
phony `git` target.

This patch fixes the issue by moving the build instructions to their
real targets. It also makes it clear that only the `cgit` target
depends on the git binaries (since they're only used during linking).

And while at it, the patch also cleans up the list of phony targets.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoModify default value for a few cgitrc options
Lars Hjemli [Sun, 27 Jul 2008 10:58:37 +0000 (12:58 +0200)]
Modify default value for a few cgitrc options

The default max-length used when printing commit messages and repo
descriptions can be increased due to the new layout (no sidebar).

Also, on the repo summary page I believe it makes sense to only show the
ten most recent branches and tags by default, just as it makes sense to
show the ten most recent commit messages for the active branch.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoBe prepared for empty repositories
Lars Hjemli [Sun, 27 Jul 2008 10:32:08 +0000 (12:32 +0200)]
Be prepared for empty repositories

Before this patch, cgit would segfault on repositories with no refs.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: show repo owner along with description
Lars Hjemli [Sun, 27 Jul 2008 10:22:16 +0000 (12:22 +0200)]
ui-shared: show repo owner along with description

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-summary: show clone urls
Lars Hjemli [Sun, 27 Jul 2008 09:54:06 +0000 (11:54 +0200)]
ui-summary: show clone urls

If either repo.clone-url or clone-prefix is specified in cgitrc, all
space-separated values in the config option is printed as a possible
clone url on the repo summary page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: remove the `distclean` and `emptycache` targets
Lars Hjemli [Tue, 22 Jul 2008 18:06:16 +0000 (20:06 +0200)]
Makefile: remove the `distclean` and `emptycache` targets

The `distclean` was hardly useful while the `emptycache` was actively harmful.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: do not touch the git objects with `make clean`
Lars Hjemli [Tue, 22 Jul 2008 17:58:37 +0000 (19:58 +0200)]
Makefile: do not touch the git objects with `make clean`

I've been avoiding `make clean` for a long time due to its eagerness to kill
all the git objectfiles.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: fix git dependency rules
Lars Hjemli [Tue, 22 Jul 2008 17:30:06 +0000 (19:30 +0200)]
Makefile: fix git dependency rules

The objectfiles depends unconditionally on some specific git binaries while
those git binaries depends on the phony `git` target and this patch seems to
get these dependencies spelled out correctly.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agotests/Makefile: not everyone has `.` in $PATH
Lars Hjemli [Tue, 22 Jul 2008 17:01:31 +0000 (19:01 +0200)]
tests/Makefile: not everyone has `.` in $PATH

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdjust to new calling convention for read_tree_recursive()
Lars Hjemli [Mon, 21 Jul 2008 08:10:48 +0000 (10:10 +0200)]
Adjust to new calling convention for read_tree_recursive()

In GIT-1.6.0, read_tree_recursive takes an extra void pointer for callback
data. We might want to use this to avoid some global variables, but for now
lets just make sure that we can still compile.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.0-rc0
Lars Hjemli [Mon, 21 Jul 2008 07:57:25 +0000 (09:57 +0200)]
Use GIT-1.6.0-rc0

16 years agoAdd a favicon option to cgitrc
Lars Hjemli [Sat, 19 Jul 2008 18:40:30 +0000 (20:40 +0200)]
Add a favicon option to cgitrc

This option is used to specify a shortcut icon on all cgit pages.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd support for including a footer on all pages
Lars Hjemli [Thu, 26 Jun 2008 11:53:30 +0000 (13:53 +0200)]
Add support for including a footer on all pages

The new cgitrc option `footer` can be used to include a html-file which
replaces the standard 'generated by cgit' message at the bottom of each
page.

Suggested-by: Peter Danenberg <pcd@wikitex.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'master' of git://git.klever.net/patchwork/cgit
Lars Hjemli [Thu, 26 Jun 2008 10:54:44 +0000 (12:54 +0200)]
Merge branch 'master' of git://git.klever.net/patchwork/cgit

* 'master' of git://git.klever.net/patchwork/cgit:
  allow specification of directly linked blobs mimetypes
  allow blob extract blobs by head/path combination

16 years agoUse GIT-1.5.6
Lars Hjemli [Wed, 25 Jun 2008 15:39:25 +0000 (17:39 +0200)]
Use GIT-1.5.6

16 years agoallow specification of directly linked blobs mimetypes
Michael Krelin [Tue, 24 Jun 2008 21:42:32 +0000 (23:42 +0200)]
allow specification of directly linked blobs mimetypes

Signed-off-by: Michael Krelin <hacker@klever.net>
16 years agoallow blob extract blobs by head/path combination
Michael Krelin [Tue, 24 Jun 2008 21:33:24 +0000 (23:33 +0200)]
allow blob extract blobs by head/path combination

 If blob is invoked with no id=, it tries to look up h= and search for path= in
 there. Once found, proceed as normal, otherwise, fail as normal.

Signed-off-by: Michael Krelin <hacker@klever.net>
16 years agoAdded root-desc to default configuration.
Harley Laue [Wed, 21 May 2008 00:08:21 +0000 (19:08 -0500)]
Added root-desc to default configuration.

Signed-off-by: Harley Laue <losinggeneration@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-tree.c: avoid peeking at GITLINK objects
Lars Hjemli [Tue, 20 May 2008 20:32:22 +0000 (22:32 +0200)]
ui-tree.c: avoid peeking at GITLINK objects

When an object in the tree has GITLINK mode-bits we don't need to get any
more info about that particular object (and trying to get more info about
it will usually generate an annoying warning on stderr since the object
typically doesn't exist in the repo anyways).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agocache.c: fix error checking in print_slot()
Lars Hjemli [Tue, 20 May 2008 15:56:47 +0000 (17:56 +0200)]
cache.c: fix error checking in print_slot()

The change to print_slot() in cdc6b2f8e7a8d43dcfe0475a9d3498333ea686b8 made
the function return correct errno for read errors while ignoring write errors,
which is not what was intended. This patch tries to rectify things.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agocache.c: do not ignore errors from print_slot()
Lars Hjemli [Sun, 18 May 2008 21:59:11 +0000 (23:59 +0200)]
cache.c: do not ignore errors from print_slot()

If print_slot() fails, the client will be served an inferior response.
This patch makes sure that such an error will be returned to main(), which
in turn will try to inform about the error in the response itself.

The error is also printed to the cache_log, i.e. stderr, which will make
the error message appear in error_log (atleast when httpd==apache).

Noticed-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agocache.c: use xread()/xwrite() from libgit
Lars Hjemli [Sun, 18 May 2008 21:26:05 +0000 (23:26 +0200)]
cache.c: use xread()/xwrite() from libgit

These functions handles EINTR/EAGAIN errors during read/write operations,
which is something cache.c didn't.

While at it, fix a bug in print_slot() where errors during reading from the
cache slot might go by unnoticed.

Noticed-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agocache.c: make all io-related functions return errno on error
Lars Hjemli [Sun, 18 May 2008 21:16:50 +0000 (23:16 +0200)]
cache.c: make all io-related functions return errno on error

We'll need proper return-values from these functions to make the cache
behave correctly (which includes giving proper error messages).

Noticed-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agocache.c: read(2) returns -1 on error, not 0
Lars Hjemli [Sun, 18 May 2008 21:10:05 +0000 (23:10 +0200)]
cache.c: read(2) returns -1 on error, not 0

Noticed-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.5.5.1
Lars Hjemli [Sun, 18 May 2008 19:40:28 +0000 (21:40 +0200)]
Use GIT-1.5.5.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoInclude commit-id in link from diff-stat
Lars Hjemli [Sun, 18 May 2008 19:21:32 +0000 (21:21 +0200)]
Include commit-id in link from diff-stat

This fixes a regression created by fe1230dece81450004d02fa8a470f8dab8f7fdd9,
and modifies a test to avoid future regressions.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-commit: handle root commits
Lars Hjemli [Sun, 18 May 2008 19:09:26 +0000 (21:09 +0200)]
ui-commit: handle root commits

Both cgit_print_diff() and cgit_diff_tree() handles root commits nicely,
but cgit_print_commit() forgot to check the case of 0 parents.

This fixes it, and adds tests to avoid future regressions.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd link to index page from repo header, remove page name
Lars Hjemli [Sat, 3 May 2008 10:44:20 +0000 (12:44 +0200)]
Add link to index page from repo header, remove page name

This makes it more obvious how to get back to the index, especially when the
config option `logo-link` is used. And the page name displayed in the header
provided no extra information. It only consumed space and deserved to die.

While at it, make sure that the different parts of the header doesn't wrap
when horizontal space is limited.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd footer with page creation time and cgit version on all pages
Lars Hjemli [Sat, 3 May 2008 09:07:41 +0000 (11:07 +0200)]
Add footer with page creation time and cgit version on all pages

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd a pager on the repolist
Lars Hjemli [Sat, 3 May 2008 08:54:39 +0000 (10:54 +0200)]
Add a pager on the repolist

This enables a pager on the repolist which restricts the number of entries
displayed per page, controlled by the new option `max-repo-count` (default
value 50).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd cgit_index_link() function with support for offset
Lars Hjemli [Sat, 3 May 2008 08:37:02 +0000 (10:37 +0200)]
Add cgit_index_link() function with support for offset

This function will be used to build a pager in ui-repolist.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/cache'
Lars Hjemli [Sat, 3 May 2008 08:10:07 +0000 (10:10 +0200)]
Merge branch 'lh/cache'

* lh/cache:
  Add page 'ls_cache'
  Redesign the caching layer

16 years agoPrint an error if filename is not found in html_include.
Harley Laue [Tue, 29 Apr 2008 15:59:53 +0000 (17:59 +0200)]
Print an error if filename is not found in html_include.

Normally when html_include cannot open the file it fails silently and
things can be a bit hard to figure out from just looking at apache's
log. This will be beneficial for those initially setting up their server
with cgit.

Signed-off-by: Harley Laue <losinggeneration@aim.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/about'
Lars Hjemli [Mon, 28 Apr 2008 23:13:08 +0000 (01:13 +0200)]
Merge branch 'lh/about'

* lh/about:
  Add 'about site' and 'about repo' pages
  Prepare for 'about site' page / add 'root-readme' option to cgitrc
  Make it possible for a single cmd to work both with and without a repo
  Re-enable 'index-info' and add support for 'root-desc' in cgitrc
  Move included header-file out of repolist table
  Prepare for 'about repo' page

16 years agoAdd 'about site' and 'about repo' pages
Lars Hjemli [Mon, 28 Apr 2008 23:09:41 +0000 (01:09 +0200)]
Add 'about site' and 'about repo' pages

This commit uses the options and changes from the last few commits to
implement a new 'about' command which works both with and without a
repo.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoPrepare for 'about site' page / add 'root-readme' option to cgitrc
Lars Hjemli [Mon, 28 Apr 2008 23:06:30 +0000 (01:06 +0200)]
Prepare for 'about site' page / add 'root-readme' option to cgitrc

The new option names a file which will be included on a new page, next
to the current 'index' page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMake it possible for a single cmd to work both with and without a repo
Lars Hjemli [Mon, 28 Apr 2008 23:01:30 +0000 (01:01 +0200)]
Make it possible for a single cmd to work both with and without a repo

When cgit_cmd.want_repo was 0, we used to assume that the cmd would never
be invoked for a repo. But soon this will become untrue (the 'about' cmd
is rapidly approching), so from now on we will initialize any requested
repo even if want_repo==0 (and return an error if want_repo==1 but no repo
is specified).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRe-enable 'index-info' and add support for 'root-desc' in cgitrc
Lars Hjemli [Mon, 28 Apr 2008 22:55:34 +0000 (00:55 +0200)]
Re-enable 'index-info' and add support for 'root-desc' in cgitrc

The 'index-info' option got lost when the layout was converted from
sidebar to old-fashioned header (noticed by Harley Laue, thanks!), and
this commit re-enables it.

But there is now also an alternative in the 'root-desc' option; where
'index-info' specifies a file to include, 'root-desc' specifies the text
literally. This might be nicer for the one-liner descriptions which these
options typically provides.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove included header-file out of repolist table
Lars Hjemli [Mon, 28 Apr 2008 22:35:49 +0000 (00:35 +0200)]
Move included header-file out of repolist table

When the 'index-header' option is specified in cgitrc we used to print
the included file content inside the repolist table, which is bad style.

This commit makes the included file be printed before the table.

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