]> granicus.if.org Git - cgit/log
cgit
13 years agoMerge branch 'stable'
Lars Hjemli [Mon, 13 Jun 2011 12:41:01 +0000 (12:41 +0000)]
Merge branch 'stable'

13 years agoCGIT 0.9.0.1 v0.9.0.1
Lars Hjemli [Mon, 13 Jun 2011 12:37:04 +0000 (12:37 +0000)]
CGIT 0.9.0.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Sun, 12 Jun 2011 21:23:14 +0000 (21:23 +0000)]
Merge branch 'stable'

13 years agoui-plain.c: fix html and links generated by print_dir() and print_dir_entry()
Lars Hjemli [Sun, 12 Jun 2011 20:49:35 +0000 (20:49 +0000)]
ui-plain.c: fix html and links generated by print_dir() and print_dir_entry()

This patch fixes the following issues:
* the base argument usually isn't zero-terminated, so printing base
  without considering baselen will usually generate random garbage
* when the current url represents a directory but doesn't end in a slash,
  relative urls would be incorrect
* using unescaped paths allows XSS

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Mon, 6 Jun 2011 19:12:21 +0000 (19:12 +0000)]
Merge branch 'stable'

13 years agoscan-tree.c: avoid memory leak
Jamie Couture [Fri, 3 Jun 2011 23:21:01 +0000 (19:21 -0400)]
scan-tree.c: avoid memory leak

No references are kept to the memory pointed to by the 'rel' variable, so
it should be free()'d before returning from add_repo().

Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
Signed-off-by: Lars Hjemli <larsh@hjemli.net>
13 years agoMerge branch 'stable'
Lars Hjemli [Thu, 2 Jun 2011 10:33:23 +0000 (10:33 +0000)]
Merge branch 'stable'

13 years agoui-log.c: do not link from age column
Lars Hjemli [Thu, 2 Jun 2011 10:30:26 +0000 (10:30 +0000)]
ui-log.c: do not link from age column

The link url wasn't properly escaped, and since the link was identical
to the one used on the commit message it didn't serve any special purpose.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoui-snapshot.c: remove debug cruft
Lars Hjemli [Thu, 2 Jun 2011 10:26:41 +0000 (10:26 +0000)]
ui-snapshot.c: remove debug cruft

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoui-stats.c: fix invalid html
Lars Hjemli [Mon, 30 May 2011 22:21:22 +0000 (22:21 +0000)]
ui-stats.c: fix invalid html

Found by http://validator.w3.org.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Mon, 30 May 2011 21:57:25 +0000 (23:57 +0200)]
Merge branch 'stable'

13 years agoProperly escape ampersands inside HTML attributes
Lukas Fleischer [Tue, 24 May 2011 18:38:40 +0000 (20:38 +0200)]
Properly escape ampersands inside HTML attributes

Ampersands ("&") appearing inside HTML attributes need to be translated
to "&amp;". Otherwise, invalid XHTML will be generated at various
places, such as at tree views containing links to submodules.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoui_repolist: get modtime from packed-refs as fallback
Ferry Huberts [Fri, 13 May 2011 21:09:34 +0000 (23:09 +0200)]
ui_repolist: get modtime from packed-refs as fallback

When no modtime could be determined then as a final
fallback try to get it from the packed-refs.

This will show an idle time when a repository has been packed
with all refs in the packed-refs.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'lh/panel'
Lars Hjemli [Mon, 23 May 2011 21:29:24 +0000 (23:29 +0200)]
Merge branch 'lh/panel'

13 years agoMerge branch 'fh/filter-api'
Lars Hjemli [Mon, 23 May 2011 21:28:38 +0000 (23:28 +0200)]
Merge branch 'fh/filter-api'

Conflicts:
cgit.c

13 years agoMerge branch 'stable'
Lars Hjemli [Mon, 23 May 2011 21:26:10 +0000 (23:26 +0200)]
Merge branch 'stable'

