]> granicus.if.org Git - cgit/log
cgit
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 agotruncate buffer before reading empty files
Simon Arlott [Sat, 7 Mar 2009 00:06:24 +0000 (00:06 +0000)]
truncate buffer before reading empty files

If readfile() reads an empty file, fgets() won't truncate the buffer
and it'll still contain the contents of the previously read file.

[lh: fixed similar issue in ui-repolist.c]

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-shared: don't print header <img/> if there isn't a logo defined
Matthew Metnetsky [Tue, 30 Jun 2009 01:27:51 +0000 (21:27 -0400)]
ui-shared: don't print header <img/> if there isn't a logo defined

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.c: do not segfault on unexpected query-string format
Lars Hjemli [Mon, 17 Aug 2009 07:05:13 +0000 (09:05 +0200)]
cgit.c: do not segfault on unexpected query-string format

The querystring_cb() function will be invoked with a NULL value when
the querystring contains a name not followed by a '='. Such a value
used to cause a segfault, which this patch fixes.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tag.c: do not segfault when id is missing from query-string
Lars Hjemli [Mon, 17 Aug 2009 07:19:05 +0000 (09:19 +0200)]
ui-tag.c: do not segfault when id is missing from query-string

The purpose of the tag page is to print info about a specific tag,
but if no tag was specified on the query-string cgit used to segfault.

With this patch, cgit will fallback to the value of the 'h' parameter
instead (which is never NULL due to prepare_repo_cmd() in cgit.c).

It will now also verify that the specified tagname is in fact a valid
ref in the 'refs/tags/' namespace, i.e. specifying 'id=master' will
trigger a 'Bad tag reference' error.

Noticed-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoCGIT 0.8.2.1 v0.8.2.1
Lars Hjemli [Sun, 15 Mar 2009 08:31:05 +0000 (09:31 +0100)]
CGIT 0.8.2.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-snapshot: avoid segfault when no filename is specified
Lars Hjemli [Sun, 15 Mar 2009 07:57:33 +0000 (08:57 +0100)]
ui-snapshot: avoid segfault when no filename is specified

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agofix segfault when displaying empty blobs
Eric Wong [Sun, 15 Mar 2009 01:41:47 +0000 (18:41 -0700)]
fix segfault when displaying empty blobs

When size is zero, subtracting one from it turns it into
ULONG_MAX which causes an out-of-bounds access on buf.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoui-tree: escape ascii-text properly in hexdump view
Lars Hjemli [Thu, 12 Feb 2009 10:26:14 +0000 (11:26 +0100)]
ui-tree: escape ascii-text properly in hexdump view

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoCGIT 0.8.2 v0.8.2
Lars Hjemli [Sun, 1 Feb 2009 18:31:37 +0000 (19:31 +0100)]
CGIT 0.8.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoUse GIT-1.6.1.1
Lars Hjemli [Sun, 1 Feb 2009 18:30:16 +0000 (19:30 +0100)]
Use GIT-1.6.1.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/binary'
Lars Hjemli [Sun, 1 Feb 2009 18:29:47 +0000 (19:29 +0100)]
Merge branch 'lh/binary'

15 years agoshared.c: avoid SEGFAULT when checking for binary buffers
Lars Hjemli [Sun, 1 Feb 2009 18:29:24 +0000 (19:29 +0100)]
shared.c: avoid SEGFAULT when checking for binary buffers

Before calling buffer_is_binary() we need to verify that the buffer
is valid.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/header'
Lars Hjemli [Sun, 1 Feb 2009 18:17:52 +0000 (19:17 +0100)]
Merge branch 'lh/header'

15 years agoui-tree: show hexdump of binary blobs
Lars Hjemli [Sat, 31 Jan 2009 16:45:48 +0000 (17:45 +0100)]
ui-tree: show hexdump of binary blobs

This teaches ui-tree to detect binary blobs and display them similar
to `hexdump -C` (only wider).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoHandle binary files in diffs
Lars Hjemli [Sat, 31 Jan 2009 09:40:40 +0000 (10:40 +0100)]
Handle binary files in diffs

