]> granicus.if.org Git - cgit/log
cgit
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 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>
16 years agoPrepare for 'about repo' page
Lars Hjemli [Mon, 28 Apr 2008 21:06:57 +0000 (23:06 +0200)]
Prepare for 'about repo' page

Each repo can include an external file which used to be included on the
top of the summary page, but it will now soon get a page of it own.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd page 'ls_cache'
Lars Hjemli [Mon, 28 Apr 2008 10:10:13 +0000 (12:10 +0200)]
Add page 'ls_cache'

This new page will list all entries found in the current cache, which is
useful when reviewing the new cache implementation. There are no links to
the new page, but it's reachable by adding 'p=ls_cache' to any cgit url.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRedesign the caching layer
Lars Hjemli [Mon, 28 Apr 2008 09:32:42 +0000 (11:32 +0200)]
Redesign the caching layer

The original caching layer in cgit has no upper bound on the number of
concurrent cache entries, so when cgit is traversed by a spider (like the
googlebot), the cache might end up filling your disk. Also, if any error
occurs in the cache layer, no content is returned to the client.

This patch redesigns the caching layer to avoid these flaws by
* giving the cache a bound number of slots
* disabling the cache for the current request when errors occur

The cache size limit is implemented by hashing the querystring (the cache
lookup key) and generating a cache filename based on this hash modulo the
cache size. In order to detect hash collisions, the full lookup key (i.e.
the querystring) is stored in the cache file (separated from its associated
content by ascii 0).

The cache filename is the reversed 8-digit hexadecimal representation of

  hash(key) % cache_size

which should make the filesystem lookup pretty fast (if directory content
is indexed/sorted); reversing the representation avoids the problem where
all keys have equal prefix.

There is a new config option, cache-size, which sets the upper bound for
the cache. Default value for this option is 0, which has the same effect
as setting nocache=1 (hence nocache is now deprecated).

Included in this patch is also a new testfile which verifies that the
new option works as intended.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-diff: remove test on object type
Lars Hjemli [Thu, 24 Apr 2008 21:40:51 +0000 (23:40 +0200)]
ui-diff: remove test on object type

By removing the test for commit objects it's now possible to specify a
tag name for the id query-string parameter (it already worked for id2).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoIntegrate diffstat with diff
Lars Hjemli [Thu, 24 Apr 2008 21:32:02 +0000 (23:32 +0200)]
Integrate diffstat with diff

This creates a generic diffstat function in ui-diff, which then is
invoked from cgit_print_diff with the result that both commit and diff-
view gets a diffstat.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix commitdiff annoyance
Lars Hjemli [Thu, 17 Apr 2008 16:29:50 +0000 (18:29 +0200)]
Fix commitdiff annoyance

Someone were a bit sloppy when the commitdiff got included 'inline' in
commit 89aa3c0d0a4c6d9885272602005975b763ea1604. This patch deletes a
stray `)` and makes sure the diffstat summary `<div>` is closed before
the full diff is printed.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoCleanup page header
Lars Hjemli [Mon, 14 Apr 2008 22:00:11 +0000 (00:00 +0200)]
Cleanup page header

Fix some invalid html, remove dead code.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix search in repo index even if caching is enabled
Lars Hjemli [Mon, 14 Apr 2008 21:07:52 +0000 (23:07 +0200)]
Fix search in repo index even if caching is enabled

The repository index page needed to include the querystring in the cache
filename.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMake a few more columns in repolist and log view clickable
Lars Hjemli [Mon, 14 Apr 2008 20:23:48 +0000 (22:23 +0200)]
Make a few more columns in repolist and log view clickable

Less mouse movement is nice.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMake branches, tags and log play better together in the summary view
Lars Hjemli [Mon, 14 Apr 2008 20:13:38 +0000 (22:13 +0200)]
Make branches, tags and log play better together in the summary view

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix more css ugliness
Lars Hjemli [Mon, 14 Apr 2008 20:10:33 +0000 (22:10 +0200)]
Fix more css ugliness

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agocgit.css: set form margins
Lars Hjemli [Mon, 14 Apr 2008 08:17:33 +0000 (10:17 +0200)]
cgit.css: set form margins

According to the css2 spec, htmlforms have 1.12em top and bottom margins. That
doesn't play well with the placement of the search form, so lets force it to
use 0em margins.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix css font-family
Lars Hjemli [Mon, 14 Apr 2008 08:00:59 +0000 (10:00 +0200)]
Fix css font-family

