Commit Graph

676 Commits

Author SHA1 Message Date
Lars Hjemli
c52e84135e 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>
2007-02-05 00:12:04 +01:00
Lars Hjemli
74b0db9556 Update cgitrc template
Make the descriptions more helpfull.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-02-04 23:24:08 +01:00
Lars Hjemli
8fb2f05696 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>
2007-02-04 22:55:19 +01:00
Lars Hjemli
ce1c7336e5 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>
2007-02-04 21:47:46 +01:00
Lars Hjemli
ebd7b0fbc3 Do not die if tag has no message
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-02-04 21:21:46 +01:00
Lars Hjemli
bb3e7950c3 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>
2007-02-03 13:10:26 +01:00
Lars Hjemli
66414b68cf Update README with install/config information
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-28 13:18:23 +01:00
Lars Hjemli
3c388a3bf8 Add template for /etc/cgitrc
This doubles as documentation of the parameteres :)

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-28 12:52:14 +01:00
Lars Hjemli
7dd50c98d7 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>
2007-01-28 12:17:03 +01:00
Lars Hjemli
d8b0cca260 Set explicit font size
This might be bad style, but cgit really needed smaller fonts.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-28 12:01:21 +01:00
Lars Hjemli
8596cda71d Change global document layout
Use a document-wide table for the main layout

Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
2007-01-28 11:33:55 +01:00
Lars Hjemli
4a9dea5c01 Unified install path
Install all files into single directory

Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
2007-01-28 11:31:57 +01:00
Lars Hjemli
777faf7e50 Cleanup table listings
Make the output for <table class='list'> a bit nicer

Signed-off-by: Lars Hjemli <larsh@slaptop.hjemli.net>
2007-01-28 00:52:41 +01:00
Lars Hjemli
447025f62c Enable building with debuginfo
Add -g to CFLAGS when running make with DEBUG=1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-17 01:13:05 +01:00
Lars Hjemli
23734c5a2b Extend repo summary with tag list
Show all tags in the repo below the branch list.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-17 01:10:39 +01:00
Lars Hjemli
a69061fdb7 Add function cgit_parse_tag()
Teach cgit how to extract author info from a tag.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-17 01:09:51 +01:00
Lars Hjemli
06c81d6faa 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>
2007-01-17 01:07:31 +01:00
Lars Hjemli
66091f934a 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.
2007-01-16 18:41:01 +01:00
Lars Hjemli
5cd2bf7e7f WIP: add paths/backlinks to tree/blobview 2007-01-12 00:46:17 +01:00
Lars Hjemli
2c2047ff67 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>
2007-01-12 00:24:35 +01:00
Lars Hjemli
83a5f35a27 Move cache_prepare() to cgit
This moves some cgit-specific stuff away from cache.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-01-12 00:00:15 +01:00
Lars Hjemli
f98e72684b 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)>
2007-01-05 18:20:23 +01:00
Lars Hjemli
a6a1112528 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)>
2007-01-05 18:18:58 +01:00
Lars Hjemli
52e605caf5 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)>
2007-01-04 16:57:00 +01:00
Lars Hjemli
05b13194b4 Handle '+' in querystring
Translate '+' to ' ' in querystring parser (still doesn't handle %xx)

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-28 02:51:46 +01:00
Lars Hjemli
732d68d240 Add basic log filtering
This enables case-insensitive grep on logentris using the new search box

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-28 02:45:28 +01:00
Lars Hjemli
e39d738c39 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>
2006-12-28 02:01:49 +01:00
Lars Hjemli
27cd3b2a70 Test for NULL-pointers in html_txt() and friends
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-28 01:54:43 +01:00
Lars Hjemli
c43f1246cb Minor style fixes
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-22 01:44:32 +01:00
Lars Hjemli
2efee09abe Add missing diff-link in ui-commit.c
Gaah.

This should have been a part of 36aba00273

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-22 01:38:37 +01:00
Lars Hjemli
9d8d9b6123 Only show first 80 characters of commit subject in log and summary
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-22 00:58:18 +01:00
Lars Hjemli
378cae6398 Add missing ttl-options in config
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-22 00:56:15 +01:00
Lars Hjemli
8e495b075d 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>
2006-12-21 00:53:34 +01:00
Lars Hjemli
40dea5254a Let make know that ui-diff.c depends on xdiff.h
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-21 00:47:05 +01:00
Lars Hjemli
36aba00273 Add basic diff view
Finally, xdiff is used to show per-file diffs via commit view.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-20 22:48:27 +01:00
Lars Hjemli
a53042865a 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>
2006-12-17 23:55:53 +01:00
Lars Hjemli
fb6e5869dc 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>
2006-12-17 23:30:55 +01:00
Lars Hjemli
6cb326c83b 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>
2006-12-17 23:07:28 +01:00
Lars Hjemli
9c5229ea39 Reformat code to avoid excessive line lengths
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 21:02:02 +01:00
Lars Hjemli
aaa24bdd30 Add cgit_free_commitinfo() and use where needed
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 14:58:20 +01:00
Lars Hjemli
fa82b03e05 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>
2006-12-16 14:46:05 +01:00
Lars Hjemli
8960d267ed 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>
2006-12-16 14:28:26 +01:00
Lars Hjemli
77078ba716 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>
2006-12-16 14:25:41 +01:00
Lars Hjemli
7c849d94ec 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>
2006-12-16 13:55:58 +01:00
Lars Hjemli
61245ad185 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>
2006-12-16 13:43:01 +01:00
Lars Hjemli
521dc7a4bf 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>
2006-12-16 13:38:45 +01:00
Lars Hjemli
a1a79998f2 Add head comment to shared.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 01:14:01 +01:00
Lars Hjemli
6c14f5e457 Add head comment to ui-commit.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 01:11:55 +01:00
Lars Hjemli
f516218d0d gitweb ripoff: set tr:hover to highligt current row
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 01:05:58 +01:00
Lars Hjemli
0de2055b75 Make repo header a link to summary page
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-16 00:49:37 +01:00