This teaches all diff-related operations (i.e. ui-log, ui-diff and ui-patch)
how to handle binary files.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Thu, 29 Jan 2009 21:21:24 +0000 (22:21 +0100)]
Merge branch 'stable'

15 years agohtml.c: use correct escaping in html attributes
Lars Hjemli [Thu, 29 Jan 2009 21:21:15 +0000 (22:21 +0100)]
html.c: use correct escaping in html attributes

First, an apostrophe is not a quote. Second, we also need to escape
quotes. And finally, quotes are encoded as '&quot;', not '&quote;'.

Sighned-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd support for a custom header
Lars Hjemli [Thu, 29 Jan 2009 20:27:39 +0000 (21:27 +0100)]
Add support for a custom header

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'stable'
Lars Hjemli [Tue, 27 Jan 2009 22:03:05 +0000 (23:03 +0100)]
Merge branch 'stable'

15 years agoMerge branch 'jw/commit-decorations'
Lars Hjemli [Tue, 27 Jan 2009 22:00:40 +0000 (23:00 +0100)]
Merge branch 'jw/commit-decorations'

Conflicts:
cgit.css

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agotests/t0105-commit.sh: expect commit decorations
Lars Hjemli [Tue, 27 Jan 2009 21:59:23 +0000 (22:59 +0100)]
tests/t0105-commit.sh: expect commit decorations

When a commit is referenced by a branch or tag the commit subject-
line will be suffixed with the proper decorations, hence the test
for this line needs to be updated.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agocgit.css: minor adjustment of commit decorations
Lars Hjemli [Tue, 27 Jan 2009 21:42:03 +0000 (22:42 +0100)]
cgit.css: minor adjustment of commit decorations

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoAdd decorations to commit pages
Justin Waters [Mon, 12 Jan 2009 15:23:28 +0000 (10:23 -0500)]
Add decorations to commit pages

This adds the tag and branch head decorations to the commit pages.  This is
similar to how commits are displayed in the standard gitweb interface.

Signed-off-by: Justin Waters <justin.waters@timesys.com>
15 years agoCGIT 0.8.1.1 v0.8.1.1
Lars Hjemli [Tue, 27 Jan 2009 19:35:49 +0000 (20:35 +0100)]
CGIT 0.8.1.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'og/tree-view-selection'
Lars Hjemli [Tue, 27 Jan 2009 19:21:56 +0000 (20:21 +0100)]
Merge branch 'og/tree-view-selection'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
15 years agoMerge branch 'lh/stats'
Lars Hjemli [Tue, 27 Jan 2009 19:16:37 +0000 (20:16 +0100)]
Merge branch 'lh/stats'

Conflicts:
cgit.c
cgit.css
cgit.h
ui-tree.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Mon, 12 Jan 2009 07:57:23 +0000 (08:57 +0100)]
Merge branch 'stable'

16 years agoMakefile: install cgit.{css,png} in CGIT_DATA_PATH
Todd Zullinger [Sun, 11 Jan 2009 23:23:59 +0000 (18:23 -0500)]
Makefile: install cgit.{css,png} in CGIT_DATA_PATH

CGIT_DATA_PATH defaults to CGIT_SCRIPT_PATH, but allows users to
install the cgi and the data files in different locations.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: add INSTALL var to set install command
Todd Zullinger [Sun, 11 Jan 2009 23:23:52 +0000 (18:23 -0500)]
Makefile: add INSTALL var to set install command

This also explicitly sets the modes for installed files (755 for the
.cgi, 644 for the .css and .png).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix tar.bz2 snapshot example
Todd Zullinger [Sun, 11 Jan 2009 23:23:39 +0000 (18:23 -0500)]
Fix tar.bz2 snapshot example

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Sun, 11 Jan 2009 21:00:25 +0000 (22:00 +0100)]
Merge branch 'stable'

16 years agoAvoid SEGFAULT on invalid requests
Lars Hjemli [Sun, 11 Jan 2009 20:23:04 +0000 (21:23 +0100)]
Avoid SEGFAULT on invalid requests

When an unknown page is requested, either on the querystring or via
PATH_INFO, we end up with a null-referencing cgit_cmd. This null-
pointer is then used as argument to the hc() function (which decides
what tab to render as 'active'), but this function failed to check if a
valid cmd was specified and a SEGFAULT would occur. This patch fixes the
issue by introducing a 'fallback-cmd' which specifies what tab to render
as 'active' when no valid cmd is requested.