13 years agofix virtual-root if script-name is ""
Mark Lodato [Fri, 13 May 2011 23:59:07 +0000 (19:59 -0400)]
fix virtual-root if script-name is ""

In d0cb841 (Avoid trailing slash in virtual-root), virtual-root was set
from script-name using trim_end().  However, if script-name was the
empty string (""), which happens when cgit is used to serve the root
path on a domain (/), trim_end() returns NULL and cgit acts like
virtual-root is not available.  Now, set virtual-root to "" in this
case, which fixes this bug.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoui-repolist.c: do not return random/stale data from read_agefile
Lars Hjemli [Mon, 23 May 2011 21:10:37 +0000 (23:10 +0200)]
ui-repolist.c: do not return random/stale data from read_agefile

When git/date.c:parse_date() cannot parse its input it returns -1. But
read_agefile() checks if the result is different from zero, essentialy
returning random data from the date buffer when parsing fails. This
patch fixes the issue by verifying that the result from parse_date()
is positive.

Noticed-by: Julius Plenz <plenz@cis.fu-berlin.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoAvoid null pointer dereference in cgit_print_diff().
Lukas Fleischer [Tue, 5 Apr 2011 08:38:53 +0000 (10:38 +0200)]
Avoid null pointer dereference in cgit_print_diff().

When calling cgit_print_diff() with a bad new_rev and a NULL old_rev,
checking for new_rev's parent commit will result in a null pointer
dereference. Returning on an invalid commit before dereferencing fixes
this. Spotted with clang-analyzer.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoAvoid null pointer dereference in reencode().
Lukas Fleischer [Tue, 5 Apr 2011 08:35:43 +0000 (10:35 +0200)]
Avoid null pointer dereference in reencode().

Returning "*txt" if "txt" is a null pointer is a bad thing. Spotted with
clang-analyzer.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoFix memory leak in http_parse_querystring().
Lukas Fleischer [Wed, 30 Mar 2011 23:21:39 +0000 (01:21 +0200)]
Fix memory leak in http_parse_querystring().

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoRemove unused variable from cgit_diff_tree().
Lukas Fleischer [Wed, 30 Mar 2011 17:17:58 +0000 (19:17 +0200)]
Remove unused variable from cgit_diff_tree().

Seen with "-Wunused-but-set-variable".

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoshared.c: do not modify const memory
Lars Hjemli [Sun, 22 May 2011 10:45:32 +0000 (12:45 +0200)]
shared.c: do not modify const memory

Noticed-by: zhongjj <zhongjj@lemote.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agotests: add tests for links with space in path and/or args
Lars Hjemli [Sun, 22 May 2011 10:22:56 +0000 (12:22 +0200)]
tests: add tests for links with space in path and/or args

These tests tries to detect bad links in various pages. On the log page,
there currently exists links which are not properly escaped due to the
use of cgit_fileurl() when building the link. For now, this bug is simply
tagged as such.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agotests/setup.sh: add support for known bugs
Lars Hjemli [Sun, 22 May 2011 10:21:31 +0000 (12:21 +0200)]
tests/setup.sh: add support for known bugs

This patch makes it possible to add tests for known bugs without aborting
the testrun.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoFix escaping of paths with spaces
Jonathon Mah [Sun, 10 Apr 2011 11:10:03 +0000 (04:10 -0700)]
Fix escaping of paths with spaces

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'dm/disable-clone'
Lars Hjemli [Sat, 14 May 2011 18:00:33 +0000 (20:00 +0200)]
Merge branch 'dm/disable-clone'

13 years agoMerge branch 'stable'
Lars Hjemli [Sat, 26 Mar 2011 14:22:35 +0000 (15:22 +0100)]
Merge branch 'stable'