When the sidebar was introduced in v0.7 the default font-family property
got messed up, but this commit should fix the issue.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/layout'
Lars Hjemli [Sun, 13 Apr 2008 10:48:44 +0000 (12:48 +0200)]
Merge branch 'lh/layout'

* lh/layout:
  Make repository search case insensitive
  Remove 'patch' link from tab, add to commit view
  Implement minimal freetext search in the repolist
  More layout fixes
  Minor fixup in tree-view css
  Reintroduce the branch switcher
  Add fixed link to index page from repo header
  Include diff in commit view
  Replace sidebar/logo

16 years agoMake repository search case insensitive
Lars Hjemli [Sun, 13 Apr 2008 10:42:27 +0000 (12:42 +0200)]
Make repository search case insensitive

This reuses the strcasestr() compiled or linked by libgit.a to implement a
case insensitive variation of the repository search.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRemove 'patch' link from tab, add to commit view
Lars Hjemli [Sun, 13 Apr 2008 10:20:00 +0000 (12:20 +0200)]
Remove 'patch' link from tab, add to commit view

It's a bit confusing to enter the patch view from the tab, since it has no
layout. And the commit view has always lacked showing the commit id. Both of
these warts are fixed by this commit, which adds a new header line in the
commit view which shows the commit id as a 'permalink' to the current commit
and also adds a link to the patch view of the current commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoImplement minimal freetext search in the repolist
Lars Hjemli [Sun, 13 Apr 2008 09:57:10 +0000 (11:57 +0200)]
Implement minimal freetext search in the repolist

This makes the repolist much more usable when there's a lot of repositories
registered in cgitrc.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMore layout fixes
Lars Hjemli [Sun, 13 Apr 2008 08:57:11 +0000 (10:57 +0200)]
More layout fixes

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMinor fixup in tree-view css
Lars Hjemli [Sat, 12 Apr 2008 18:18:16 +0000 (20:18 +0200)]
Minor fixup in tree-view css

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoReintroduce the branch switcher
Lars Hjemli [Sat, 12 Apr 2008 18:11:49 +0000 (20:11 +0200)]
Reintroduce the branch switcher

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd fixed link to index page from repo header
Lars Hjemli [Sat, 12 Apr 2008 17:59:41 +0000 (19:59 +0200)]
Add fixed link to index page from repo header

This makes it easier to get back to the index page, and also re-enables
the usage of logo-link in cgitrc.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoInclude diff in commit view
Lars Hjemli [Sat, 12 Apr 2008 13:53:53 +0000 (15:53 +0200)]
Include diff in commit view

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoReplace sidebar/logo
Lars Hjemli [Sat, 12 Apr 2008 13:53:31 +0000 (15:53 +0200)]
Replace sidebar/logo

This replaces the sidebar with a more 'common' header layout and also
updates the logo.

Not quite finished yet, though.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.5.5
Lars Hjemli [Wed, 9 Apr 2008 16:05:30 +0000 (18:05 +0200)]
Use GIT-1.5.5

16 years agoDon't specify mimetype in ui-blob.c
Lars Hjemli [Tue, 25 Mar 2008 01:43:51 +0000 (02:43 +0100)]
Don't specify mimetype in ui-blob.c

But be sure to specify correct filename. This way, the client can hopefully
guess a sensible mimetype based on the filename suffix, and cgit can ignore
the issue altogether.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'lh/cleanup'
Lars Hjemli [Tue, 8 Apr 2008 19:29:21 +0000 (21:29 +0200)]
Merge branch 'lh/cleanup'

* lh/cleanup: (21 commits)
  Reset ctx.repo to NULL when the config parser is finished
  Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()
  Move function for configfile parsing into configfile.[ch]
  Add cache.h
  Remove global and obsolete cgit_cmd
  Makefile: copy the QUIET constructs from the Makefile in git.git
  Move cgit_version from shared.c to cgit.c
  Makefile: autobuild dependency rules
  Initial Makefile cleanup
  Move non-generic functions from shared.c to cgit.c
  Add ui-shared.h
  Add separate header-files for each page/view
  Refactor snapshot support
  Add command dispatcher
  Remove obsolete cacheitem parameter to ui-functions
  Add struct cgit_page to cgit_context
  Introduce html.h
  Improve initialization of git directory
  Move cgit_repo into cgit_context
  Add all config variables into struct cgit_context
  ...