While at it, we now also keep track of the active repository even if an
invalid cmd was requested since we want to show the error message about
the invalid request in the correct context.

Noticed-by: Robin Redeker <elmex@ta-sa.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMake all tags viewable
Robin Redeker [Sun, 11 Jan 2009 15:25:01 +0000 (16:25 +0100)]
Make all tags viewable

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Sun, 11 Jan 2009 15:38:19 +0000 (16:38 +0100)]
Merge branch 'stable'

16 years agoui-tag: escape tagnames properly
Lars Hjemli [Sun, 11 Jan 2009 15:37:47 +0000 (16:37 +0100)]
ui-tag: escape tagnames properly

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoChange toggle to more meaningful term
Justin Waters [Fri, 9 Jan 2009 22:35:10 +0000 (17:35 -0500)]
Change toggle to more meaningful term

In the log interface, there is a toggle link at the top, but it isn't clear
what's being toggled.  I've changed it to "Expand" and "Collapse" to make it
clear that you are getting more and less information, respectively.

Signed-off-by: Justin Waters <justin.waters@timesys.com>
16 years agoMerge branch 'snapshot-fixes'
Lars Hjemli [Sun, 11 Jan 2009 11:22:46 +0000 (12:22 +0100)]
Merge branch 'snapshot-fixes'

16 years agoMerge branch 'lh/mimetypes'
Lars Hjemli [Sun, 11 Jan 2009 11:22:31 +0000 (12:22 +0100)]
Merge branch 'lh/mimetypes'

16 years agoMerge branch 'lh/virtual-root'
Lars Hjemli [Sun, 11 Jan 2009 11:22:19 +0000 (12:22 +0100)]
Merge branch 'lh/virtual-root'

16 years agoMerge branch 'stable'
Lars Hjemli [Sun, 11 Jan 2009 11:18:25 +0000 (12:18 +0100)]
Merge branch 'stable'

16 years agoui-log: show name-decorations in log output
Lars Hjemli [Sun, 11 Jan 2009 11:16:18 +0000 (12:16 +0100)]
ui-log: show name-decorations in log output

Commits are now decorated with a clickable 'label' for each ref pointing
at it, similar to how gitweb and gitk displays commit decorations.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: avoid libcurl when building git
Lars Hjemli [Sat, 10 Jan 2009 14:18:18 +0000 (15:18 +0100)]
Makefile: avoid libcurl when building git

We don't need support for fetching/pushing in libgit.a, hence we don't need
to link with libcurl.

Noticed-by: Robin Redeker <elmex@ta-sa.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-refs: avoid SEGFAULT on lightweight tags
Robin Redeker [Sat, 10 Jan 2009 11:44:08 +0000 (12:44 +0100)]
ui-refs: avoid SEGFAULT on lightweight tags

Signed-off-by: Robin Redeker <elmex@ta-sa.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agochanged objects are outputted, allowing for selections of code only
Onne Gorter [Wed, 7 Jan 2009 12:56:14 +0000 (13:56 +0100)]
changed objects are outputted, allowing for selections of code only

16 years agoMerge branch 'stable'
Lars Hjemli [Tue, 6 Jan 2009 20:51:09 +0000 (21:51 +0100)]
Merge branch 'stable'

16 years agoui-tree.c: do not add blank line when displaying blobs
Lars Hjemli [Tue, 6 Jan 2009 20:37:23 +0000 (21:37 +0100)]
ui-tree.c: do not add blank line when displaying blobs

Also, fix a related bug in the test-suite.

Noticed-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Tue, 30 Dec 2008 11:29:50 +0000 (12:29 +0100)]
Merge branch 'stable'

16 years agoui-patch: whitespace changes in the patch generation code
Tomas Carnecky [Tue, 30 Dec 2008 10:14:52 +0000 (11:14 +0100)]
ui-patch: whitespace changes in the patch generation code

Add a space between the committer name and email, and remove
superfluous spaces in the date header.

