]> granicus.if.org Git - cgit/log
cgit
14 years agoMerge branch 'stable'
Lars Hjemli [Tue, 13 Jul 2010 19:55:47 +0000 (21:55 +0200)]
Merge branch 'stable'

14 years agoReencode author and committer
Rémi Lagacé [Tue, 13 Jul 2010 17:15:09 +0000 (19:15 +0200)]
Reencode author and committer

When a commit has a specific encoding, this encoding also applies to
the author and committer name and email.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'lh/range-search'
Lars Hjemli [Tue, 22 Jun 2010 14:16:24 +0000 (16:16 +0200)]
Merge branch 'lh/range-search'

14 years agoMerge branch 'jh/context-lines'
Lars Hjemli [Tue, 22 Jun 2010 14:16:12 +0000 (16:16 +0200)]
Merge branch 'jh/context-lines'

Conflicts:
cgit.c
cgit.h

14 years agoMerge branch 'jh/path-limit'
Lars Hjemli [Tue, 22 Jun 2010 14:15:48 +0000 (16:15 +0200)]
Merge branch 'jh/path-limit'

Conflicts:
cgit.h
ui-commit.c

14 years agoui-log.c: allow commit range as search expression
Lars Hjemli [Sat, 19 Jun 2010 12:32:37 +0000 (14:32 +0200)]
ui-log.c: allow commit range as search expression

Inspired-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-diff: Add links to increase/decrease number of context lines in diffs
Johan Herland [Thu, 10 Jun 2010 18:15:51 +0000 (20:15 +0200)]
ui-diff: Add links to increase/decrease number of context lines in diffs

Add two links to the "Diffstat" line to show more/less context lines in the
generated diff.

To support this, cgit_commit_link() and cgit_diff_link() has learned to
preserve the ctx.qry.context variable.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoAdd URL parameter 'context' for changing the number of context lines in diffs
Johan Herland [Thu, 10 Jun 2010 18:15:27 +0000 (20:15 +0200)]
Add URL parameter 'context' for changing the number of context lines in diffs

The new ctx.qry.context variable is picked up by cgit_print_diff(), and
passed via cgit_diff_files() to Git's diff machinery.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared.c: path-limit style nitpick
Lars Hjemli [Sat, 19 Jun 2010 09:35:57 +0000 (11:35 +0200)]
ui-shared.c: path-limit style nitpick

This subjectively makes the path-limit bar less visually intrusive.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoFix style of commit-filter links in commit-subject.
Johan Herland [Fri, 18 Jun 2010 15:56:11 +0000 (17:56 +0200)]
Fix style of commit-filter links in commit-subject.

When using the commit-filter functionality to add e.g. bug tracker links to
commit messages, the style of those links is mangled by a CSS directive that
is meant to only apply to decorations that are listed on the commit-subject
line.

Fix this directive to only apply to the decorations.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'stable'
Lars Hjemli [Sat, 19 Jun 2010 09:52:42 +0000 (11:52 +0200)]
Merge branch 'stable'

14 years agoCGIT 0.8.3.2 v0.8.3.2
Lars Hjemli [Sat, 19 Jun 2010 09:50:58 +0000 (11:50 +0200)]
CGIT 0.8.3.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'ag/atom-fixes'
Lars Hjemli [Sat, 19 Jun 2010 09:42:12 +0000 (11:42 +0200)]
Merge branch 'ag/atom-fixes'

14 years agoMerge branch 'lh/noweb'
Lars Hjemli [Sat, 19 Jun 2010 09:41:32 +0000 (11:41 +0200)]
Merge branch 'lh/noweb'

14 years agoMerge branch 'ml/plain-improvements-part1'
Lars Hjemli [Sat, 19 Jun 2010 09:40:34 +0000 (11:40 +0200)]
Merge branch 'ml/plain-improvements-part1'

14 years agoMerge branch 'sn/subject-link'
Lars Hjemli [Sat, 19 Jun 2010 09:38:46 +0000 (11:38 +0200)]
Merge branch 'sn/subject-link'

14 years agoui-log: Preserve path limit in outgoing links
Johan Herland [Fri, 11 Jun 2010 12:50:47 +0000 (14:50 +0200)]
ui-log: Preserve path limit in outgoing links

This allows navigation through the 'log' page/command without losing the
active path limit.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared: Preserve path limit in "tab bar" links
Johan Herland [Wed, 9 Jun 2010 23:09:36 +0000 (01:09 +0200)]
ui-shared: Preserve path limit in "tab bar" links