13 years agoAdd advice about scan-path in cgitrc.5.txt
Julius Plenz [Thu, 10 Mar 2011 16:03:24 +0000 (17:03 +0100)]
Add advice about scan-path in cgitrc.5.txt

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agofix two encoding bugs
Julius Plenz [Thu, 10 Mar 2011 16:03:23 +0000 (17:03 +0100)]
fix two encoding bugs

reencode() takes three arguments in the order (txt, from, to), opposed to
reencode_string, which will, like iconv, handle the arguments with from
and to swapped. Fix that (this makes reencode more intuitive).
If src and dst encoding are equivalent, don't do any encoding.

If no special encoding parameter is found within the commit, assume
UTF-8 and explicitly convert to PAGE_ENCODING. The change to reencode()
mentioned above avoids re-encoding a UTF-8 string to UTF-8, for example.

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agomake enable-log-linecount independent of -filecount
Julius Plenz [Thu, 10 Mar 2011 16:03:22 +0000 (17:03 +0100)]
make enable-log-linecount independent of -filecount

You should be able to independently switch file and line count on and
off. This patch makes the code work like the documentation suggests: no
dependency for line counts to be displayed only when file counts are.

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agonew_filter: correctly initialise all arguments for a new filter
Ferry Huberts [Wed, 9 Mar 2011 07:16:59 +0000 (08:16 +0100)]
new_filter: correctly initialise all arguments for a new filter

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agosource_filter: fix a memory leak
Ferry Huberts [Wed, 9 Mar 2011 07:16:58 +0000 (08:16 +0100)]
source_filter: fix a memory leak

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agocgitrc.5: tar.xz is a supported snapshot format
Lars Hjemli [Sat, 26 Mar 2011 12:40:20 +0000 (13:40 +0100)]
cgitrc.5: tar.xz is a supported snapshot format

When tar.xz support was added in 0642435fed (2009-12-08: Add
.tar.xz-snapshot support), cgitrc.5 was not updated to match. This
patch fixes the issue.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoFix crash when projectsfile cannot be opened
Stefan Gehn [Sat, 26 Mar 2011 08:51:39 +0000 (09:51 +0100)]
Fix crash when projectsfile cannot be opened

This patch makes cgit properly abort in case the projectsfile cannot
be opened. Without the added return cgit continues using the projects
pointer which is NULL and thus causes a segfault.

13 years agoshared.c: use execvp() to execute filter commands
Lars Hjemli [Sat, 26 Mar 2011 10:22:35 +0000 (11:22 +0100)]
shared.c: use execvp() to execute filter commands

This reintroduces the use of execvp(), since the filter commands doesn't
always contain an absolute path (i.e. snapshot compression filters).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agofilters: document environment variables in filter scripts
Ferry Huberts [Wed, 23 Mar 2011 10:57:44 +0000 (11:57 +0100)]
filters: document environment variables in filter scripts

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agocgit_open_filter: hand down repo configuration to script
Ferry Huberts [Wed, 23 Mar 2011 10:57:43 +0000 (11:57 +0100)]
cgit_open_filter: hand down repo configuration to script

The environment variables can be used to (for example) resolve
the following situation:

Suppose a server setup in which each repository has a trac
instance; the commit filter needs to know with which
repository it's dealing in order to be able to resolve the
#123 ticket numbers in the commit messages into hyperlinks
into the correct trac instance.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agocgit_open_filter: also take the repo as a parameter
Ferry Huberts [Wed, 23 Mar 2011 10:57:42 +0000 (11:57 +0100)]
cgit_open_filter: also take the repo as a parameter

To prepare for handing repo configuration to the
filter script that is executed.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agonew_filter: determine extra_args from filter type
Ferry Huberts [Wed, 23 Mar 2011 10:57:41 +0000 (11:57 +0100)]
new_filter: determine extra_args from filter type