This makes cgit-generated patches match the output from git-format-patch
almost exactly, at least as far as the email headers go.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agotests/t0107-snapshot.sh: make testscript match updated snapshot behavior
Lars Hjemli [Sun, 28 Dec 2008 09:52:35 +0000 (10:52 +0100)]
tests/t0107-snapshot.sh: make testscript match updated snapshot behavior

Since cgit now returns a 404 error when the snapshot filename cannot be
resolved to a commit object, the testscript needs to request a valid
snapshot name.

Also, the script assumed that the toplevel directory in the snapshot
would get the name of the repository but it's now named similar to
the requested snapshot.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoreturn 404 if snapshot is not found
Natanael Copa [Tue, 2 Dec 2008 10:31:34 +0000 (11:31 +0100)]
return 404 if snapshot is not found

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-snapshot.c: change mime-type for tar.gz and tar.bz2
Lars Hjemli [Fri, 26 Dec 2008 10:33:59 +0000 (11:33 +0100)]
ui-snapshot.c: change mime-type for tar.gz and tar.bz2

The updated mime-types seems to work better than the old ones with both
safari and firefox.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.1
Lars Hjemli [Fri, 26 Dec 2008 10:03:01 +0000 (11:03 +0100)]
Use GIT-1.6.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoshared.c: future-proof usage of git diff-structures
Lars Hjemli [Fri, 26 Dec 2008 10:02:02 +0000 (11:02 +0100)]
shared.c: future-proof usage of git diff-structures

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUntie logic for SCRIPT_NAME and PATH_INFO
Lars Hjemli [Fri, 26 Dec 2008 09:33:01 +0000 (10:33 +0100)]
Untie logic for SCRIPT_NAME and PATH_INFO

SCRIPT_NAME is used as fallback for virtual-root when virtual-root is
unspecified in cgitrc and PATH_INFO is used as fallback for the query-
string parameter 'url' when the latter is unspecified. But until now,
the use of PATH_INFO depended on virtual-root also being unspecified,
i.e. it was impossible to use PATH_INFO when virtual-root was specified.

This commit makes the fallback on SCRIPT_NAME and PATH_INFO independent
code paths, i.e. it is now possible to specify virtual-root in cgitrc
while still using PATH_INFO (instead of rewrite rules) to get 'pretty
urls'.

Noticed-by: Jack Moffitt <jack@chesspark.com>
Noticed-by: LiKai Liu <liulk@cs.bu.edu>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-stats.c: reuse cgit_add_hidden_formfields()
Lars Hjemli [Sun, 7 Dec 2008 14:57:55 +0000 (15:57 +0100)]
ui-stats.c: reuse cgit_add_hidden_formfields()

This makes sure that the currect branch and path is preserved when
changing the stats period or author count.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: externalize add_hidden_formfields()
Lars Hjemli [Sun, 7 Dec 2008 14:52:35 +0000 (15:52 +0100)]
ui-shared: externalize add_hidden_formfields()

This function will be reused by ui-stats.c in the next commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-tree: add link to stats page per path
Lars Hjemli [Sun, 7 Dec 2008 12:34:42 +0000 (13:34 +0100)]
ui-tree: add link to stats page per path

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: add and use cgit_stats_link()
Lars Hjemli [Sun, 7 Dec 2008 12:34:16 +0000 (13:34 +0100)]
ui-shared: add and use cgit_stats_link()

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-stats: replace 'enable-stats' setting with 'max-stats'
Lars Hjemli [Sun, 7 Dec 2008 12:17:21 +0000 (13:17 +0100)]
ui-stats: replace 'enable-stats' setting with 'max-stats'

The new 'max-stats' and 'repo.max-stats' settings makes it possible to
define the maximum statistics period, both globally and per repo. Hence,
it is now feasible to allow statistics on repositories with a high commit
frequency, like linux-2.6, by setting repo.max-stats to e.g. 'month'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-stats: enable path-filtered stats
Lars Hjemli [Sun, 7 Dec 2008 10:45:28 +0000 (11:45 +0100)]
ui-stats: enable path-filtered stats

When a path is specified on the querystring the commit statistics will
now be filtered by this path.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd a 'stats' page to each repo
Lars Hjemli [Sat, 6 Dec 2008 16:38:19 +0000 (17:38 +0100)]
Add a 'stats' page to each repo

