]> granicus.if.org Git - cgit/log
cgit
12 years agocss: prefix all styles with div#cgit
Ferry Huberts [Sun, 18 Mar 2012 10:44:03 +0000 (11:44 +0100)]
css: prefix all styles with div#cgit

to facilitate easier embedding

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
12 years agoMerge branch 'stable'
Lars Hjemli [Sun, 18 Mar 2012 10:19:59 +0000 (10:19 +0000)]
Merge branch 'stable'

12 years agoCGIT-0.9.0.3 v0.9.0.3
Lars Hjemli [Sun, 18 Mar 2012 10:16:27 +0000 (10:16 +0000)]
CGIT-0.9.0.3

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
12 years agoMerge branch 'stable'
Lars Hjemli [Sun, 18 Mar 2012 10:10:10 +0000 (10:10 +0000)]
Merge branch 'stable'

12 years agosegfault fix on some bogus requests
Eric Wong [Wed, 4 Jan 2012 09:01:51 +0000 (09:01 +0000)]
segfault fix on some bogus requests

ctx.qry.head can be NULL in some cases due to bad requests
by weird bots.  I managed to reproduce with:

   PATH_INFO=/repo.git/shop.php QUERY_STRING=id=

Signed-off-by: Eric Wong <normalperson@yhbt.net>
12 years agouse correct type for sizeof
Jamie Couture [Thu, 12 Jan 2012 03:38:49 +0000 (22:38 -0500)]
use correct type for sizeof

**L would have worked well too.  Depending on the distribution sizeof *L
may return 8 instead of 4. **L is preferable, but since we don't expect
this datatype to change very often, sizeof int is less subtle and easier
to understand.

Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
12 years agoui-ssdiff.c: correct length check for LCS table
Eric Wong [Wed, 4 Jan 2012 08:59:15 +0000 (08:59 +0000)]
ui-ssdiff.c: correct length check for LCS table

Each individual string may be too long for its respective
dimension of the LCS table.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
13 years agoMerge branch 'stable'
Lars Hjemli [Tue, 3 Jan 2012 21:19:29 +0000 (21:19 +0000)]
Merge branch 'stable'

13 years agoFix segmentation fault in empty repository
John Keeping [Thu, 24 Nov 2011 11:54:47 +0000 (11:54 +0000)]
Fix segmentation fault in empty repository

When a repository is empty, the ATOM feed link is written in the header,
but this involves formatting ctx->qry.head which is NULL in this case.
With glibc, vsnprintf formats "%s" with a NULL input as "(null)" but on
Solaris this results in a segmentation fault.  Since we don't have a
meaningful head for the atom feed in an empty repository, it's simplest
not to write out the link element at all.

Signed-off-by: John Keeping <john@metanate.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Tue, 3 Jan 2012 16:48:22 +0000 (16:48 +0000)]
Merge branch 'stable'

13 years agoMakefile: fetch git tarballs from http://hjemli.net/git/git/
Lars Hjemli [Tue, 3 Jan 2012 16:43:33 +0000 (16:43 +0000)]
Makefile: fetch git tarballs from http://hjemli.net/git/git/

The git tarballs are currently not available from kernel.org, so for now
the makefile will download autogenerated tarballs from cgit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agofix css color value and vertical-align value
Norberto Lopes [Wed, 23 Nov 2011 01:59:26 +0000 (17:59 -0800)]
fix css color value and vertical-align value

13 years agoui-ssdiff.c: set correct diffmode in "control panel"
Tim Chen [Tue, 3 Jan 2012 16:09:59 +0000 (16:09 +0000)]
ui-ssdiff.c: set correct diffmode in "control panel"

When side-by-side-diffs=1 was set in cgitrc, specifying 'ss=0' in the
querystring would not set the 'unified' option as active in the dropdown
box used to select diffmode.

13 years agoMerge branch 'stable'
Lars Hjemli [Tue, 3 Jan 2012 16:06:58 +0000 (16:06 +0000)]
Merge branch 'stable'

13 years agoFix diff mode switching when side-by-side-diffs=1
Tim Chen [Tue, 3 Jan 2012 16:02:14 +0000 (16:02 +0000)]
Fix diff mode switching when side-by-side-diffs=1

When side-by-side-diffs=1 was set in cgitrc, specyfing 'ss=0' in the query-
string would not switch to unified diffs. This patch fixes the issue by
introducing a separate variable to track the occurrence of "ss" in the
querystring.

13 years agoui-log.c: do not show remote heads if enable-remote-branches=0
Georg Müller [Tue, 3 Jan 2012 15:30:50 +0000 (15:30 +0000)]
ui-log.c: do not show remote heads if enable-remote-branches=0