Currently the number of extra arguments is linked hard to the type of
the filter. This is also logical since it would be confusing to have
a different number of arguments for the same type of filter depending
on the context under which the filter is run (unless ofcourse one the
parameters would make the context clear, which is currently not the
case).

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoui-stats.c: create a control panel for stat options
Lars Hjemli [Sun, 6 Mar 2011 23:00:24 +0000 (00:00 +0100)]
ui-stats.c: create a control panel for stat options

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoui-diff.c: create a control panel for diff options
Lars Hjemli [Sun, 6 Mar 2011 22:59:56 +0000 (23:59 +0100)]
ui-diff.c: create a control panel for diff options

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agohtml.c: add html_intoption()
Lars Hjemli [Sun, 6 Mar 2011 22:57:26 +0000 (23:57 +0100)]
html.c: add html_intoption()

This is similar to html_option, but for int values.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoCGIT 0.9 v0.9
Lars Hjemli [Sat, 5 Mar 2011 13:23:12 +0000 (14:23 +0100)]
CGIT 0.9

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoUpdate README
Lars Hjemli [Sat, 5 Mar 2011 13:21:47 +0000 (14:21 +0100)]
Update README

13 years agoui-diff.c: avoid html injection
Lukasz Janyst [Sat, 5 Mar 2011 13:10:55 +0000 (14:10 +0100)]
ui-diff.c: avoid html injection

When path-filtering was used in commit-view, the path filter was
included without proper html escaping. This patch closes the hole.

Signed-off-by: Lukasz Janyst <ljanyst@cern.ch>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Sat, 5 Mar 2011 13:01:59 +0000 (14:01 +0100)]
Merge branch 'stable'

13 years agoCGIT 0.8.3.5 v0.8.3.5
Lars Hjemli [Sat, 5 Mar 2011 12:52:39 +0000 (13:52 +0100)]
CGIT 0.8.3.5

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoAvoid trailing slash in virtual-root
Lars Hjemli [Sat, 5 Mar 2011 12:47:04 +0000 (13:47 +0100)]
Avoid trailing slash in virtual-root

When setting virtual-root from cgitrc, care is taken to avoid trailing
slashes. But when no virtual-root setting is specified, SCRIPT_FILE
from the web server is used without similar checks. This patch fixes the
inconsistency, which could lead to double-slashes in generated links.

Noticed-by: Wouter Van Hemel <wouter@duodecim.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agodo not infloop on a query ending in %XY, for invalid hex X or Y
Jim Meyering [Mon, 28 Feb 2011 11:18:57 +0000 (12:18 +0100)]
do not infloop on a query ending in %XY, for invalid hex X or Y

When a query ends in say %gg, (or any invalid hex) e.g.,
http://git.gnome.org/browse/gdlmm/commit/?id=%gg
convert_query_hexchar calls memmove(txt, txt+3, 0), and then returns
txt-1, so the loop in http_parse_querystring never terminates.  The
solution is to make the memmove also copy the trailing NUL.
* html.c (convert_query_hexchar): Fix off-by-one error.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoReturn 404 on command not found
Dan McGee [Wed, 12 Jan 2011 18:06:08 +0000 (12:06 -0600)]
Return 404 on command not found

We were returning 200 before. Even 404 is questionable in all cases, but
200 was totally wrong. Also match the case of all of the "Not found"
status messsages.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoAllow disabling of HTTP clone URLs
Dan McGee [Wed, 12 Jan 2011 18:06:07 +0000 (12:06 -0600)]
Allow disabling of HTTP clone URLs

If advertising other URLs to your users, you may not want to make this
available through cgit (e.g. if you have the smart HTTP transport set up
elsewhere). Allow disabling the three magic commands that simulate the
git server, but default it to enabled.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoAdd is_clone flag to available commands
Dan McGee [Wed, 12 Jan 2011 18:06:06 +0000 (12:06 -0600)]
Add is_clone flag to available commands

This will be used to make these operations configurable via a config
option.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'br/misc'
Lars Hjemli [Sat, 19 Feb 2011 13:51:00 +0000 (14:51 +0100)]
Merge branch 'br/misc'