This new page, which is disabled by default, can be used to print some
statistics about the number of commits per period in the repository,
where period can be either weeks, months, quarters or years.

The function can be activated globally by setting 'enable-stats=1' in
cgitrc and disabled for individual repos by setting 'repo.enable-stats=0'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Sat, 6 Dec 2008 11:05:21 +0000 (12:05 +0100)]
Merge branch 'stable'

16 years agotests/setup.sh: allow testsuite to fail properly with POSIX standard shells
Lars Hjemli [Sat, 6 Dec 2008 11:03:54 +0000 (12:03 +0100)]
tests/setup.sh: allow testsuite to fail properly with POSIX standard shells

The "((expr))" construct is not implemented by e.g. dash, so this commit
replaces the construct with a more portable one.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agotests/t0010-validate-html.sh: skip tests if 'tidy' is not available
Lars Hjemli [Sat, 6 Dec 2008 10:53:59 +0000 (11:53 +0100)]
tests/t0010-validate-html.sh: skip tests if 'tidy' is not available

Noticed-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'full-log'
Lars Hjemli [Sat, 6 Dec 2008 10:37:37 +0000 (11:37 +0100)]
Merge branch 'full-log'

Conflicts:
cgit.c
cgit.h

16 years agoMerge branch 'lh/sort-repolist'
Lars Hjemli [Sat, 6 Dec 2008 10:35:49 +0000 (11:35 +0100)]
Merge branch 'lh/sort-repolist'

16 years agoMerge branch 'snapshot-fixes'
Lars Hjemli [Sat, 6 Dec 2008 10:34:48 +0000 (11:34 +0100)]
Merge branch 'snapshot-fixes'

16 years agoMerge branch 'stable'
Lars Hjemli [Sat, 6 Dec 2008 10:33:05 +0000 (11:33 +0100)]
Merge branch 'stable'

16 years agoMerge branch 'rj/buildtweaks' into stable
Lars Hjemli [Fri, 5 Dec 2008 18:13:32 +0000 (19:13 +0100)]
Merge branch 'rj/buildtweaks' into stable

16 years agoparsing.c: enable builds with NO_ICONV defined
Lars Hjemli [Fri, 5 Dec 2008 18:10:28 +0000 (19:10 +0100)]
parsing.c: enable builds with NO_ICONV defined

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-repolist: avoid build warning for strcasestr(3)
Lars Hjemli [Fri, 5 Dec 2008 18:04:17 +0000 (19:04 +0100)]
ui-repolist: avoid build warning for strcasestr(3)

The non-standard function strcasestr is only defined if _GNU_SOURCE has
also been defined.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: allow cgit.conf to override platform-specific tweaks
Lars Hjemli [Fri, 5 Dec 2008 17:47:16 +0000 (18:47 +0100)]
Makefile: allow cgit.conf to override platform-specific tweaks

If the makefile doesn't automatically define the correct build variables
it is nice to be able to define them explicitly.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoExtra cygwin-specific changes
Ramsay Jones [Sat, 15 Nov 2008 18:26:32 +0000 (18:26 +0000)]
Extra cygwin-specific changes

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-log: try to disambiguate ref names
Lars Hjemli [Wed, 3 Dec 2008 16:34:23 +0000 (17:34 +0100)]
ui-log: try to disambiguate ref names

The 'h' querystring parameter in cgit is normally used to specify
a branch (i.e. a ref below refs/heads/), but if a repository contains
a tag with the same name as a branch the output from ui-log would use
the tag as start-revision.

This patch tries to fix the issue by checking if the specified ref is
valid as a branch name; if so, the full refname is used in the call
to setup_revisions().

Noticed-by: Takamori Yamaguchi <akschar@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: shorten the sha1 printed by cgit_object_link
Lars Hjemli [Mon, 1 Dec 2008 20:58:59 +0000 (21:58 +0100)]
ui-shared: shorten the sha1 printed by cgit_object_link

Such links was printed as the object type followed by the objects complete
sha1. We still use the complete sha1 in the link but we no longer show it
in all its glory; only the first 10 hex chars are printed.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-refs.c: show download links for all tags referring to commit objects
Lars Hjemli [Mon, 1 Dec 2008 20:56:07 +0000 (21:56 +0100)]
ui-refs.c: show download links for all tags referring to commit objects

