Lars Hjemli [Sun, 17 Jun 2007 11:57:51 +0000 (13:57 +0200)]
Add git_log_link() and fix bug in generic repolink function
The generic repolink function compared head with cgit_query_head, which
almost always would be the same pointer. The test now compares with
repo.defbranch, which is the wanted behavour.
Bug discovered while adding cgit_log_link(), so this commit also contain
that change.
Lars Hjemli [Sun, 17 Jun 2007 11:17:00 +0000 (13:17 +0200)]
ui-tree: html/css cleanup
Various fixes to make html and css more "clean". The only visible change
is the link to file/directory log: it is now printed as "L" (for Log)
instead of "H" (for History).
Lars Hjemli [Sat, 16 Jun 2007 18:20:42 +0000 (20:20 +0200)]
ui-tree: unify with ui-view, use path to select tree/blob
This teaches ui-tree to show both trees and blobs, thereby making ui-view
superfluous. At the same time, ui-tree is extended to honour the specified
path instead of requiering a tree/blob sha1.
Lars Hjemli [Wed, 6 Jun 2007 21:02:40 +0000 (23:02 +0200)]
ui-diff: close td/tr/table properly
The previous commit fixed the diff-view when two trees where specified on
the querystring (sha1/sha2) but made the generated html invalid when only
a commit sha1 is specified. This fixes it.
Ondrej Jirman [Sat, 26 May 2007 01:33:41 +0000 (03:33 +0200)]
Implemented configurable HEAD shortlog on summary page.
This mirrors similiar functionality in gitweb. After clicking on
project on projectlist you will immediatelly see quick summary
of last N commits on HEAD.
Lars Hjemli [Tue, 22 May 2007 21:25:25 +0000 (23:25 +0200)]
Show time since last change on index page
When creating the index page, an optional file can be scanned per repository
to obtain a timestamp for last modification within the repo. If such a file
cannot be found, st_mtime for repo.defbranch is used instead.
This information is then printed in a new column, "Idle", using the new
function cgit_print_age().
The new parameter "repo.agefile" can be used to specify (globally) a relative
path to scan (default value is "info/web/last-modified").
The content of the "last-modified" file can be generated by the post-receive
hook with a command like this:
Lars Hjemli [Sun, 20 May 2007 20:09:55 +0000 (22:09 +0200)]
Merge branch 'virtual-url'
* virtual-url:
Don't be fooled by trailing '/' in url-parameter
cache_safe_filename() needs more buffers
Enable url=value querystring parameter
Add lookup-function for valid repo commands
Move cgit_get_repoinfo into shared.c
Lars Hjemli [Fri, 18 May 2007 20:48:22 +0000 (22:48 +0200)]
Teach cgit how to group repositories by category
The new parameter 'repo.group' is used to set the repository group
for the following repositores. Whenever this parameter changes value,
a subheading is generated in the index page (printing the current value
of repo.group).
Lars Hjemli [Fri, 18 May 2007 11:06:45 +0000 (13:06 +0200)]
Don't be fooled by trailing '/' in url-parameter
cgit_parse_url() didn't check if the path-part of urls contained a
real path or just a trailing slash. This made the log-page die since
the path filtering supplied an invalid path argument. This fixes it.
Lars Hjemli [Fri, 18 May 2007 11:55:52 +0000 (13:55 +0200)]
Add knobs to enable/disable files/lines changed in log view
These columns can cause lots of IO on the server, so add settings to
explicitly enable them. Also, add per repo settings to optionally disable
the columns if sitewide enabled.
While at it, do not allow repo.snapshot to enable snapshots if the global
setting is disabled.
Lars Hjemli [Tue, 15 May 2007 22:14:51 +0000 (00:14 +0200)]
Enable default value for head parameter
Pages which expect head to be specified in the querystring can now be
given a default value, configurable per repository (via repo.defbranch,
which defaults to "master").
Currently, only the log page actually works without parameters, but the
defbranch is bound to be exploited.
Lars Hjemli [Tue, 15 May 2007 21:28:40 +0000 (23:28 +0200)]
Restrict deep nesting of configfiles
There is no point in restricting the number of included config-
files, but there is a point in restricting the nestinglevel
of configfiles: to avoid recursive inclusions. This is easily
achieved by decrementing the static nesting-variable upon exit
from cgit_read_config().
Lars Hjemli [Tue, 15 May 2007 00:13:11 +0000 (02:13 +0200)]
Use tables and css to create the diffstat graph, fix scaling
There was no need to use image-files for the graphs, so lets drop them.
At the same time, fix scaling of the graphs so that the full width is
used only if atleast 100 LOC are changed in one of the files.
Lars Hjemli [Sun, 13 May 2007 20:25:14 +0000 (22:25 +0200)]
Add graphical diffstat to commit view
The diffstat is calculated against the leftmost parent of the commit. This
gives nice information for "normal" merges while octopus merges are less
than optimal, so the diffstat isn't calculated for those merges.
Lars Hjemli [Sun, 13 May 2007 15:15:06 +0000 (17:15 +0200)]
Add max-commit-count parameter to cgitrc
This enabled customizing number of commits shown per page in log view. It
also changes the default from 100 to 50, mainly due to the more cpu
intensive log pages (number of files/lines changed) but also since 100
log messages requires excessive scrolling.
Lars Hjemli [Fri, 11 May 2007 21:44:42 +0000 (23:44 +0200)]
Add links to enable downloading of tagged blobs
All tags below refs/archives are shown on the repo summary page as
download links. The links referes to the tagged objects, using the
tag name as filename for download.
This can be used to add shortcuts for release tarballs, documentation
and other blobs stored in the object database, especially blobs that
are not reachable during cloning.
Lars Hjemli [Fri, 11 May 2007 10:12:48 +0000 (12:12 +0200)]
Add submodule links in tree listing
When a submodule occurs in a tree, generate a link to show the
module/commit. The link is specified as a sprintf string in /etc/cgitrc,
using parameters 'module-link' and 'repo.module-link'. This should probably
be extended with repo.module-link.$path.
Lars Hjemli [Thu, 10 May 2007 09:25:12 +0000 (11:25 +0200)]
Add submodules.sh and use it during builds
This adds a shell script which can be be used to initialize, list and
update submodules in a git repository. It reads the file .gitmodules
to find a mapping between submodule path and repository url for the
initial clone of all submodules.
The script is used during cgit builds to enable automatic download and
checkout of the git git repository.
Lars Hjemli [Thu, 10 May 2007 06:50:49 +0000 (08:50 +0200)]
Added git as a submodule
This commit adds the subdirectory 'git' as a submodule containing
the git git repository, but doesn't add support for automatically
cloning the submodule.
Lars Hjemli [Thu, 8 Feb 2007 13:47:56 +0000 (14:47 +0100)]
Make snapshot feature configurable
Snapshots can now be enabled/disabled by default for all repositories in
cgitrc with param "snapshots". Additionally, any repo can override the
default setting with param "repo.snapshots".
Lars Hjemli [Sun, 4 Feb 2007 22:57:34 +0000 (23:57 +0100)]
Add support for prefix and gitsrc arguments to 'make'
This should improve the installation a little, especially since the new
options are mentioned in the README. Also, add a make-rule to build the
git binaries if necessary + a dependency between cgit and libgit.a.
Lars Hjemli [Sat, 3 Feb 2007 14:02:55 +0000 (15:02 +0100)]
Read repo-info from /etc/cgitrc
This makes cgit read all repo-info from the configfile, instead of scanning for
possible git-dirs below a common root path. This is primarily done to get
better security (separate physical path from logical repo-name).
In /etc/cgitrc each repo is registered with the following keys:
repo.url
repo.name
repo.path
repo.desc
repo.owner
Note:
*Required keys are repo.url and repo.path, all others are optional
*Each occurrence of repo.url starts a new repository registration
*Default value for repo.name is taken from repo.url
*The value of repo.url cannot contain characters with special meaning for
urls (i.e. one of /?%&), while repo.name can contain anything.
Example:
repo.url=cgit-pub
repo.name=cgit/public
repo.path=/pub/git/cgit
repo.desc=My public cgit repo
repo.owner=Lars Hjemli