* br/misc:
  Use transparent background for the cgit logo
  ssdiff: anchors for ssdiff
  implement repo.logo and repo.logo-link

13 years agoUse transparent background for the cgit logo
Bernhard Reutner-Fischer [Thu, 23 Dec 2010 11:47:56 +0000 (12:47 +0100)]
Use transparent background for the cgit logo

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agossdiff: anchors for ssdiff
Bernhard Reutner-Fischer [Thu, 23 Dec 2010 11:47:55 +0000 (12:47 +0100)]
ssdiff: anchors for ssdiff

Emit anchors to the respective revisions in side-by-side diff view

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoimplement repo.logo and repo.logo-link
Bernhard Reutner-Fischer [Thu, 23 Dec 2010 11:47:54 +0000 (12:47 +0100)]
implement repo.logo and repo.logo-link

Allow for per repo logo and logo-link; Use global logo and logo-link per
default.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoui-shared: silence warning
Bernhard Reutner-Fischer [Thu, 23 Dec 2010 11:47:53 +0000 (12:47 +0100)]
ui-shared: silence warning

warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type
‘size_t’

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'jh/scan-path'
Lars Hjemli [Sat, 19 Feb 2011 13:25:55 +0000 (14:25 +0100)]
Merge branch 'jh/scan-path'

* jh/scan-path:
  scan_path(): Do not recurse into hidden directories by default
  scan_path(): Improve handling of inaccessible directories

13 years agoscan_path(): Do not recurse into hidden directories by default
Johan Herland [Mon, 15 Nov 2010 19:41:00 +0000 (20:41 +0100)]
scan_path(): Do not recurse into hidden directories by default

Paths that start with a period ('.') are considered hidden in the Unix world.
scan_path() should arguably not recurse into these directories by default.
This patch makes it so, and introduces the "scan-hidden-path" config variable
for overriding the new default and revert to the old behaviour (scanning _all_
directories, including hidden .directories).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <larsh@prediktor.no>
13 years agoMakefile: Make `make get-git` work under OpenBSD.
Lukas Fleischer [Wed, 19 Jan 2011 13:05:48 +0000 (14:05 +0100)]
Makefile: Make `make get-git` work under OpenBSD.

OpenBSD tar(1) defaults to read from "/dev/rst0" when not specifying an
filename and thus fails to extract the Git sourcecode when not passing
stdin as input file descriptor explicitly.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'jh/graph'
Lars Hjemli [Sat, 19 Feb 2011 13:01:59 +0000 (14:01 +0100)]
Merge branch 'jh/graph'

* jh/graph:
  ui-log: Move 'Age' column when commit graph is present
  ui-log: Line-wrap long commit subjects when showmsg is enabled
  ui-log: Colorize commit graph
  ui-log: Implement support for commit graphs
  ui-log: Change display of full commit messages (and notes)

Conflicts:
cgit.css

13 years agoMerge branch 'lh/improve-range-search'
Lars Hjemli [Sat, 19 Feb 2011 13:00:56 +0000 (14:00 +0100)]
Merge branch 'lh/improve-range-search'

* lh/improve-range-search:
  html.c: use '+' to escape spaces in urls
  ui-log.c: improve handling of range-search argument
  Add vector utility functions

13 years agoUse GIT-1.7.4
Lars Hjemli [Sat, 19 Feb 2011 12:55:43 +0000 (13:55 +0100)]
Use GIT-1.7.4

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoscan_path(): Improve handling of inaccessible directories
Johan Herland [Mon, 15 Nov 2010 19:40:43 +0000 (20:40 +0100)]
scan_path(): Improve handling of inaccessible directories