The snapshot function has only been linked to from the commit page while
users often would want to download a certain release. With this patch,
direct download links will now be printed for each tagged release on the
repo summary page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-shared: exploit snapshot dwimmery in cgit_print_snapshot_links
Lars Hjemli [Mon, 1 Dec 2008 20:50:19 +0000 (21:50 +0100)]
ui-shared: exploit snapshot dwimmery in cgit_print_snapshot_links

Since we know that ui-snapshot.c is able to extract the revision from the
filename, there's no longer necessary to specify the revision with a 'id'
querystring argument.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-snapshot: improve extraction of revision from snapshot name
Lars Hjemli [Mon, 1 Dec 2008 18:13:44 +0000 (19:13 +0100)]
ui-snapshot: improve extraction of revision from snapshot name

The modified get_ref_from_filename() supports the following snapshot
formats:
* $REV.$EXT
* $REPO[-_]*v?$REV.$EXT

This implies that the following urls will retrieve the expected revision:
* http://hjemli.net/git/cgit/snapshot/v0.8.1.tar.gz
* http://hjemli.net/git/cgit/snapshot/0.8.1.tar.gz
* http://hjemli.net/git/cgit/snapshot/cgit-0.8.1.tar.gz
* http://hjemli.net/git/cgit/snapshot/cgit-140012d7a8.tar.gz

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoSet prefix in snapshots when using dwimmery
Natanael Copa [Sun, 30 Nov 2008 05:49:07 +0000 (21:49 -0800)]
Set prefix in snapshots when using dwimmery

This patch sets the directory prefix in archives to be the filename,
excluding the suffix (.tar.gz, .tar.bz2 etc).

The patch also removes the prefix parameter in cgit_print_snapshot()
as the prefix might differ.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-log: use css to make full-log prettier
Lars Hjemli [Sat, 29 Nov 2008 18:11:26 +0000 (19:11 +0100)]
ui-log: use css to make full-log prettier

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-log: (ab)use extra columns for commit message when showmsg=1
Lars Hjemli [Sat, 29 Nov 2008 17:58:31 +0000 (18:58 +0100)]
ui-log: (ab)use extra columns for commit message when showmsg=1

If the commit message has extra long lines it's better to use the author/
files/lines columns to show those lines than to push the columns of screen
and force the users to hscroll.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-log: add support for showing the full commit message
Lars Hjemli [Sat, 29 Nov 2008 17:39:41 +0000 (18:39 +0100)]
ui-log: add support for showing the full commit message

Some users prefer to see the full message, so to make these users happy
the new querystring parameter "showmsg" can be used to print the full
commit message per log entry.

A link is provided in the log heading to make this function accessible,
and all links and forms tries to preserve the users preference.

Note: the new link is not displayed on the summary page since the point
of the summary page is to be a summary, but it is still obeyed if specified
manually.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-repolist: implement lazy caching of repo->mtime
Lars Hjemli [Sat, 29 Nov 2008 15:46:37 +0000 (16:46 +0100)]
ui-repolist: implement lazy caching of repo->mtime

When sorting the list of repositories by their last modification time,
cgit would (in the worst case) invoke fstat(3) four times and open(3)
twice for each callback from qsort(3). This obviously scales very badly.

Now, the calculated modtime for each repo is saved in repo->mtime, thus
keeping the number of stat/open invocations identical for sorted and
unsorted repo-listings.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-repolist: sort null values last
Lars Hjemli [Sat, 29 Nov 2008 13:27:35 +0000 (14:27 +0100)]
ui-repolist: sort null values last

When sorting on e.g. owner, it's not interesting to get all repos
without owner at the top of the list.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-repolist: add support for sorting any column
Lars Hjemli [Sat, 29 Nov 2008 13:08:51 +0000 (14:08 +0100)]
ui-repolist: add support for sorting any column

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-repolist: extract get_repo_modtime() from print_modtime()
Lars Hjemli [Sat, 29 Nov 2008 12:33:02 +0000 (13:33 +0100)]
ui-repolist: extract get_repo_modtime() from print_modtime()

