]> granicus.if.org Git - cgit/log
cgit
17 years agoDon't hardcode urls when SCRIPT_NAME is available
Lars Hjemli [Mon, 14 May 2007 22:48:31 +0000 (00:48 +0200)]
Don't hardcode urls when SCRIPT_NAME is available

Also, let the makefile define the name of the installed cgi and
use that definition as a default value for cgit_script_name variable.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoui-shared.c: fix whitespace breakage
Lars Hjemli [Mon, 14 May 2007 22:22:03 +0000 (00:22 +0200)]
ui-shared.c: fix whitespace breakage

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoShow tag heading even if first tag is of the lightweight kind
Lars Hjemli [Mon, 14 May 2007 22:07:37 +0000 (00:07 +0200)]
Show tag heading even if first tag is of the lightweight kind

The tag printing code waited for valid tags before printing the
table heading, but forgot to count unannotated tags. This fixes it.

Noticed by Kristian Høgsberg <krh@bitplanet.net>

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoSpecify static storage class for file-local declarations
Lars Hjemli [Mon, 14 May 2007 21:58:29 +0000 (23:58 +0200)]
Specify static storage class for file-local declarations

Also fix some whitespace issues while at it.

Noticed by Kristian Høgsberg <krh@bitplanet.net>

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd include-parameter to config files
Lars Hjemli [Mon, 14 May 2007 21:40:33 +0000 (23:40 +0200)]
Add include-parameter to config files

This parameter can be used to include another config-file, like
a standalone repository listing.

Suggested in a patch by Kristian Høgsberg <krh@bitplanet.net>

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoLet makefile override the configfile location
Lars Hjemli [Mon, 14 May 2007 21:09:49 +0000 (23:09 +0200)]
Let makefile override the configfile location

Pass CGIT_CONFIG from makefile during build, to enable stuff like

  make CGIT_CONFIG=/var/cgit/cgit.conf

Noticed by Kristian Høgsberg <krh@bitplanet.net>

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agocgit.c: fix whitespace breakage
Lars Hjemli [Mon, 14 May 2007 20:58:01 +0000 (22:58 +0200)]
cgit.c: fix whitespace breakage

17 years agocgit.css: try to make diffs look a little bit nicer
Lars Hjemli [Mon, 14 May 2007 16:31:05 +0000 (18:31 +0200)]
cgit.css: try to make diffs look a little bit nicer

This makes the diffview look more like 'git-diff' in a terminal.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agocgit.css: try do make diffstat a little bit nicer
Lars Hjemli [Mon, 14 May 2007 16:08:03 +0000 (18:08 +0200)]
cgit.css: try do make diffstat a little bit nicer

I'm still no webdesigner, but this seems to be a more pleasant "visual
experience".

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd log filtering by path and link to it from tree view
Lars Hjemli [Mon, 14 May 2007 09:10:59 +0000 (11:10 +0200)]
Add log filtering by path and link to it from tree view

This enables path-filtering in log-view, and adds a link per entry in
tree-view to show the log for each file/directory.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agocgit v0.4 v0.4
Lars Hjemli [Sun, 13 May 2007 21:28:19 +0000 (23:28 +0200)]
cgit v0.4

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd commitdiff between commit and each of it's parent
Lars Hjemli [Sun, 13 May 2007 21:13:12 +0000 (23:13 +0200)]
Add commitdiff between commit and each of it's parent

A link is added next to each parent of a commit, leading to the new
diff-functionality in ui-diff.c.

Also added support for a path-parameter to filelevel diffs accessed via the
diffstat.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd graphical diffstat to commit view
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd max-commit-count parameter to cgitrc
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoShow number of changed lines in log view
Lars Hjemli [Sun, 13 May 2007 15:03:27 +0000 (17:03 +0200)]
Show number of changed lines in log view

Use the new file-diff interface to calculate number of changed lines
per commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoSimplify ui-diff.c using the new file-level diff interface
Lars Hjemli [Sun, 13 May 2007 12:21:46 +0000 (14:21 +0200)]
Simplify ui-diff.c using the new file-level diff interface

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd standard interface for file diff functions
Lars Hjemli [Sun, 13 May 2007 12:21:19 +0000 (14:21 +0200)]
Add standard interface for file diff functions

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoShow number of changed files in log view
Lars Hjemli [Sun, 13 May 2007 09:27:46 +0000 (11:27 +0200)]
Show number of changed files in log view