If remote branches are not enabled, the branches are still listed in
the log view. This patch removes them if enable-remote-branches=0.

13 years agoAdd sort parameter to pager of repo list
Tobias Grimm [Sun, 31 Jul 2011 00:44:05 +0000 (02:44 +0200)]
Add sort parameter to pager of repo list

When the repolist is paged, the page-links are missing the sort parameter,
causing the initial page to be custom sorted, but any clicked page will
then be with the default sort order again.

13 years agoui-ssdiff: move LCS table away from the stack
Jamie Couture [Sat, 17 Sep 2011 22:25:01 +0000 (18:25 -0400)]
ui-ssdiff: move LCS table away from the stack

Printing deferred line changes for files containing long lines would
cause a segfault.

- limit LCS table size: 128x128.
- move LCS table to global context: avoid allocating/freeing memory
  for every deferred line change.

Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
13 years agoshared.c: Only setenv() if value is non-null
Lukas Fleischer [Wed, 14 Sep 2011 09:52:43 +0000 (11:52 +0200)]
shared.c: Only setenv() if value is non-null

Some setenv() implementations (e.g. the one in OpenBSD's stdlib)
segfault if we pass a NULL value. Only set environment variables if the
corresponding settings are defined to avoid this.

Note that this is a minor behaviour change as environment variables were
supposed to be set to an empty string if a setting was undefined. Given
that this feature isn't part of any official release yet, there's no
need to worry about backwards compatibility, really. Change the
documentation accordingly.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
13 years agoshared.c: Remove unused "linux/limits.h" include
Lukas Fleischer [Fri, 22 Jul 2011 15:15:49 +0000 (17:15 +0200)]
shared.c: Remove unused "linux/limits.h" include

This isn't used anywhere and prevents the code from being compiled on
other platforms, such as *BSD.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
13 years agoMerge branch 'stable'
Lars Hjemli [Fri, 22 Jul 2011 12:22:17 +0000 (12:22 +0000)]
Merge branch 'stable'

13 years agoFix potential XSS vulnerability in rename hint
Lukas Fleischer [Fri, 22 Jul 2011 11:47:19 +0000 (13:47 +0200)]
Fix potential XSS vulnerability in rename hint

The file name displayed in the rename hint should be escaped to avoid
XSS. Note that this vulnerability is only applicable when an attacker
has gained push access to the repository.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoRemove dead initialization in cgit_parse_commit()
Lukas Fleischer [Thu, 21 Jul 2011 21:04:53 +0000 (23:04 +0200)]
Remove dead initialization in cgit_parse_commit()

The value stored to "t" during its initialization gets overwritten in
any case, so just leave it uninitialized. Spotted by clang-analyzer.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Thu, 21 Jul 2011 14:27:03 +0000 (14:27 +0000)]
Merge branch 'stable'

13 years agoCGIT 0.9.0.2 v0.9.0.2
Lars Hjemli [Thu, 21 Jul 2011 14:23:50 +0000 (14:23 +0000)]
CGIT 0.9.0.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agohtml.c: avoid out-of-bounds access for url_escape_table
Eric Wong [Thu, 21 Jul 2011 03:24:54 +0000 (03:24 +0000)]
html.c: avoid out-of-bounds access for url_escape_table

This fixes a segfault for me with with -O2 optimization on x86
with gcc (Debian 4.4.5-8) 4.4.5

I can reliably reproduce it with the following parameters
when pointed to the git.git repository:

PATH_INFO='/git-core.git/diff/'
QUERY_STRING='id=2b93bfac0f5bcabbf60f174f4e7bfa9e318e64d5&id2=d6da71a9d16b8cf27f9d8f90692d3625c849cbc8'

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Thu, 21 Jul 2011 12:50:07 +0000 (12:50 +0000)]
Merge branch 'stable'

13 years agotests: fix failures when CDPATH is set
Ferry Huberts [Thu, 21 Jul 2011 12:43:54 +0000 (14:43 +0200)]
tests: fix failures when CDPATH is set

Some tests would otherwise fail because commands such as
  cd trash/repos/foo && git rev-list --reverse HEAD | head -1
would return 2 lines instead of 1: the 'cd' command also
prints the path when CDPATH is set.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMakefile: fix oversight of not using $(DESTDIR) in uninstall
Ferry Huberts [Mon, 18 Jul 2011 10:45:56 +0000 (12:45 +0200)]
Makefile: fix oversight of not using $(DESTDIR) in uninstall

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agocommit-links.sh: improve regular expressions
Ferry Huberts [Mon, 18 Jul 2011 10:45:20 +0000 (12:45 +0200)]
commit-links.sh: improve regular expressions