When using the "tab bar" in the pageheader to navigate between pages, any
path limit in effect on the current page is forgotten in the link to the
target page, even if the target page can interpret and use the path limit
constructively.

Instead, preserve the current page's path limit in the "tab bar" links to
other pages, where the path limit is useful to the target page.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-commit: Preserve path limit in links to commit page
Johan Herland [Wed, 9 Jun 2010 23:09:35 +0000 (01:09 +0200)]
ui-commit: Preserve path limit in links to commit page

This includes adding a path argument to cgit_commit_link() and updating all
its callers. The callers from within the commit page (i.e. the "commit",
"unidiff"/"side-by-side diff" and "parent" links) all preserve the path
limit of the current commit page. All other callers pass NULL (i.e. no path
limit).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-commit: Preserve path limit in links to tree and diff pages
Johan Herland [Wed, 9 Jun 2010 23:09:34 +0000 (01:09 +0200)]
ui-commit: Preserve path limit in links to tree and diff pages

For tree links, the original link is unchanged, but in the case of a path
limit, a subtree link is added to the right of the original tree link.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-patch: Apply path limit to generated patch
Johan Herland [Wed, 9 Jun 2010 23:09:33 +0000 (01:09 +0200)]
ui-patch: Apply path limit to generated patch

Also indicate in the comment section of the patch that a path limit was
applied, too easily see when a generated patch is only partial.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-commit: Limit diff based on path limit in qry.path
Johan Herland [Wed, 9 Jun 2010 23:09:32 +0000 (01:09 +0200)]
ui-commit: Limit diff based on path limit in qry.path

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-diff: Teach diffstat to obey path limit
Johan Herland [Wed, 9 Jun 2010 23:09:31 +0000 (01:09 +0200)]
ui-diff: Teach diffstat to obey path limit

Also indicate in the diffstat header if a path limit is in effect.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-tree: Remove unnecessary path breadcrumb navigation
Johan Herland [Wed, 9 Jun 2010 23:09:30 +0000 (01:09 +0200)]
ui-tree: Remove unnecessary path breadcrumb navigation

The path breadcrumb navigation at the top of the 'tree' page has now been
duplicated in ui-shared, which leaves the ui-tree implementation unnecessary.

This patch removes the breadcrumb navigation from ui-tree, and moves the
"(plain)" link that followed the breadcrumb when displaying blobs to the
end of the next line, following the blob SHA1.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared: Teach "breadcrumb" navigation to path limit display beneath tab bar
Johan Herland [Wed, 9 Jun 2010 23:09:29 +0000 (01:09 +0200)]
ui-shared: Teach "breadcrumb" navigation to path limit display beneath tab bar

When a path limit is in effect, and displayed directly beneath the tab bar,
it should offer breadcrumb navigation (like what the 'tree' page does), to
allow changing the path limit easily.

Implementing this requires a robust way to link back to the current page with
a changed ctx->qry.path, but without losing track of the other query
arguments. This is solved by adding the new cgit_self_link() function, which
is then invoked repeatedly by the new cgit_print_path_crumbs() function while
manipulating ctx->qry.path.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared: Display path limit directly beneath tab bar in relevant pages
Johan Herland [Wed, 9 Jun 2010 23:09:28 +0000 (01:09 +0200)]
ui-shared: Display path limit directly beneath tab bar in relevant pages

Design-wise, the path is shown by "expanding" the grey border between the
tab bar and the content area of the page to house the current path limit.

This is only displayed on pages where the path limit is relevant, and only
when a path limit is in effect.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared: Replace ctx.qry.path with ctx.qry.vpath
Johan Herland [Wed, 9 Jun 2010 23:09:27 +0000 (01:09 +0200)]
ui-shared: Replace ctx.qry.path with ctx.qry.vpath

In all cases where ui-shared uses ctx.qry.path, it is done so in the context
of a in-project path, and not in the context in which the 'refs' page or the
'clone'-related functionality uses ctx.qry.path. Make this explicit by using
ctx.qry.vpath instead.

This path introduces no fundamental difference in functionality except for
fixing some minor bugs, for example the Atom feed reference from a
"$repo/refs/heads/" page.