This uses the new tree-diff functions to calculate number of files
changed per commit.

Also fix some whitespace issues.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUse standard tree-diff function when showing diffstat for single commit
Lars Hjemli [Sun, 13 May 2007 09:26:23 +0000 (11:26 +0200)]
Use standard tree-diff function when showing diffstat for single commit

Remove unneeded code from ui-commit.c and replace with call to standard
diff-functions.

Also fix some whitespace issues.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd shared diff-handling functions
Lars Hjemli [Sun, 13 May 2007 09:24:23 +0000 (11:24 +0200)]
Add shared diff-handling functions

This adds a standard interface for tree diffing.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agocss: fix bad rendering in Internet Explorer
Lars Hjemli [Fri, 11 May 2007 22:29:37 +0000 (00:29 +0200)]
css: fix bad rendering in Internet Explorer

The layout-tables used border-collapse:separate, which maked all pages look
really bad in IE. Fix it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd links to enable downloading of tagged blobs
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMakefile: add support for building w.o. preinstalled git
Lars Hjemli [Fri, 11 May 2007 18:41:14 +0000 (20:41 +0200)]
Makefile: add support for building w.o. preinstalled git

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoTag release v0.3 v0.3
Lars Hjemli [Fri, 11 May 2007 10:15:44 +0000 (12:15 +0200)]
Tag release v0.3

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUpdate README with submodule build info
Lars Hjemli [Fri, 11 May 2007 10:13:15 +0000 (12:13 +0200)]
Update README with submodule build info

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd submodule links in tree listing
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd submodules.sh and use it during builds
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdded git as a submodule
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for downloading single blobs
Lars Hjemli [Tue, 8 May 2007 22:48:09 +0000 (00:48 +0200)]
Add support for downloading single blobs

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoui-view: show pathname if specified in querystring
Lars Hjemli [Tue, 8 May 2007 21:52:56 +0000 (23:52 +0200)]
ui-view: show pathname if specified in querystring

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUpdate to libgit 1.5.2-rc2
Lars Hjemli [Tue, 8 May 2007 20:40:59 +0000 (22:40 +0200)]
Update to libgit 1.5.2-rc2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoLayout update
Lars Hjemli [Sat, 17 Feb 2007 12:46:18 +0000 (13:46 +0100)]
Layout update

17 years agoMake snapshot feature configurable
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".

By default, no snapshotting is enabled.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for snapshots
Lars Hjemli [Thu, 8 Feb 2007 12:53:13 +0000 (13:53 +0100)]
Add support for snapshots

Make a link from the commit viewer to a snapshot of the corresponding tree.

Currently only zip-format is supported.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agocgit v0.2 v0.2
Lars Hjemli [Sun, 4 Feb 2007 23:21:06 +0000 (00:21 +0100)]
cgit v0.2

Main changes since v0.1:
  -list tags in repo summary
  -allow search in log-view
  -read repository paths from cgitrc

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for prefix and gitsrc arguments to 'make'
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUpdate cgitrc template
Lars Hjemli [Sun, 4 Feb 2007 22:24:08 +0000 (23:24 +0100)]
Update cgitrc template

Make the descriptions more helpfull.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for lightweight tags
Lars Hjemli [Sun, 4 Feb 2007 21:55:19 +0000 (22:55 +0100)]
Add support for lightweight tags

There is nothing bad about a tag that has no tag-object, but the old code
didn't handle such tags correctly. Fix it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoRead repo-info from /etc/cgitrc
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

repo.url=cgit-priv
repo.name=cgit/private
repo.path=/home/larsh/src/cgit/.git
repo.desc=My private cgit repo
repo.owner=Lars Hjemli

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoDo not die if tag has no message
Lars Hjemli [Sat, 3 Feb 2007 15:11:41 +0000 (16:11 +0100)]
Do not die if tag has no message

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoFix search for non-virtual urls
Lars Hjemli [Sat, 3 Feb 2007 12:08:21 +0000 (13:08 +0100)]
Fix search for non-virtual urls