The default length for sha1 abbreviations in git is 7.

A '#num' at the beginning of the commit message is now
recognised, a ':#num' as well, etc.: a '#num' anywhere
is now converted to a link.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Sat, 18 Jun 2011 12:59:51 +0000 (14:59 +0200)]
Merge branch 'stable'

13 years agocgit.c: improve error message when git repo cannot be accessed
Lars Hjemli [Sat, 18 Jun 2011 12:32:43 +0000 (14:32 +0200)]
cgit.c: improve error message when git repo cannot be accessed

The current 'Not a git repository' error message is not very helpful,
since it doesn't state the cause of the problem.

This patch uses errno to provide a hint of the underlying problem. It
would have been even better to give the exact cause (e.g. for ENOENT it
would be nice to know which file/directory is missing), but that would
require reimplementing setup_git_directory_gently() which seems a bit
overkill.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'stable'
Lars Hjemli [Wed, 15 Jun 2011 08:40:00 +0000 (10:40 +0200)]
Merge branch 'stable'

13 years agocgitrc.5.txt: document repo.module-link
Lars Hjemli [Wed, 15 Jun 2011 07:58:42 +0000 (09:58 +0200)]
cgitrc.5.txt: document repo.module-link

The global module-link option can be overridden per repo, but this has
never been documented.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agoMerge branch 'lh/clone-url'
Lars Hjemli [Mon, 13 Jun 2011 23:05:10 +0000 (23:05 +0000)]
Merge branch 'lh/clone-url'

13 years agocgit.c: add 'clone-url' setting with support for macro expansion
Lars Hjemli [Mon, 6 Jun 2011 20:49:13 +0000 (20:49 +0000)]
cgit.c: add 'clone-url' setting with support for macro expansion

The current 'clone-prefix' setting has some known issues:
* All repos get the same 'clone-prefix' value since the setting is not
  adopted during repo registration (in cgitrc, or during scan-path traversal),
  but only when the setting is used.
* The generated clone-urls for a repo is a combination of 'clone-prefix', a
  slash and the repo url. This doesn't work well with e.g. ssh-style urls
  like 'git@example.org:repo.git', since the inserted slash will make the
  repo relative to the filesystem root.
* If 'remove-suffix' is enabled, the generated clone-urls will not work for
  cloning (except for http-urls to cgit itself) since they miss the '.git'
  suffix.

The new 'clone-url' setting is designed to avoid the mentioned issues:
* Each repo adopts the default 'clone-url' when the repo is defined. This
  allows different groups of repos to adopt different values.
* The clone-urls for a repo is generated by expanding environment variables
  in a string template without inserting arbitrary characters, hence any
  kind of clone-url can be generated.
* Macro expansion also eases the 'remove-suffix' pain since it's now
  possible to define e.g. 'clone-url=git://foo.org/$CGIT_REPO_URL.git' for
  a set of repos. A furter improvement would be to define e.g.
  $CGIT_REPO_SUFFIX to '.git' for all repos which had their url prettified,
  or to store the original $CGIT_REPO_URL in e.g. $CGIT_REPO_REAL_URL before
  suffix removal.

Reviewed-by: Ferry Huberts <mailings@hupie.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agocgit.c: always setup cgit repo environment variables
Lars Hjemli [Mon, 6 Jun 2011 19:29:58 +0000 (19:29 +0000)]
cgit.c: always setup cgit repo environment variables

When cgit learned to setup environment variables for certain repo
settings before invoking a filter process, the setup occurred inside
cgit_open_filter().

This patch moves the setup out of cgit_open_filter() and into
prepare_repo_cmd() to prepare for additional uses of these variables.

Reviewed-by: Ferry Huberts <mailings@hupie.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 years agocgitrc.5.txt: reformat the "FILTER API" section
Lars Hjemli [Mon, 13 Jun 2011 22:34:13 +0000 (22:34 +0000)]
cgitrc.5.txt: reformat the "FILTER API" section

This patch makes the generated man-page for the filer api section more
similar to the other sections. Also, the bulleted list of environment
variables wasn't rendered correctly (with asciidoc 8.5.2), without an
empty line before the first item.

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

Conflicts:
cgitrc.5.txt

13 years agocgitrc.5.txt: describe macro expansion of cgitrc options
Lars Hjemli [Mon, 13 Jun 2011 21:58:39 +0000 (21:58 +0000)]
cgitrc.5.txt: describe macro expansion of cgitrc options

This is a new feature in cgit-0.9 which was formerly undocumented.

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

13 years agoREADME: update some stale information/add some new
Lars Hjemli [Mon, 13 Jun 2011 13:24:46 +0000 (13:24 +0000)]
README: update some stale information/add some new

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
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>