Note that the usage of ctx.qry.path in the other ui-<page>.c files is ok,
since that code presumably is only executed in the context of its own <page>,
so the correct interpretation of ctx.qry.path is never in question.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agostruct cgit_cmd: Differentiate between various usages of ctx.qry.path
Johan Herland [Wed, 9 Jun 2010 23:09:26 +0000 (01:09 +0200)]
struct cgit_cmd: Differentiate between various usages of ctx.qry.path

For many commands/pages (e.g. 'tree', 'diff', 'plain', etc.), the
ctx.qry.path argument is interpreted as a path within the "virtual" project
directory structure. However, for some other commands (notably 'refs', and
the clone-related commands) ctx.qry.path is used in a different context (as
a more or less "real" path within the '.git' directory).

This patch differentiates between these two usages of ctx.qry.path, by
introducing a new variable - ctx.qry.vpath - which is equal to ctx.qry.path
in the former case, and NULL in the latter.

This will become useful in future patches when we want various pages and the
links between them to preserve existing in-project paths.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared: Remove needless cgit_get_cmd() call, and refactor hc() accordingly
Johan Herland [Wed, 9 Jun 2010 23:09:25 +0000 (01:09 +0200)]
ui-shared: Remove needless cgit_get_cmd() call, and refactor hc() accordingly

The call to cgit_get_cmd() and the following fallback handling (to "summary"
or "repoindex") in cgit_print_pageheader() is unnecessary, since the same
fallback handling was already done when ctx.qry.page was set when
cgit_get_cmd() was called from process_request() in cgit.c.

As such, hc() can also be rewritten to simply compare the given 'page' string
against ctx.qry.page.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared: Improve const-ness in API
Johan Herland [Wed, 9 Jun 2010 23:09:24 +0000 (01:09 +0200)]
ui-shared: Improve const-ness in API

This is needed to prevent const-related warnings in later patches.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoRemove unused variable in shared.c
Johan Herland [Wed, 9 Jun 2010 23:09:23 +0000 (01:09 +0200)]
Remove unused variable in shared.c

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoFix small typo in cgitrc example
Johan Herland [Wed, 9 Jun 2010 23:09:22 +0000 (01:09 +0200)]
Fix small typo in cgitrc example

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'stable'
Lars Hjemli [Wed, 7 Apr 2010 22:50:20 +0000 (00:50 +0200)]
Merge branch 'stable'

14 years agoshared.c: avoid memory leak during diff
Lars Hjemli [Wed, 7 Apr 2010 22:48:36 +0000 (00:48 +0200)]
shared.c: avoid memory leak during diff

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoAdd 'max-atom-items' config variable
Aaron Griffin [Fri, 5 Feb 2010 00:08:16 +0000 (18:08 -0600)]
Add 'max-atom-items' config variable

This allows one to specify the items in the RSS feeds

Signed-off-by: Aaron Griffin <agriffin@datalogics.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoAdd all=1 query param for atom feeds
Aaron Griffin [Thu, 4 Feb 2010 00:31:17 +0000 (18:31 -0600)]
Add all=1 query param for atom feeds

Displays all items from all branches in one feed

Signed-off-by: Aaron Griffin <agriffin@datalogics.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-tree: add link to plain view for blobs in tree listing
Lars Hjemli [Sun, 28 Feb 2010 21:18:00 +0000 (22:18 +0100)]
ui-tree: add link to plain view for blobs in tree listing

Suggested-by: Robert Weidlich <mail@robertweidlich.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoscan-tree: add test for noweb-file in repo dir
Lars Hjemli [Sun, 28 Feb 2010 17:40:02 +0000 (18:40 +0100)]
scan-tree: add test for noweb-file in repo dir

If such a file exists, the repo is not added to the repolist.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoUse GIT-1.7.0
Lars Hjemli [Sat, 27 Feb 2010 12:39:53 +0000 (13:39 +0100)]
Use GIT-1.7.0

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'html-updates' of git://github.com/MarkLodato/cgit
Lars Hjemli [Sat, 27 Feb 2010 12:20:27 +0000 (13:20 +0100)]
Merge branch 'html-updates' of git://github.com/MarkLodato/cgit

14 years agoOptionally generate verbose parent links
Lars Hjemli [Sat, 27 Feb 2010 12:12:55 +0000 (13:12 +0100)]
Optionally generate verbose parent links