When cgit don't use virtual urls, the current repo and page
url parameters must be included in the search form as hidden
input fields.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUpdate README with install/config information
Lars Hjemli [Sun, 28 Jan 2007 12:18:23 +0000 (13:18 +0100)]
Update README with install/config information

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd template for /etc/cgitrc
Lars Hjemli [Sun, 28 Jan 2007 11:52:14 +0000 (12:52 +0100)]
Add template for /etc/cgitrc

This doubles as documentation of the parameteres :)

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd parameter to adjust max message length in log listings
Lars Hjemli [Sun, 28 Jan 2007 11:17:03 +0000 (12:17 +0100)]
Add parameter to adjust max message length in log listings

The parameter "max-message-length" can be specified in cgitrc, default value
is 60.

This affects the log message shown in repo summary and shortlog.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoSet explicit font size
Lars Hjemli [Sun, 28 Jan 2007 11:01:21 +0000 (12:01 +0100)]
Set explicit font size

This might be bad style, but cgit really needed smaller fonts.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoChange global document layout
Lars Hjemli [Sun, 28 Jan 2007 10:33:55 +0000 (11:33 +0100)]
Change global document layout

Use a document-wide table for the main layout

Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
17 years agoUnified install path
Lars Hjemli [Sun, 28 Jan 2007 10:31:57 +0000 (11:31 +0100)]
Unified install path

Install all files into single directory

Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
17 years agoCleanup table listings
Lars Hjemli [Sat, 27 Jan 2007 23:39:26 +0000 (00:39 +0100)]
Cleanup table listings

Make the output for <table class='list'> a bit nicer

Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
17 years agoEnable building with debuginfo
Lars Hjemli [Wed, 17 Jan 2007 00:13:05 +0000 (01:13 +0100)]
Enable building with debuginfo

Add -g to CFLAGS when running make with DEBUG=1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoExtend repo summary with tag list
Lars Hjemli [Wed, 17 Jan 2007 00:10:39 +0000 (01:10 +0100)]
Extend repo summary with tag list

Show all tags in the repo below the branch list.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd function cgit_parse_tag()
Lars Hjemli [Wed, 17 Jan 2007 00:09:51 +0000 (01:09 +0100)]
Add function cgit_parse_tag()

Teach cgit how to extract author info from a tag.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd some more decls from git (cache.h, tag.h)
Lars Hjemli [Wed, 17 Jan 2007 00:07:31 +0000 (01:07 +0100)]
Add some more decls from git (cache.h, tag.h)

This is in preparation for extended tag support in cgit

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoHandle empty/malformed commit messages
Lars Hjemli [Tue, 16 Jan 2007 17:41:01 +0000 (18:41 +0100)]
Handle empty/malformed commit messages

An empty commit message would trigger a segfault in the current
cgit_parse_commit().

Also, make sure that all char-pointers are properly initialized.

18 years agoWIP: add paths/backlinks to tree/blobview
Lars Hjemli [Thu, 11 Jan 2007 23:46:17 +0000 (00:46 +0100)]
WIP: add paths/backlinks to tree/blobview

18 years agoRemove troublesome chars from cachefile names
Lars Hjemli [Thu, 11 Jan 2007 23:24:35 +0000 (00:24 +0100)]
Remove troublesome chars from cachefile names

Add a funtion cache_safe_filename() which replaces possibly bad filename
characters with '_'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMove cache_prepare() to cgit
Lars Hjemli [Thu, 11 Jan 2007 23:00:15 +0000 (00:00 +0100)]
Move cache_prepare() to cgit

This moves some cgit-specific stuff away from cache.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoUse long instead of int when converting from TTL to seconds
Lars Hjemli [Fri, 5 Jan 2007 17:20:23 +0000 (18:20 +0100)]
Use long instead of int when converting from TTL to seconds

Just to be really, really sure about embarrasing overflow settings

Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
18 years agoUse TTL-settings even in nocache mode
Lars Hjemli [Fri, 5 Jan 2007 17:18:58 +0000 (18:18 +0100)]
Use TTL-settings even in nocache mode