16 years agoReset ctx.repo to NULL when the config parser is finished
Lars Hjemli [Tue, 8 Apr 2008 19:27:12 +0000 (21:27 +0200)]
Reset ctx.repo to NULL when the config parser is finished

This global variable is used by the config parsing callback to keep track
of the currently configured repository. If it is not reset to NULL when
the config parser is finished, and neither `url` or `r` is specified on the
querystring, cgit will wrongly consider the last configured repo as
selected.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove cgit_parse_query() from parsing.c to html.c as http_parse_querystring()
Lars Hjemli [Tue, 8 Apr 2008 19:11:36 +0000 (21:11 +0200)]
Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()

This is a generic http-function.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.5.5-rc2
Lars Hjemli [Mon, 31 Mar 2008 22:59:55 +0000 (00:59 +0200)]
Use GIT-1.5.5-rc2

16 years agoMove function for configfile parsing into configfile.[ch]
Lars Hjemli [Thu, 27 Mar 2008 23:09:11 +0000 (00:09 +0100)]
Move function for configfile parsing into configfile.[ch]

This is a generic function which wanted its own little object file.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd cache.h
Lars Hjemli [Thu, 27 Mar 2008 08:22:13 +0000 (09:22 +0100)]
Add cache.h

The functions found in cache.c are only used by cgit.c, so there's no
point in rebuilding all object files when the cache interface is changed.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRemove global and obsolete cgit_cmd
Lars Hjemli [Tue, 25 Mar 2008 01:00:09 +0000 (02:00 +0100)]
Remove global and obsolete cgit_cmd

This variable was obsoleted by cmd.c.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: copy the QUIET constructs from the Makefile in git.git
Lars Hjemli [Tue, 25 Mar 2008 00:41:10 +0000 (01:41 +0100)]
Makefile: copy the QUIET constructs from the Makefile in git.git

These constructs were introduced by Shawn O. Pearce in commit
74f2b2a8d006a49e1be7e30731c2f7365d2741d1.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove cgit_version from shared.c to cgit.c
Lars Hjemli [Mon, 24 Mar 2008 22:10:59 +0000 (23:10 +0100)]
Move cgit_version from shared.c to cgit.c

With the matching Makefile change, this makes sure that only cgit.o and cgit
proper needs to be rebuildt when VERSION has been modified.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: autobuild dependency rules
Lars Hjemli [Mon, 24 Mar 2008 22:01:44 +0000 (23:01 +0100)]
Makefile: autobuild dependency rules

This uses gcc to generate dependency rules for each `.o` file, based on the
corresponding `.c` file, into a new set of `.d` files (which are also defined
to depend on the same set of source files as their `.o` files).

Result:
* all objectfile dependencies are correctly calculated
* only the necessary dependencies are recalculated when a sourcefile is updated

Inspiration for the build rules:
* http://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites
* http://make.paulandlesley.org/autodep.html

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoInitial Makefile cleanup
Lars Hjemli [Mon, 24 Mar 2008 19:49:41 +0000 (20:49 +0100)]
Initial Makefile cleanup

Sort the list of object files to improve readability/mergeability and remove
manual dependency information which will soon be generated automatically.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove non-generic functions from shared.c to cgit.c
Lars Hjemli [Mon, 24 Mar 2008 16:26:08 +0000 (17:26 +0100)]
Move non-generic functions from shared.c to cgit.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd ui-shared.h
Lars Hjemli [Mon, 24 Mar 2008 15:50:57 +0000 (16:50 +0100)]
Add ui-shared.h

This is finally a proper headerfile for the shared ui-functions which
used to reside in cgit.h

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd separate header-files for each page/view
Lars Hjemli [Mon, 24 Mar 2008 15:38:47 +0000 (16:38 +0100)]
Add separate header-files for each page/view

Yet another step towards removing cgit.h.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRefactor snapshot support
Lars Hjemli [Mon, 24 Mar 2008 15:00:27 +0000 (16:00 +0100)]
Refactor snapshot support

The snapshot support needs to be split between output- and config-related
functions to get the layering between shared.c and ui-*.c right. There
is also some codestyle-issues which needs fixing to make the snapshot
functions more similar to the rest of the cgit code.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd command dispatcher
Lars Hjemli [Mon, 24 Mar 2008 00:09:39 +0000 (01:09 +0100)]
Add command dispatcher

This simplifies the code in cgit.c and makes it easier to extend cgit with
new pages/commands.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRemove obsolete cacheitem parameter to ui-functions
Lars Hjemli [Mon, 24 Mar 2008 00:00:36 +0000 (01:00 +0100)]
Remove obsolete cacheitem parameter to ui-functions