The new option 'enable-subject-links' must be used to enable the verbose
parent-links in commit view.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agodisplay subject instead of sha1 as link title of parents
Stefan Naewe [Mon, 15 Feb 2010 08:57:50 +0000 (09:57 +0100)]
display subject instead of sha1 as link title of parents

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoMerge branch 'stable'
Lars Hjemli [Sat, 27 Feb 2010 11:53:27 +0000 (12:53 +0100)]
Merge branch 'stable'

14 years agoClear the whole context
Daniel Milde [Sun, 21 Feb 2010 13:38:59 +0000 (14:38 +0100)]
Clear the whole context

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agoui-shared.c: fix segfault when repo is empty
Florian Pritz [Mon, 1 Feb 2010 16:55:37 +0000 (17:55 +0100)]
ui-shared.c: fix segfault when repo is empty

PATH_INFO="/$REPONAME/commit/?id=1" QUERY_STRING="id=1" ./cgit.cgi
triggers segfault when the repository is empty and therefore
ctx.qry.head is unset

Signed-off-by: Florian Pritz <bluewind@xssn.at>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
14 years agohtml: properly percent-escape URLs
Mark Lodato [Tue, 9 Feb 2010 15:12:43 +0000 (10:12 -0500)]
html: properly percent-escape URLs

The only valid characters for a URL are unreserved characters
a-zA-Z0-9_-.~ and the reserved characters !*'();:@&=+$,/?%#[] , as per
RFC 3986.  Everything else must be escaped.  Additionally, the # and
? always have special meaning, and the &, =, and + have special meaning
in a query string, so they too must be escaped.  To make this easier,
a table of escapes is now used so that we do not have to call fmt() for
each character; if the entry is 0, no escaping is needed.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agohtml: make all strings 'const char *'
Mark Lodato [Tue, 9 Feb 2010 04:04:41 +0000 (23:04 -0500)]
html: make all strings 'const char *'

None of the html_* functions modify their argument, so they can all be
'const char *' instead of a simple 'char *'.  This removes the need to
cast (or copy) when trying to print a const string.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agoui-plain: print directory listings
Mark Lodato [Sun, 31 Jan 2010 19:25:03 +0000 (14:25 -0500)]
ui-plain: print directory listings

When a user requests a plain view of a tree (as opposed to a blob),
print out a directory listing rather than giving a 404 Not Found.

Also, fix a segfault when ctx->qry.path is NULL - i.e, when /plain is
requested without a path.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agoui-plain: more efficient walk_tree()
Mark Lodato [Sun, 31 Jan 2010 06:07:41 +0000 (01:07 -0500)]
ui-plain: more efficient walk_tree()

Git's read_tree_recursive() already filters out the objects by pathname,
so we only have to compare baselen to the expected.  That is, no string
matching is required.

Additionally, if the requested path is a directory, the old code would
walk through all of its immediate children.  This is not necessary, this
so we no longer do that.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
14 years agoui-plain: remove unused curr_rev variable
Mark Lodato [Sun, 31 Jan 2010 04:54:16 +0000 (23:54 -0500)]
ui-plain: remove unused curr_rev variable

Signed-off-by: Mark Lodato <lodatom@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Sat, 12 Dec 2009 11:09:47 +0000 (12:09 +0100)]
Merge branch 'stable'

15 years agoCGIT 0.8.3.1 v0.8.3.1
Lars Hjemli [Sat, 12 Dec 2009 11:08:14 +0000 (12:08 +0100)]
CGIT 0.8.3.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFix segfault on ppc when browsing tree
Martins Polakovs [Thu, 10 Dec 2009 15:35:42 +0000 (17:34 +0159)]
Fix segfault on ppc when browsing tree

15 years agoAdd .tar.xz-snapshot support
Andreas Wiese [Tue, 8 Dec 2009 21:18:11 +0000 (22:18 +0100)]
Add .tar.xz-snapshot support

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/remote-branches'
Lars Hjemli [Tue, 8 Dec 2009 18:34:30 +0000 (19:34 +0100)]
Merge branch 'lh/remote-branches'

15 years agoMerge branch 'ro/ssdiff'
Lars Hjemli [Tue, 8 Dec 2009 18:32:48 +0000 (19:32 +0100)]
Merge branch 'ro/ssdiff'

15 years agoMerge branch 'master' of http://op-co.de/cgit
Lars Hjemli [Tue, 8 Dec 2009 17:31:07 +0000 (18:31 +0100)]
Merge branch 'master' of http://op-co.de/cgit