In nocace mode an uninitialized ttl-setting was used to generate http-Expires
header. Fix it.

Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
18 years agoHandle %xx encoding in querystring
Lars Hjemli [Thu, 4 Jan 2007 15:53:03 +0000 (16:53 +0100)]
Handle %xx encoding in querystring

Convert valid %xx expressions in querystring to ascii, ignore invalid
expressions (i.e. eat the three characters %xx).

Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
18 years agoHandle '+' in querystring
Lars Hjemli [Thu, 28 Dec 2006 01:51:46 +0000 (02:51 +0100)]
Handle '+' in querystring

Translate '+' to ' ' in querystring parser (still doesn't handle %xx)

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd basic log filtering
Lars Hjemli [Thu, 28 Dec 2006 01:45:28 +0000 (02:45 +0100)]
Add basic log filtering

This enables case-insensitive grep on logentris using the new search box

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd generic support for search box in page header
Lars Hjemli [Thu, 28 Dec 2006 01:01:49 +0000 (02:01 +0100)]
Add generic support for search box in page header

This adds the ability to show a search box in any pageheader with correct href and
hidden form data, but does not enable the box on any pages.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoTest for NULL-pointers in html_txt() and friends
Lars Hjemli [Thu, 28 Dec 2006 00:54:43 +0000 (01:54 +0100)]
Test for NULL-pointers in html_txt() and friends

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMinor style fixes
Lars Hjemli [Fri, 22 Dec 2006 00:44:32 +0000 (01:44 +0100)]
Minor style fixes

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd missing diff-link in ui-commit.c
Lars Hjemli [Fri, 22 Dec 2006 00:38:37 +0000 (01:38 +0100)]
Add missing diff-link in ui-commit.c

Gaah.

This should have been a part of 36aba00273e7af1b94bf8c5dd5068709d983d01e

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoOnly show first 80 characters of commit subject in log and summary
Lars Hjemli [Thu, 21 Dec 2006 23:58:18 +0000 (00:58 +0100)]
Only show first 80 characters of commit subject in log and summary

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd missing ttl-options in config
Lars Hjemli [Thu, 21 Dec 2006 23:56:02 +0000 (00:56 +0100)]
Add missing ttl-options in config

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agocgit 0.1 v0.1
Lars Hjemli [Wed, 20 Dec 2006 23:53:03 +0000 (00:53 +0100)]
cgit 0.1

With a working diff, it really has all the basics.

Next steps will be to make it more usable and less ugly :)

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoLet make know that ui-diff.c depends on xdiff.h
Lars Hjemli [Wed, 20 Dec 2006 23:47:05 +0000 (00:47 +0100)]
Let make know that ui-diff.c depends on xdiff.h

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd basic diff view
Lars Hjemli [Wed, 20 Dec 2006 21:48:27 +0000 (22:48 +0100)]
Add basic diff view

Finally, xdiff is used to show per-file diffs via commit view.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoUse html_filemode in ui-tree.c
Lars Hjemli [Sun, 17 Dec 2006 22:55:53 +0000 (23:55 +0100)]
Use html_filemode in ui-tree.c

No reason to show "100644" when we can show "-rw-r--r--"

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoDon't show new and old filemode for added/removed files
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)

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoShow list of modified files in ui-commit.c
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoReformat code to avoid excessive line lengths
Lars Hjemli [Sat, 16 Dec 2006 18:35:31 +0000 (19:35 +0100)]
Reformat code to avoid excessive line lengths

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd cgit_free_commitinfo() and use where needed
Lars Hjemli [Sat, 16 Dec 2006 13:58:20 +0000 (14:58 +0100)]
Add cgit_free_commitinfo() and use where needed

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoSimplify ui-commit.c
Lars Hjemli [Sat, 16 Dec 2006 13:46:05 +0000 (14:46 +0100)]
Simplify ui-commit.c

Replace the call to lookup_commit() with a call to lookup_commit_reference,
since it handles reading and parsing of the commit object internally.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoShow emails and timestamps in ui-commit.c
Lars Hjemli [Sat, 16 Dec 2006 13:28:26 +0000 (14:28 +0100)]
Show emails and timestamps in ui-commit.c