When scanning a tree containing inaccessible directories (e.g. '.ssh'
directories in users' homedirs, or repos with explicitly restricted access),
scan_path() currently causes three lines of "Permissions denied" errors to be
printed to the CGI error log per inaccessible directory:

  Error checking path /home/foo/.ssh: Permission denied (13)
  Error checking path /home/foo/.ssh/.git: Permission denied (13)
  Error opening directory /home/foo/.ssh: Permission denied (13)

This is a side-effect of calling is_git_dir(path) and
is_git_dir(fmt("%s/.git", path) _before_ we try to opendir(path).

By placing the opendir(path) before the two is_git_dir() calls, we reduce the
noise to a single line per inaccessible directory:

  Error opening directory /home/foo/.ssh: Permission denied (13)

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <larsh@prediktor.no>
14 years agoui-log: Move 'Age' column when commit graph is present
Johan Herland [Mon, 15 Nov 2010 17:39:53 +0000 (18:39 +0100)]
ui-log: Move 'Age' column when commit graph is present

When the commit graph is present, we prefer to draw it along the left edge,
and moving the 'Age' column to the right of the 'Author' column, like in gitk.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-log: Line-wrap long commit subjects when showmsg is enabled
Johan Herland [Mon, 15 Nov 2010 17:39:52 +0000 (18:39 +0100)]
ui-log: Line-wrap long commit subjects when showmsg is enabled

When showmsg is disabled ui-log truncates long commit subjects. This is good.
However, the same is not desirable when showmsg is enabled, since you then
end up with a truncated commit subject followed by the rest of the commit
message below.

Instead, when showmsg is enabled (and we're using all this space to display
the entire commit message, anyway), line-wrap the commit subject instead of
truncating it.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-log: Colorize commit graph
Johan Herland [Mon, 15 Nov 2010 17:39:51 +0000 (18:39 +0100)]
ui-log: Colorize commit graph

Use the existing coloring logic in Git's graph code to color the lines
between commits in the commit graph.

Whereas Git normally uses ANSI color escapes to produce colors, we here
use graph_set_column_colors() to replace those with HTML color escapes,
that embed the graph lines in <span> tags that apply the desired color
using CSS.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-log: Implement support for commit graphs
Johan Herland [Mon, 15 Nov 2010 17:39:50 +0000 (18:39 +0100)]
ui-log: Implement support for commit graphs

Teach CGit to print an ASCII art commit graph to the left of the commit
message, similar to 'git log --graph'. The graph adds extra lines (table
rows) to the log when needed to add/remove/shuffle edges in the graph.

When 'showmsg' is enabled, the graph is automatically padded to account
for the extra lines added by the commit message/notes.

This feature is controlled by a new config variable: "enable-commit-graph"
(disabled by default), and individual repos can control it by setting
"repo.enable-commit-graph".

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-log: Change display of full commit messages (and notes)
Johan Herland [Mon, 15 Nov 2010 17:39:49 +0000 (18:39 +0100)]
ui-log: Change display of full commit messages (and notes)

When showmsg is enabled, ui-log (in addition to the table row containing
the details of the current commit) adds a second table row containing the
remainder of the commit message, and yet another table row containing the
commit notes (if any). The vertical margins between commit subject, commit
message and commit notes are controlled by CSS.

In preparation for the commit graph (which will be printed to the left of
the commit message/notes) we need to eliminate these vertical margins (as
they would produce ugly gaps in the commit graph) and instead achieve them
by adding newlines to the commit message/notes. Furthermore, we can no
longer print the "Notes:" header in the "Age" column, since the graph will
be drawn between the "Age" column and the "Commit message" column.

This patch therefore prepares the commit message and commit notes in a
single buffer (properly formatting the notes using the NOTES_SHOW_HEADER
and NOTES_INDENT flags to format_note()), and then prints the entire
buffer into a single table row.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-stats: Remove unnecessary #include
Johan Herland [Mon, 15 Nov 2010 17:39:48 +0000 (18:39 +0100)]
ui-stats: Remove unnecessary #include

<string-list.h> is already #included from cgit.h

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'tz/make-improvements'
Lars Hjemli [Tue, 9 Nov 2010 23:28:56 +0000 (00:28 +0100)]
Merge branch 'tz/make-improvements'

14 years agohtml.c: use '+' to escape spaces in urls
Lars Hjemli [Tue, 9 Nov 2010 17:15:21 +0000 (18:15 +0100)]
html.c: use '+' to escape spaces in urls

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-log: Prevent crash when given empty range search
Johan Herland [Thu, 28 Oct 2010 15:05:39 +0000 (17:05 +0200)]
ui-log: Prevent crash when given empty range search

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-log.c: improve handling of range-search argument
Lars Hjemli [Tue, 9 Nov 2010 19:53:36 +0000 (20:53 +0100)]
ui-log.c: improve handling of range-search argument

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoAdd vector utility functions
Lars Hjemli [Tue, 9 Nov 2010 18:57:18 +0000 (19:57 +0100)]
Add vector utility functions

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMakefile: avoid spurious rebuilds of git sources due to `sudo make`
Lars Hjemli [Tue, 9 Nov 2010 17:08:38 +0000 (18:08 +0100)]
Makefile: avoid spurious rebuilds of git sources due to `sudo make`

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-log: Fix filecount/linecount when path limit is in effect
Johan Herland [Thu, 30 Sep 2010 18:15:14 +0000 (20:15 +0200)]
ui-log: Fix filecount/linecount when path limit is in effect

When using ui-log with path limits, the listing of commits enables parent
rewriting in Git's internal log machinery. This did not work well together
with cgit_diff_commit() which is used to generate the filecount and
linecount numbers for each commit in the log view. cgit_diff_commit() would
operate without any path limits, and would therefore process the full diff
between the commits shown (which, because of parent rewriting, is not the
same as processing the diff for the commit itself). Additionally, the bottom
commit in the log view would (again, because of parent rewriting) have zero
parents, causing us to process the entire diff between the empty tree and
that commit. Since path limits were not in effect, this would (in large
projects) reports thousands of files and millions of lines changed in that
bottom commit.

This patch fixes the issue by applying the same path limit to
cgit_diff_commit() as is applied to the rest of the log view. The result is
that the filecount/linecount now only reflects the diff as it pertains to
the given path limit.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoAdd `strict-export` option
Felix Hanley [Mon, 8 Nov 2010 18:41:13 +0000 (19:41 +0100)]
Add `strict-export` option

This option is used to specify a filename which needs to be present in
the repositories found during `scan-path` processing. By setting this
option to 'git-daemon-export-ok', only repositories explicitly marked
for git daemon export will be included in the cgit configuration.

Signed-off-by: Felix Hanley <felix@seconddrawer.com.au>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoFix a typo in README, s/ExecCGI/+ExecCGI
Kamil Kaminski [Mon, 11 Oct 2010 04:58:30 +0000 (23:58 -0500)]
Fix a typo in README, s/ExecCGI/+ExecCGI

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoAppend path and branch to atom feed title
Lars Hjemli [Sat, 25 Sep 2010 13:25:32 +0000 (14:25 +0100)]
Append path and branch to atom feed title

Currently all atom feeds for a repository get the same title but they
are actually unique per path and per branch.

Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoUse committer date for atom feed entry updated element
Chris Mayo [Sat, 25 Sep 2010 12:05:52 +0000 (13:05 +0100)]
Use committer date for atom feed entry updated element

Committer date reflects the most recent change and is used for ordering
the log page (author date is still available in published element of the
feed entry).

Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'stable'
Lars Hjemli [Sun, 7 Nov 2010 15:25:23 +0000 (16:25 +0100)]
Merge branch 'stable'

Conflicts:
scan-tree.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoUse absolute path for scanned repo readme
Dean Scarff [Thu, 26 Aug 2010 07:01:20 +0000 (15:01 +0800)]
Use absolute path for scanned repo readme

repo.readme is transformed to an absolute path when read from the config,
so add_repo needs to add "README.html" with the repository path too.

Signed-off-by: Dean Scarff <dos@scarff.id.au>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMakefile: add -MP option
Lars Hjemli [Sun, 7 Nov 2010 15:13:49 +0000 (16:13 +0100)]
Makefile: add -MP option

Work around errors `make` gives when header files are removed without
the Makefile being updated.

Signed-off-by: Lynn Lin <Lynn.Lin@emc.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'stable'
Lars Hjemli [Mon, 27 Sep 2010 06:03:30 +0000 (08:03 +0200)]
Merge branch 'stable'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoCGIT 0.8.3.4 v0.8.3.4
Lars Hjemli [Mon, 27 Sep 2010 06:00:47 +0000 (08:00 +0200)]
CGIT 0.8.3.4

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoUse GIT-1.7.3
Lars Hjemli [Mon, 27 Sep 2010 05:58:01 +0000 (07:58 +0200)]
Use GIT-1.7.3

This fixes http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-2542.

Noticed-by: Silvio Cesare <silvio.cesare@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'stable'
Lars Hjemli [Sun, 19 Sep 2010 18:58:15 +0000 (20:58 +0200)]
Merge branch 'stable'

14 years agoRSS items should always use UTC times
Aaron Griffin [Wed, 15 Sep 2010 15:16:33 +0000 (10:16 -0500)]
RSS items should always use UTC times

The format uses a 'Z' suffix, which indicates no TZ offset.
Thus we should not respect the local-time config setting here.

Signed-off-by: Aaron Griffin <agriffin@datalogics.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoUse example.com in documentation, per RFC 2606
Todd Zullinger [Mon, 6 Sep 2010 13:31:26 +0000 (09:31 -0400)]
Use example.com in documentation, per RFC 2606

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agocgit.css: Add syntax highlighting entries
Todd Zullinger [Mon, 6 Sep 2010 13:31:25 +0000 (09:31 -0400)]
cgit.css: Add syntax highlighting entries

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoInstall filter scripts
Todd Zullinger [Mon, 6 Sep 2010 13:31:24 +0000 (09:31 -0400)]
Install filter scripts

The syntax-highlighting.sh script is quite useful without any changes.
Installing it by default makes it easier to use and package.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoAdd Makefile targets to install/uninstall docs
Todd Zullinger [Mon, 6 Sep 2010 13:31:23 +0000 (09:31 -0400)]
Add Makefile targets to install/uninstall docs

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoGeneralize doc generation
Todd Zullinger [Mon, 6 Sep 2010 13:31:22 +0000 (09:31 -0400)]
Generalize doc generation

This borrows from the git Documentation/Makefile.  The goal is to make
it easier to add new man pages and other documentation as well as to
prevent make from re-generating the documentation needlessly.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'ml/bugfix'
Lars Hjemli [Sun, 19 Sep 2010 17:00:05 +0000 (19:00 +0200)]
Merge branch 'ml/bugfix'

14 years agoMerge branch 'lh/section-from-path'
Lars Hjemli [Sun, 19 Sep 2010 16:46:17 +0000 (18:46 +0200)]
Merge branch 'lh/section-from-path'

Conflicts:
scan-tree.c

14 years agoMerge branch 'lh/readme'
Lars Hjemli [Sun, 19 Sep 2010 16:43:58 +0000 (18:43 +0200)]
Merge branch 'lh/readme'

14 years agoUse GIT-1.7.3
Lars Hjemli [Sun, 19 Sep 2010 12:00:46 +0000 (14:00 +0200)]
Use GIT-1.7.3

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoprefer html_raw() to write()
Mark Lodato [Sat, 4 Sep 2010 18:18:16 +0000 (14:18 -0400)]
prefer html_raw() to write()

To make the code more consistent, and to not rely on the implementation
of html(), always use html_raw(...) instead of write(htmlfd, ...).

Signed-off-by: Mark Lodato <lodatom@gmail.com>