The new function is then used by both print_modtime() and
cgit_reposort_modtime().

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd support for sorting by Age in the repolist
Benjamin Close [Tue, 25 Nov 2008 14:25:35 +0000 (06:25 -0800)]
Add support for sorting by Age in the repolist

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Fri, 14 Nov 2008 08:30:28 +0000 (09:30 +0100)]
Merge branch 'stable'

16 years agoui-repolist: handle empty agefiles
Lars Hjemli [Fri, 14 Nov 2008 08:29:22 +0000 (09:29 +0100)]
ui-repolist: handle empty agefiles

When the agefile was empty the old code would happily reuse the static
buffer filled by a previous call to read_agefile().

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Thu, 6 Nov 2008 19:47:19 +0000 (20:47 +0100)]
Merge branch 'stable'

16 years agoUse mode 0644 for non-executable files
Karl Chen [Wed, 5 Nov 2008 10:45:18 +0000 (02:45 -0800)]
Use mode 0644 for non-executable files

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMerge branch 'stable'
Lars Hjemli [Thu, 6 Nov 2008 18:18:27 +0000 (19:18 +0100)]
Merge branch 'stable'

16 years agoFix tests to work on Ubuntu (dash)
Ramsay Jones [Tue, 4 Nov 2008 19:23:41 +0000 (19:23 +0000)]
Fix tests to work on Ubuntu (dash)

The system shell (/bin/sh) on Ubuntu is dash, which aims to be a
POSIX standard shell.  In particular, dash does not implement any
of the common extensions to the standard that, say, bash and ksh
do.

Replace some non-POSIX constructs in setup.sh with more portable
and mundane code.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoFix some warnings to allow -Werror
Ramsay Jones [Tue, 4 Nov 2008 19:22:08 +0000 (19:22 +0000)]
Fix some warnings to allow -Werror

The type used to declare the st_size field of a 'struct stat' can
be a 32- or 64-bit sized type, which can vary from one platform to
another, or even from one compilation to another.  In particular,
on linux, if you include the following define:

    #define _FILE_OFFSET_BITS 64

prior to including certain system header files, then the type used
for the st_size field will be __off64_t, otherwise it will be an
__off_t.  Note that the above define is included at the top of
git-compat-util.h.

In cache.c, the "%zd" format specifier expects a "signed size_t",
another type which can vary, when an __off64_t or a __off_t is
provided.  To supress the warning, use the PRIuMAX format specifier
and cast the st_size field to uintmax_t.  This should work an any
platform for which git currently compiles.

In ui-plain.c, the size parameter of sha1_object_info() and
read_sha1_file() is defined to be "unsigned long *" not "size_t *".
So, to supress the warning, simply declare size with the correct type.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.6.0.3
Lars Hjemli [Thu, 6 Nov 2008 18:13:21 +0000 (19:13 +0100)]
Use GIT-1.6.0.3

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoCGIT 0.8.1 v0.8.1
Lars Hjemli [Sat, 11 Oct 2008 18:22:57 +0000 (20:22 +0200)]
CGIT 0.8.1

16 years agoMerge branch 'stable'
Lars Hjemli [Sat, 11 Oct 2008 18:21:17 +0000 (20:21 +0200)]
Merge branch 'stable'

* stable:
  Makefile: enable compilation on uclibc

16 years agoMakefile: enable compilation on uclibc
Lars Hjemli [Sat, 11 Oct 2008 18:21:06 +0000 (20:21 +0200)]
Makefile: enable compilation on uclibc

Original-patch-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoui-snapshot: add dwimmery
Lars Hjemli [Sat, 11 Oct 2008 18:09:42 +0000 (20:09 +0200)]
ui-snapshot: add dwimmery

When downloading a snapshot, the snapshot name will often contain the repo
name combined with a tag. This patch tries to exploit this so that the
correct revision is downloaded even if no specific revision is specified.

PS: this only occurs if neither 'h' nor 'id' is specified in the query-
string.

PPS: this also fixes a bug which occurs when trying to download a filename
with an unsupported suffix: it used to try to print an error message to
the user but failed since it didn't prepare the output properly.

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