15 years agoMerge branch 'stable'
Lars Hjemli [Tue, 8 Dec 2009 17:30:02 +0000 (18:30 +0100)]
Merge branch 'stable'

15 years agoDon't crash when a repo-specific readme file is used
Sami Kyöstilä [Tue, 8 Dec 2009 17:18:10 +0000 (18:18 +0100)]
Don't crash when a repo-specific readme file is used

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years ago"max-blob-size" config var to limit generated HTML size
Georg Lukas [Sat, 28 Nov 2009 02:44:33 +0000 (03:44 +0100)]
"max-blob-size" config var to limit generated HTML size

Sometimes it is not feasible to generate the HTML pretty-print for large
files, especially if a source-filter is involved or binary data is to be
displayed. The "max-blob-size" config var allows to disable HTML output
for blobs bigger than X KBytes. Plain downloads are not affected.

Signed-off-by: Georg Lukas <georg@op-co.de>
15 years agocgit.css: highlight directories in tree
Georg Lukas [Sat, 28 Nov 2009 02:07:34 +0000 (03:07 +0100)]
cgit.css: highlight directories in tree

15 years agosyntax highlighting for all formats supported by "highlight"
Georg Lukas [Thu, 19 Nov 2009 11:14:45 +0000 (12:14 +0100)]
syntax highlighting for all formats supported by "highlight"

The highlight tool can be given any of the supported file extensions
as its -S parameter. This patch replaces the case-switch by extracting
the extension from the supplied file name and passing it to highlight.
However, this requires a shell supporting the ${var##pattern} syntax,
like dash or bash.

Unknown extensions cause a fall-back to plain text using the --force
switch. Error messages are redirected to /dev/null.

A special case maps Makefile and Makefile.* to the "mk" extension.

The total overhead is reduced by calling "exec highlight". No forks are
needed during script execution.

Signed-off-by: Georg Lukas <georg@op-co.de>
15 years agoAdd support for remote branches
Lars Hjemli [Sat, 7 Nov 2009 18:10:58 +0000 (19:10 +0100)]
Add support for remote branches

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Sat, 7 Nov 2009 17:16:50 +0000 (18:16 +0100)]
Merge branch 'stable'

15 years agoshared.c: return original errno
Lars Hjemli [Sat, 7 Nov 2009 17:08:30 +0000 (18:08 +0100)]
shared.c: return original errno

Noticed-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd NO_OPENSSL option
Mikhail Gusarov [Wed, 28 Oct 2009 21:39:55 +0000 (03:39 +0600)]
Add NO_OPENSSL option

Linking with OpenSSL is not always desirable. Add NO_OPENSSL option
to use SHA-1 code bundled with Git.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
15 years agoIn side-by-side diff, add support for marking individual characters.
Ragnar Ouchterlony [Sun, 25 Oct 2009 17:13:22 +0000 (18:13 +0100)]
In side-by-side diff, add support for marking individual characters.

Refuses to do so if the left hand side of the diff has different amount of
differing lines to the right hand side to avoid confusion.

Note that I use the naive dynamic programming approach for calculating the
longest common subsequence. We could probably be more efficient by using a
better algorithm. The LCS calculating function is O(n*m) and uses up n*m
amount of memory too (so if we we compare two strings of length 100, I use
an array of 10000 for calculating the LCS). Might want to not calculate LCS
if the length of the line is too large.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
15 years agoMerge branch 'stable'
Lars Hjemli [Sat, 7 Nov 2009 14:35:36 +0000 (15:35 +0100)]
Merge branch 'stable'

15 years agoClose fd on error in readfile()
Rys Sommefeldt [Sat, 7 Nov 2009 14:24:45 +0000 (15:24 +0100)]
Close fd on error in readfile()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoNov is the correct abbreviation
Danijel Tašov [Mon, 2 Nov 2009 21:10:04 +0000 (22:10 +0100)]
Nov is the correct abbreviation

15 years agoui-shared.c: prettify download links when generated from tag page
Lars Hjemli [Fri, 16 Oct 2009 00:03:32 +0000 (02:03 +0200)]
ui-shared.c: prettify download links when generated from tag page

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tag: make output more similar to commit view
Lars Hjemli [Tue, 6 Oct 2009 18:33:04 +0000 (20:33 +0200)]
ui-tag: make output more similar to commit view

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tag: add snapshot links
Alexey Nezhdanov [Sun, 27 Sep 2009 19:00:29 +0000 (23:00 +0400)]
ui-tag: add snapshot links