Use the extra info found in commitinfo struct when generating commit
view.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoTeach commit parser about author/committer email + timestamp
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAllow relative paths for cgit_cache_root
Lars Hjemli [Sat, 16 Dec 2006 12:55:58 +0000 (13:55 +0100)]
Allow relative paths for cgit_cache_root

Make sure we chdir(2) back to the original getcwd(2) when a page
has been generated. Also, if the cgit_cache_root do not exist,
try to create it.

This is a feature intended to ease testing/debugging.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd cache-root option to /cgit/rc
Lars Hjemli [Sat, 16 Dec 2006 12:43:01 +0000 (13:43 +0100)]
Add cache-root option to /cgit/rc

Somehow, this option was forgotten when parsing the configfile.

Add it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd argument parsing + switch for uncached operation
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd head comment to shared.c
Lars Hjemli [Sat, 16 Dec 2006 00:14:01 +0000 (01:14 +0100)]
Add head comment to shared.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd head comment to ui-commit.c
Lars Hjemli [Sat, 16 Dec 2006 00:11:55 +0000 (01:11 +0100)]
Add head comment to ui-commit.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agogitweb ripoff: set tr:hover to highligt current row
Lars Hjemli [Sat, 16 Dec 2006 00:00:12 +0000 (01:00 +0100)]
gitweb ripoff: set tr:hover to highligt current row

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMake repo header a link to summary page
Lars Hjemli [Fri, 15 Dec 2006 23:49:37 +0000 (00:49 +0100)]
Make repo header a link to summary page

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMove cgit_print_date into ui-shared, reuse in ui-summary
Lars Hjemli [Fri, 15 Dec 2006 23:33:28 +0000 (00:33 +0100)]
Move cgit_print_date into ui-shared, reuse in ui-summary

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd ui-commit.c + misc ui cleanups
Lars Hjemli [Fri, 15 Dec 2006 23:19:56 +0000 (00:19 +0100)]
Add ui-commit.c + misc ui cleanups

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd a common commit parser
Lars Hjemli [Fri, 15 Dec 2006 17:17:36 +0000 (18:17 +0100)]
Add a common commit parser

Make a better commit parser, replacing the ugly one in ui-log.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd simple pager to log page
Lars Hjemli [Wed, 13 Dec 2006 23:40:34 +0000 (00:40 +0100)]
Add simple pager to log page

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd separate makefile-rule to clear current cache
Lars Hjemli [Wed, 13 Dec 2006 13:39:41 +0000 (14:39 +0100)]
Add separate makefile-rule to clear current cache

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoRemove implementation details from README
Lars Hjemli [Wed, 13 Dec 2006 01:06:29 +0000 (02:06 +0100)]
Remove implementation details from README

Let README describe the "bigger picture" instead.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoSmall layout adjustments to summary and blob view
Lars Hjemli [Tue, 12 Dec 2006 23:36:22 +0000 (00:36 +0100)]
Small layout adjustments to summary and blob view

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoAdd display of tree content w/ui-tree.c
Lars Hjemli [Tue, 12 Dec 2006 23:13:27 +0000 (00:13 +0100)]
Add display of tree content w/ui-tree.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agocache_lock: do xstrdup/free on lockfile
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoDon't truncate valid cachefiles
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.

Thanks to Linus for noticing (again).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMove global variables + callback functions into shared.c
Lars Hjemli [Mon, 11 Dec 2006 16:25:41 +0000 (17:25 +0100)]
Move global variables + callback functions into shared.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMove functions for generic object output into ui-view.c
Lars Hjemli [Mon, 11 Dec 2006 16:12:26 +0000 (17:12 +0100)]
Move functions for generic object output into ui-view.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMove log-functions into ui-log.c
Lars Hjemli [Mon, 11 Dec 2006 16:04:19 +0000 (17:04 +0100)]
Move log-functions into ui-log.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMove repo summary functions into ui-summary.c
Lars Hjemli [Mon, 11 Dec 2006 15:55:07 +0000 (16:55 +0100)]
Move repo summary functions into ui-summary.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
18 years agoMove functions for repolist output into ui-repolist.c
Lars Hjemli [Mon, 11 Dec 2006 15:48:03 +0000 (16:48 +0100)]
Move functions for repolist output into ui-repolist.c

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