This parameter hasn't been used for a very long time...

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd struct cgit_page to cgit_context
Lars Hjemli [Sun, 23 Mar 2008 23:51:19 +0000 (00:51 +0100)]
Add struct cgit_page to cgit_context

This struct is used when generating http headers, and as such is another
small step towards the goal of the whole cleanup series; to invoke each
page/view function with a function pointer.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.5.5.rc1
Lars Hjemli [Sun, 23 Mar 2008 10:36:38 +0000 (11:36 +0100)]
Use GIT-1.5.5.rc1

16 years agoIntroduce html.h
Lars Hjemli [Sat, 23 Feb 2008 21:45:33 +0000 (22:45 +0100)]
Introduce html.h

All html-functions can be quite easily separated from the rest of cgit, so
lets do it; the only issue was html_filemode which uses some git-defined
macros so the function is moved into ui-shared.c::cgit_print_filemode().

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix segfault in patch view for root commit
Lars Hjemli [Mon, 17 Mar 2008 22:13:16 +0000 (23:13 +0100)]
Fix segfault in patch view for root commit

The code for patch view assumed the current commit would always have a parent,
which made cgit segfault when that wasn't the case.

This fixes the bug and adds a test-script for patch view which includes a test
for the inital commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.5.4.4
Lars Hjemli [Mon, 17 Mar 2008 21:59:09 +0000 (22:59 +0100)]
Use GIT-1.5.4.4

16 years agotests/setup.sh: cleanup test script output and logging
Lars Hjemli [Sun, 24 Feb 2008 18:53:51 +0000 (19:53 +0100)]
tests/setup.sh: cleanup test script output and logging

Log the complete output from each test-script in test-output.log and tell the
user about the logfile when a test-script fails.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agot0010-validate.sh: return on cgit errors
Lars Hjemli [Sun, 24 Feb 2008 18:43:46 +0000 (19:43 +0100)]
t0010-validate.sh: return on cgit errors

The earlier segfault in cgit passed by unnoticed by this test-script due to
the pipe between cgit and sed.

There might be a more elegant solution to this problem, but my shellscript-
foo is weak.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMake output from `make test` more readable
Lars Hjemli [Sun, 24 Feb 2008 15:05:58 +0000 (16:05 +0100)]
Make output from `make test` more readable

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoBrown paper bag: don't use `grep -v`
Lars Hjemli [Sun, 24 Feb 2008 14:35:52 +0000 (15:35 +0100)]
Brown paper bag: don't use `grep -v`

For some inexplicable reason I'd gotten the semantics of `grep -v` totally
backwards, thinking it somehow would make the exitcode from grep indicate
the non-match of the specified pattern.

This fixes the broken tests and gives me a valuable lession about shell
programming at the same time.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd regression-test for description-less repos
Lars Hjemli [Sun, 24 Feb 2008 14:27:33 +0000 (15:27 +0100)]
Add regression-test for description-less repos

The segfault fixed in commit eacde43d7184452e1fdc90b982b531f1f5239923 was
triggered when the html-functions manipulated string literals. One callpatch
which could trigger the bug is in ui-repolist.c when repo descriptions are
passed to html_ntxt(): if a repo is lacking a description, the literal
string "[no description]" is used.

This patch changes test/setup.sh such that the first repo has no description,
and adds tests for both "[no description]" and "the bar repo" (description
of the other repo) to tests/t0101-index.sh, which should be enought to catch
regressions in these functions.

Noticed-by: Hiroki Hattori <seagull.kamome@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Sat, 23 Feb 2008 19:13:57 +0000 (20:13 +0100)]
Merge branch 'stable'

* stable:
  Fix segfault

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix segfault
Hiroki Hattori [Sat, 23 Feb 2008 17:57:34 +0000 (02:57 +0900)]
Fix segfault

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoImprove initialization of git directory
Lars Hjemli [Sat, 16 Feb 2008 20:16:53 +0000 (21:16 +0100)]
Improve initialization of git directory

Using the functions offered by libgit feels like the right thing to do. Also,
make sure that config errors gets properly reported.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove cgit_repo into cgit_context
Lars Hjemli [Sat, 16 Feb 2008 12:56:09 +0000 (13:56 +0100)]
Move cgit_repo into cgit_context

This removes the global variable which is used to keep track of the
currently selected repository, and adds a new variable in the cgit_context
structure.

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