Commit Graph

491 Commits (3c32fe07717f27fc891b66ccd06057fb810d03ad)
 

Author SHA1 Message Date
Lars Hjemli 3c32fe0771 Merge branch 'full-log'
Conflicts:
	cgit.c
	cgit.h
16 years ago
Lars Hjemli 9c8be943f7 Merge branch 'lh/sort-repolist' 16 years ago
Lars Hjemli e550440233 Merge branch 'snapshot-fixes' 16 years ago
Lars Hjemli 3157ea3b7e Merge branch 'stable' 16 years ago
Lars Hjemli d2592a2cb5 Merge branch 'rj/buildtweaks' into stable 16 years ago
Lars Hjemli 14b4e108a7 parsing.c: enable builds with NO_ICONV defined
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 7115f7d257 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 ago
Lars Hjemli a5e899e4c7 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 ago
Ramsay Jones 97fdac1608 Extra cygwin-specific changes
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli a1b01b2513 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 ago
Lars Hjemli c57aceb1d2 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 ago
Lars Hjemli 6596268576 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 ago
Lars Hjemli b9053a4ff0 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 ago
Lars Hjemli 4b4f8d1256 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 ago
Natanael Copa 314d9ea5a3 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 ago
Lars Hjemli ab67164d62 ui-log: use css to make full-log prettier
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 951f550b60 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 ago
Lars Hjemli 0274b57d55 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 ago
Lars Hjemli 8813170390 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 ago
Lars Hjemli 54272e6096 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 ago
Lars Hjemli f250c1ca2e ui-repolist: add support for sorting any column
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli cbac02c8b0 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 ago
Benjamin Close d71c0c725d Add support for sorting by Age in the repolist
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 7b5cee65fd Merge branch 'stable' 16 years ago
Lars Hjemli c7d1402b17 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 ago
Lars Hjemli 9895925db7 Merge branch 'stable' 16 years ago
Karl Chen 5b27248301 Use mode 0644 for non-executable files
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli b8a7eb12d4 Merge branch 'stable' 16 years ago
Ramsay Jones e4d2f2b042 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 ago
Ramsay Jones bdd4a56ad5 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 ago
Lars Hjemli a918c068a6 Use GIT-1.6.0.3
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 140012d7a8 CGIT 0.8.1 16 years ago
Lars Hjemli 8011587ef3 Merge branch 'stable'
* stable:
  Makefile: enable compilation on uclibc
16 years ago
Lars Hjemli efaccb3d6a Makefile: enable compilation on uclibc
Original-patch-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli ed7ff095ca 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>
16 years ago
Lars Hjemli 5632ba35d1 Add cgit_query.nohead flag
This flag is set when no HEAD is specified in the querystring. Currently
it has no users, but it will be used by ui-snapshot to invoke a DWIM-mode
where the revision is extracted from the snapshot name.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli cb1cc0d82d ui-shared: specify correct css class for summary tab
When introducing cgit_summary_link() in 49ecbbdd I forgot to specify the
css class. This fixes it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli ae83752b41 CGIT 0.8 16 years ago
Lars Hjemli 0071aa8612 ui-summary: use html_url_path()
This makes the clone urls be properly escaped.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 24d4bb3058 ui-refs: use cgit_tag_link()
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli cf61ad411c ui-shared: add cgit_tag_link()
This function can be used to generate properly escaped links to the tag
page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 8b5fc6de03 ui-shared: generate proper links in cgit_object_link()
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 2e884f3162 ui-shared: use html_url_path() to get properly escaped url in form action
When a repo uses an url with e.g. '#' or '?' characters this needs to be
properly escaped when used as action in a form tag.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli b7f33786ef Use GIT-1.6.0.2
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli b9aabf0b8f ui-shared: reword the standard page footer
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli 23ffba78b4 ui-shared: do not print repo name on the "summary" tab
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli df46123b0e Replace cgitrc with cgitrc.5.txt
The new file describes all cgitrc options in a more structured manner then
the cgitrc example file and it might also work as the source for a cgitrc
man page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli c6bea0375a Merge branch 'lh/escape-urls'
* lh/escape-urls:
  ui-repolist + ui-shared: Use cgit_summary_link()
  ui-shared.c: add cgit_summary_link()
  ui-shared.c: use html_url_path() in repolink()
  html.c: add html_url_path
16 years ago
Lars Hjemli 49ecbbddf0 ui-repolist + ui-shared: Use cgit_summary_link()
This makes is possible to use cgit with repository urls containing special
url characters like '#' and '?'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years ago
Lars Hjemli e9d3bd544f ui-shared.c: add cgit_summary_link()
This function can be used to generate a link to the summary page for the
currently active repo.

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