Signed-off-by: Alexey Nezhdanov <snakeru@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoSkip leading "/" in url querystring value
Stefan Bühler [Mon, 14 Sep 2009 21:37:13 +0000 (21:37 +0000)]
Skip leading "/" in url querystring value

Makes it easier to rewrite :)
lighttpd-sandbox: rewrite "/cgit.cgi?url=%{enc:request.path}&%{request.query}";

Signed-off-by: Stefan Bühler <source@stbuehler.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFix repolist search links with virtual root
Geoff Johnstone [Sun, 20 Sep 2009 10:32:07 +0000 (11:32 +0100)]
Fix repolist search links with virtual root

Signed-off-by: Geoff Johnstone <geoff.johnstone@googlemail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFixed side-by-side diff bugs related to binary diff and more.
Ragnar Ouchterlony [Wed, 16 Sep 2009 16:56:26 +0000 (18:56 +0200)]
Fixed side-by-side diff bugs related to binary diff and more.

The fixed bugs:

 * "Binary files differ" did not show up either in unidiff or
   side-by-side-diff.
 * Subproject diffs did not work for side-by-side diffs.
 * The ssdiff link on diff pages did not conserve the path.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoPolishing of how the side-by-side diff looks.
Ragnar Ouchterlony [Tue, 15 Sep 2009 17:44:37 +0000 (19:44 +0200)]
Polishing of how the side-by-side diff looks.

Aligned all different files, so that all side-by-side tables look
the same. Also made sure that the tables take up the whole browser
width.

Also various changes to the css to make things easier on the eye.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd possibility to switch between unidiff and side-by-side-diff.
Ragnar Ouchterlony [Mon, 14 Sep 2009 18:19:02 +0000 (20:19 +0200)]
Add possibility to switch between unidiff and side-by-side-diff.

A new config option side-by-side-diffs added, defaulting to 0,
meaning unidiff. Also a query option (ss) is used toggle this.

In the commit page you can switch between the two diff formats by
clicking on the link on the "commit"-row, to the right of (patch).

In the diff page you can switch by using the link at the start
of the page.

All commit-links and diff-links will remember the choice.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoFirst version of side-by-side diff.
Ragnar Ouchterlony [Sun, 13 Sep 2009 17:36:35 +0000 (19:36 +0200)]
First version of side-by-side diff.

This constitutes the first prototype of a side-by-side diff. It is not
possible to switch between unidiff and side-by-side diff at all at this
stage.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: Change repo.group to section in example config.
Loui Chang [Mon, 14 Sep 2009 05:21:11 +0000 (01:21 -0400)]
cgitrc.5.txt: Change repo.group to section in example config.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: Add mansource and manmanual.
Loui Chang [Mon, 14 Sep 2009 05:21:10 +0000 (01:21 -0400)]
cgitrc.5.txt: Add mansource and manmanual.

This prevents FIXMEs from appearing.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoCGIT 0.8.3 v0.8.3
Lars Hjemli [Sun, 13 Sep 2009 20:17:02 +0000 (22:17 +0200)]
CGIT 0.8.3

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Sun, 13 Sep 2009 20:15:38 +0000 (22:15 +0200)]
Merge branch 'stable'

15 years agoCGIT 0.8.2.2 v0.8.2.2
Lars Hjemli [Sun, 13 Sep 2009 20:14:12 +0000 (22:14 +0200)]
CGIT 0.8.2.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/repo-scan'
Lars Hjemli [Sun, 13 Sep 2009 20:02:07 +0000 (22:02 +0200)]
Merge branch 'lh/repo-scan'

15 years agoMerge branch 'fp/linenumbers'
Lars Hjemli [Sun, 13 Sep 2009 20:01:52 +0000 (22:01 +0200)]
Merge branch 'fp/linenumbers'

15 years agoUse GIT-1.6.4.3
Lars Hjemli [Sun, 13 Sep 2009 19:56:45 +0000 (21:56 +0200)]
Use GIT-1.6.4.3

Signed-off-by: Lars Hjemli <larsh@slackbox.hjemli.net>
15 years agoMerge branch 'stable'
Lars Hjemli [Sun, 6 Sep 2009 17:33:27 +0000 (19:33 +0200)]
Merge branch 'stable'

