Lars Hjemli [Mon, 23 Jul 2007 20:51:45 +0000 (22:51 +0200)]
ui-snapshot: whitespace/formatting cleanup
Introduce a #define for number of snapshot archive entries, move all decls
to function entrypoint, remove some trailing whitespace and reformat a few
lines.
Lars Hjemli [Sun, 22 Jul 2007 21:57:48 +0000 (23:57 +0200)]
Merge branch 'master' of git://git.klever.net/patchwork/cgit
* 'master' of git://git.klever.net/patchwork/cgit:
link raw blob from tree file view
fix: changed view link to blob in summary.
allow selective enabling of snapshots
shorten snapshot names to repo basename
introduce cgit_repobasename
added snapshot filename to the link
add plain uncompressed tar snapshort format
introduced .tar.bz2 snapshots
compress .tar.gz using gzip as a filter
added a chk_non_negative check
css: adjust vertical-align of commit info th cells
add support for snapshot tarballs
Michael Krelin [Sat, 21 Jul 2007 00:05:34 +0000 (02:05 +0200)]
introduced .tar.bz2 snapshots
- reworked write_tar_gzip_archive to handle arbitrary filter as a
write_compressed_tar_archive
- reformatted whitespaces in the said function to adhere to common cgit
standards
- added wrappers around write_compressed_tar_archive for .tar.gz and .tar.bz2
- added a hint for vim to use 8 characters shift width by default
Michael Krelin [Wed, 18 Jul 2007 12:40:03 +0000 (14:40 +0200)]
add support for snapshot tarballs
- reworked cgit_print_snapshot to use a list of supported archivers and pick
one for the suffix supplied
- moved printing of snaphot links into ui-snapshot and make it iterate through
the said list
Lars Hjemli [Fri, 29 Jun 2007 18:32:08 +0000 (20:32 +0200)]
Merge branch 'lh/menu'
* lh/menu:
Add ofs argument to cgit_log_link and use it in ui-log.c
Add trim_end() and use it to remove trailing slashes from repo paths
Do not include current path in the "tree" menu link
Add setting to enable/disable extra links on index page
Change S/L/T to summary/log/tree
Change "files" to "tree"
Include querystring as part of cached filename for repo summary page
Add more menuitems on repo pages
Lars Hjemli [Tue, 26 Jun 2007 16:04:31 +0000 (18:04 +0200)]
Add trim_end() and use it to remove trailing slashes from repo paths
The new function removes all trailing instances of an arbitrary character
from a copy of the supplied char array. This is then used to remove any
trailing slashes from cgit_query_path.
Lars Hjemli [Tue, 26 Jun 2007 15:32:03 +0000 (17:32 +0200)]
Do not include current path in the "tree" menu link
When generating the menu links on repo pages the tree link included the
current path. This made the link pretty useless whenever the current path
was set so this commit just passes NULL instead.
Lars Hjemli [Mon, 18 Jun 2007 22:56:40 +0000 (00:56 +0200)]
Add setting to enable/disable extra links on index page
The summary/log/tree links displayed for each repository on the index
page lost some of their purpose when the header menu was added, so this
commit introduces the parameter 'enable-index-links' which must be set
to 1 to enable these links.
Suggested-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Lars Hjemli [Mon, 18 Jun 2007 19:17:24 +0000 (21:17 +0200)]
Include querystring as part of cached filename for repo summary page
When adding support for the h parameter to the summary page (passing current
branch between pages), the builtin cache returned basically random results
for summary page since the cached filename didn't honour the querystring.
This fixes the issue for now, but someday it might be worthwhile to generate
'canonical' filenames in the cache for all pages, i.e. something a bit more
clever than just including the querystring.
Lars Hjemli [Mon, 18 Jun 2007 07:42:10 +0000 (09:42 +0200)]
Add version info from git-describe
A new script, gen-version.sh, is now invoked from 'make version' to generate
the file VERSION. This file contains a version identifier generated by
git-describe and is included in the Makefile.
Lars Hjemli [Sun, 17 Jun 2007 22:18:42 +0000 (00:18 +0200)]
Add more menuitems on repo pages
In an attempt to get better usability, a set of 'semistatic' menuitems
are added to the page header on all pages except the repository index.
The menuitems (summary, log, files, commit and diff) honours the current
branch and revision. To switch the current branch one can use the branch
links on the summary page.
The backlink to the repository index page is now available by clicking
the static page heading.
Lars Hjemli [Sun, 17 Jun 2007 16:12:03 +0000 (18:12 +0200)]
Add cgit_diff_link()
This adds a new function used to generate links to the diff page and uses
it everywhere such links appear (expect for single files in the diffstat
displayed on the commit page: this is now a link to the tree page).
The updated diff-page now expects zero, one or two revision specifiers, in
parameters head, id and id2. Id defaults to head unless otherwise specified,
while head (as usual) defaults to repo.defbranch. If id2 isn't specified, it
defaults to the first parent of id1.
The most important change is of course that now all repo pages (summary, log,
tree, commit and diff) has support for passing on the current branch and
revision, i.e. the road is now open for a 'static' menu with links to all
of these pages.
Lars Hjemli [Sun, 17 Jun 2007 13:44:22 +0000 (15:44 +0200)]
ui-commit: use cgit_commit_link() for parent links
This replaces the old cgit_pageurl() function with the brand new
cgit_commit_link() function, making parent links in commit view preserve
the current branch.
Lars Hjemli [Sun, 17 Jun 2007 12:58:45 +0000 (14:58 +0200)]
ui-log: honor id=sha1 on querystring
This teaches ui-log to prefer id=sha1 and fallback to h=rev if no id-
parameter is specified. With this change, summary, log, commit and tree
views now passes current branch using h parameter and current revision
using id parameter.
Lars Hjemli [Sun, 17 Jun 2007 12:53:02 +0000 (14:53 +0200)]
Add cgit_commit_link() + support for id=sha1 to commit view
This adds a function to generate links to the commit page and extends said
page to use id from querystring as primary revision specified (fallback to
h).
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.