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
Lars Hjemli [Sun, 17 Dec 2006 22:30:55 +0000 (23:30 +0100)]
Don't show new and old filemode for added/removed files
It gives us no extra info whatsoever to show "----------" for either new
or old mode, it's just noise (especially since we now show the "old"
filemode for deleted files)
Lars Hjemli [Sun, 17 Dec 2006 22:07:28 +0000 (23:07 +0100)]
Show list of modified files in ui-commit.c
Compare current commit with 1.parent, and for each affected file display
current filemode, old filemode if changed, current filename and source
filename if it was a copy/rename.
Lars Hjemli [Sat, 16 Dec 2006 13:25:41 +0000 (14:25 +0100)]
Teach commit parser about author/committer email + timestamp
We want all four of these when showing a commit, so save them in the
commitinfo struct.
Btw: There's probably no good reason to save committer timestamp since
it's already available in commit->date. But it doesn't hurt us either,
and it makes the parser look more complete, so we just do it.
Lars Hjemli [Sat, 16 Dec 2006 12:33:32 +0000 (13:33 +0100)]
Add argument parsing + switch for uncached operation
This adds support for the following options to cgit:
--root=<path>
--cache=<path>
--nocache
--query=<querystring>
--repo=<reponame>
--page=<pagename>
--head=<branchname>
--sha1=<sha1>
--ofs=<number>
On startup, /etc/cgitrc is parsed, followed by argument parsing and
finally querystring parsing.
If --nocache is specified (or set in /etc/gitrc), caching is disabled and
cgit instead generates pages to stdout.
The combined effect of these two changes makes testing/debugging a lot
less painfull.
Lars Hjemli [Tue, 12 Dec 2006 09:16:41 +0000 (10:16 +0100)]
cache_lock: do xstrdup/free on lockfile
Since fmt() uses 8 alternating static buffers, and cache_lock might call
cache_create_dirs() multiple times, which in turn might call fmt() twice,
after four iterations lockfile would be overwritten by a cachedirectory
path.
In worst case, this could cause the cachedirectory to be unlinked and replaced
by a cachefile.
Fix: use xstrdup() on the result from fmt() before assigning to lockfile, and
call free(lockfile) before exit.
Lars Hjemli [Mon, 11 Dec 2006 21:53:50 +0000 (22:53 +0100)]
Don't truncate valid cachefiles
An embarrassing thinko in cgit_check_cache() would truncate valid cachefiles
in the following situation:
1) process A notices a missing/expired cachefile
2) process B gets scheduled, locks, fills and unlocks the cachefile
3) process A gets scheduled, locks the cachefile, notices that the cachefile
now exist/is not expired anymore, and continues to overwrite it with an
empty lockfile.