15 years agoui-plain.c: only return the blob with the specified path
Lars Hjemli [Sun, 6 Sep 2009 17:33:10 +0000 (19:33 +0200)]
ui-plain.c: only return the blob with the specified path

When a path to a directory was specified for the 'plain'
view, each blob in the directory used to be returned to
the client. This patch fixes the issue by matching the
path of each blob against the requested path.

Noticed-by: Lars Stoltenow <penma@penma.de>
Signed-off-by: Lars Hjemli <larsh@slackbox.hjemli.net>
15 years agocgit.c: respect repo-local 'snapshots' option for --scan-path
Lars Hjemli [Mon, 24 Aug 2009 11:31:49 +0000 (13:31 +0200)]
cgit.c: respect repo-local 'snapshots' option for --scan-path

The repo-specific 'snapshots' option is bitwise AND'ed with the global
'snapshots' option during parsing, and since the global cgitrc hasn't
been parsed when --scan-path is processed the global 'snapshots' will
always be 0 (i.e. no repo-specific 'snapshots' setting will have any
effect).

This patch fixes the issue by setting the global 'snapshots' mask to
0xFF (hence relying on later parsing of the generated cgitrc repolist
to do the right thing).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: only print first line of repo.desc in print_repo()
Lars Hjemli [Mon, 24 Aug 2009 11:27:15 +0000 (13:27 +0200)]
cgit.c: only print first line of repo.desc in print_repo()

Since repo.desc might have been populated by reading the 'description'
file in GIT_DIR, it may contain newlines. And by printing the literal
value, we may then generate an invalid cgitrc include-file.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd and use cgit_find_stats_periodname() in print_repo()
Lars Hjemli [Mon, 24 Aug 2009 09:02:48 +0000 (11:02 +0200)]
Add and use cgit_find_stats_periodname() in print_repo()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: generate repo.snapshots in print_repo()
Lars Hjemli [Mon, 24 Aug 2009 08:55:01 +0000 (10:55 +0200)]
cgit.c: generate repo.snapshots in print_repo()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: add missing options to print_repo()
Lars Hjemli [Mon, 24 Aug 2009 08:22:21 +0000 (10:22 +0200)]
cgit.c: add missing options to print_repo()

Note: print_repo() still ignores repo.max-stats and repo.snapshots,
which both requires additional work since these settings are represented
internally as an enum and a bitmap.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoshared.c: initialize cgit_repo structs properly
Lars Hjemli [Mon, 24 Aug 2009 08:14:02 +0000 (10:14 +0200)]
shared.c: initialize cgit_repo structs properly

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd config option 'enable-filter-overrides'
Lars Hjemli [Mon, 24 Aug 2009 06:53:21 +0000 (08:53 +0200)]
Add config option 'enable-filter-overrides'

This option must be enabled if repo-specific cgitrc files should be
allowed to override any of the 'filter' options.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgitrc.5.txt: fix markup errors
Lars Hjemli [Mon, 24 Aug 2009 05:51:48 +0000 (07:51 +0200)]
cgitrc.5.txt: fix markup errors

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-repolist: handle empty sections similar to NULL sections
Lars Hjemli [Mon, 24 Aug 2009 05:42:03 +0000 (07:42 +0200)]
ui-repolist: handle empty sections similar to NULL sections

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for repo-local cgitrc file
Lars Hjemli [Sun, 23 Aug 2009 22:04:58 +0000 (00:04 +0200)]
Add support for repo-local cgitrc file

When recursively scanning a directory tree looking for git repositories,
cgit will now parse cgitrc files found within such repositories.

The repo-specific config files can include any repo-specific options
except 'repo.url' and 'repo.path'. Also, in such config files the 'repo.'
prefix can not be used, i.e. the valid options then becomes:
* name
* clone-url
* desc
* ower
* defbranch
* snapshots
* enable-log-filecount
* enable-log-linecount
* max-stats
* module-link
* section
* about-filter
* commit-filter
* source-filter
* readme

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: refactor repo_config() from config_cb()
Lars Hjemli [Sun, 23 Aug 2009 21:23:20 +0000 (23:23 +0200)]
cgit.c: refactor repo_config() from config_cb()

The new function repo_config() is used to handle all 'simple' repo
options, for the following reasons:
* code readability
* parser performance
* upcoming support for repo-local cgitrc files during scanning

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