]> Lady’s Gitweb - Gitweb/log
Gitweb
33 hours agogitweb: Support for snapshot
Aneesh Kumar K.V [Thu, 17 Aug 2006 15:29:46 +0000 (20:59 +0530)]
gitweb: Support for snapshot

This adds snapshort support in gitweb. To enable one need to
set gitweb.snapshot = true in the config file.
Signed-off-by: Aneesh Kumar K.V <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Refactor printing commit message
Jakub Narebski [Thu, 17 Aug 2006 09:21:23 +0000 (11:21 +0200)]
gitweb: Refactor printing commit message

Separate pretty-printing commit message (comment) into git_print_log
and git_print_simplified_log subroutines. As of now the former is used
in git_commit, the latter in git_log and git_commitdiff.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: fix project list if PATH_INFO=="/".
Martin Waitz [Wed, 16 Aug 2006 22:28:40 +0000 (00:28 +0200)]
gitweb: fix project list if PATH_INFO=="/".

The project list now uses several common header / footer generation functions.
These functions only check for "defined $project", but when PATH_INFO just
contains a "/" (which is often generated by web servers), then this test
fails.

Now explicitly undef $project if there is none so that the tests in other
gitweb parts work again.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: support for / as home_link.
Martin Waitz [Wed, 16 Aug 2006 22:28:39 +0000 (00:28 +0200)]
gitweb: support for / as home_link.

If the webserver is configured to use gitweb even for the root directory
of the site, then my_uri is empty which leads to a non-functional home
link.  Fix that by defaulting to "/" in this case.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: support for "fp" parameter.
Martin Waitz [Wed, 16 Aug 2006 22:28:38 +0000 (00:28 +0200)]
gitweb: support for "fp" parameter.

The "fp" (file name parent) parameter was previously generated for
blob diffs of renamed files.  However, it was not used in any code.

Now href() can generate "fp" parameters and they are used by the
blobdiff code to show the correct file name.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: continue consolidation of URL generation.
Martin Waitz [Wed, 16 Aug 2006 22:28:36 +0000 (00:28 +0200)]
gitweb: continue consolidation of URL generation.

Further use href() instead of URL generation by string concatenation.
Almost all functions are converted now.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Uniquify version info output, add meta generator in page header
Jakub Narebski [Thu, 17 Aug 2006 09:21:28 +0000 (11:21 +0200)]
gitweb: Uniquify version info output, add meta generator in page header

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Add support for per project git URLs
Jakub Narebski [Wed, 16 Aug 2006 12:50:34 +0000 (14:50 +0200)]
gitweb: Add support for per project git URLs

It is now possible for project to have individual clone/fetch URLs.
They are provided in new file 'cloneurl' added below project's
$GIT_DIR directory.

If there is no cloneurl file, concatenation of git base URLs with
project name is used.

This is merge of Jakub Narebski and David Rientjes
  gitweb: Show project's git URL on summary page
with Aneesh Kumar
  gitweb: Add support for cloneurl.
  gitweb: Support multiple clone urls
patches.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Aneesh Kumar K.V <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: consolidate action URL generation.
Martin Waitz [Tue, 15 Aug 2006 22:24:30 +0000 (00:24 +0200)]
gitweb: consolidate action URL generation.

Use the href() function instead of string concatenation to generate
most URLs to our own CGI.
This is a work in progress, not everything has been converted yet.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: provide function to format the URL for an action link.
Martin Waitz [Tue, 15 Aug 2006 22:23:50 +0000 (00:23 +0200)]
gitweb: provide function to format the URL for an action link.

Provide a new function which can be used to generate an URL for the CGI.
This makes it possible to consolidate the URL generation in order to make
it easier to change the encoding of actions into URLs.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Show project's git URL on summary page
Jakub Narebski [Tue, 15 Aug 2006 21:03:17 +0000 (23:03 +0200)]
gitweb: Show project's git URL on summary page

Add support for showing multiple clone/fetch git URLs for project on
a summary page. URL for project is created from base URL and project
name.

For example for XMMS2 project (xmms.se) the git base URL would be
git://git.xmms.se/xmms2.

With corrections from David Rientjes <redacted>

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: David Rientjes <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: configurable home link string
Yasushi SHOJI [Mon, 14 Aug 2006 22:50:49 +0000 (07:50 +0900)]
gitweb: configurable home link string

I've always found difficult to figure out git URL for clone from
gitweb URL because git:// and http:// are different on many site
including kernel.org.

I've found this enhancement at http://dev.laptop.org/git when I was on
git channel, and thought that it'd be nice if all public gitweb site
show it's git URL on its page.

This patch allow us to change the home link string.  The current
default is "projects" as we all see on gitweb now.

ie. kernel.org might set this variable to "git://git.kernel.org/pub/scm/"

Signed-off-by: Yasushi SHOJI <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Separate printing difftree in git_commit into git_difftree_body
Jakub Narebski [Mon, 14 Aug 2006 00:18:33 +0000 (02:18 +0200)]
gitweb: Separate printing difftree in git_commit into git_difftree_body

Separate printing difftree in git_commit into separate
git_difftree_body subroutine. Add support for "C" (copied) status. For
"M" and "C" add parameter 'fp' (filename parent) to the "diff" link;
currently not supported by git_blobdiff ("blobdiff" action).

Reindented, realigned, added comments.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: True fix: Support for the standard mime.types map in gitweb
Jakub Narebski [Mon, 14 Aug 2006 00:16:33 +0000 (02:16 +0200)]
gitweb: True fix: Support for the standard mime.types map in gitweb

True fix for error in mimetype_guess, error introduced in original commit
2d00737489b8c61ed616b261c7c9bd314e2b0b41 and later fixed temporarily
by commenting out the line that caused error in commit
57bd4d3523efecf60197040cad34154aff4ddf80.

Gitweb now supports mime.types map $mimetypes_file relative to project.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Skip comments in mime.types like file
Jakub Narebski [Mon, 14 Aug 2006 00:15:22 +0000 (02:15 +0200)]
gitweb: Skip comments in mime.types like file

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Change appereance of marker of refs pointing to given object
Jakub Narebski [Mon, 14 Aug 2006 00:14:20 +0000 (02:14 +0200)]
gitweb: Change appereance of marker of refs pointing to given object

Change git_get_references to include type of ref in the %refs value, which
means putting everything after 'refs/' as a ref name, not only last
part of the name.  Instead of separating refs pointing to the same
object by " / " separator, use anonymous array reference to store all
refs pointing to given object.

Use 'git-ls-remote .' if $projectroot/$project/info/refs does not
exist.  (Perhaps it should be used always.)

Refs are now in separate span elements.  Class is dependent on the ref
type: currently known classes are 'tag', 'head', 'remote', and 'ref'
(last one for HEAD and other refs in the main directory).  There is
encompassing span element of class refs, just in case of unknown ref
type.

This might be considered cleaner separating of git_get_references into
filling %refs hash only, and not taking part in formatting ref marker.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Separate finding project owner into git_get_project_owner
Jakub Narebski [Mon, 14 Aug 2006 00:10:06 +0000 (02:10 +0200)]
gitweb: Separate finding project owner into git_get_project_owner

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Separate main part of git_history into git_history_body
Jakub Narebski [Mon, 14 Aug 2006 00:09:08 +0000 (02:09 +0200)]
gitweb: Separate main part of git_history into git_history_body

Separates main part of git_history into git_history_body subroutine,
and makes output more similar to git_shortlog.  Adds "diff to current"
link only for history of regular file (blob).

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Refactor printing shortened title in git_shortlog_body and git_tags_body
Jakub Narebski [Mon, 14 Aug 2006 00:08:27 +0000 (02:08 +0200)]
gitweb: Refactor printing shortened title in git_shortlog_body and git_tags_body

Separate printing of perhaps shortened title (subject) in
git_shortlog_body and git_tags_body into format_subject_html.

While at it, remove presentation element <b>...</b> used to format
title (subject) and move formatting to CSS.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Separate ref parsing in git_get_refs_list into parse_ref
Jakub Narebski [Mon, 14 Aug 2006 00:07:00 +0000 (02:07 +0200)]
gitweb: Separate ref parsing in git_get_refs_list into parse_ref

Note that for each ref there are usually two calls to git subroutines:
first to get the type of ref, second to parse ref if ref is of commit
or tag type.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Great subroutines renaming
Jakub Narebski [Mon, 14 Aug 2006 00:05:47 +0000 (02:05 +0200)]
gitweb: Great subroutines renaming

Rename some of subroutines to better reflect what they do.
Some renames were not performed because subroutine name
reflects hash key.

Subroutines name guideline:
* git_ prefix for subroutines related to git commands,
  git repository, or to gitweb actions
* git_get_ prefix for inner subroutines calling git command
  or reading some file in the repository and returning some output
* parse_ prefix for subroutines parsing some text (or reading and
  parsing some text) into hash or list
* format_ prefix for subroutines formatting, post-processing
  or generating some HTML/text fragment
* _get_ infix for subroutines which return result
* _print_ infix for subroutines which print fragment of output
* _body suffix for subroutines which outputs main part (body)
  of related action (usually table)
* _nav suffix for subroutines related to navigation bars
* _div suffix for subroutines returning or printing div element
* subroutine names should not be based on how the result is obtained,
  as this might change easily

Renames performed:
- git_get_referencing => format_ref_marker
- git_get_paging_nav => format_paging_nav
- git_read_head => git_get_head_hash
- git_read_hash => git_get_hash_by_ref
- git_read_description => git_get_project_description
- git_read_projects => git_get_projects_list
- read_info_ref => git_get_references
- git_read_refs => git_get_refs_list
- date_str => parse_date
- git_read_tag => parse_tag
- git_read_commit => parse_commit
- git_blob_plain_mimetype => blob_mimetype
- git_page_nav => git_print_page_nav
- git_header_div => git_print_header_div

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Whitespace cleanup - tabs are for indent, spaces are for align
Jakub Narebski [Thu, 10 Aug 2006 10:38:47 +0000 (12:38 +0200)]
gitweb: Whitespace cleanup - tabs are for indent, spaces are for align

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: blame table row no highlight fix
Luben Tuikov [Fri, 4 Aug 2006 22:09:59 +0000 (15:09 -0700)]
gitweb: blame table row no highlight fix

Until now blame just used the commit/tree/tags/etc style of
highlight-able table rows, which have alternating light/dark rows that
flash when mouse pointer passes over them. This is very annoying in
blame, since the text is static and it interferes with the
per-revision block highlighting.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: bugfix: git_commit and git_commitdiff parents
Luben Tuikov [Fri, 4 Aug 2006 22:11:47 +0000 (15:11 -0700)]
gitweb: bugfix: git_commit and git_commitdiff parents

In git_commit() the hash base of $from_id is $parent, not
$hash:
 - If status is "D", then action blob for $from_id wants
   $parent, not $hash.  History needs $parent too.
 - If status is "R", then action blob for $from_id wants
   $parent, not $hash.

Similarly in git_commitdiff() the hash base of $from_id is
$hash_parent, not $hash.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Remove unused variables in git_shortlog_body and git_heads
Jakub Narebski [Mon, 7 Aug 2006 23:15:05 +0000 (01:15 +0200)]
gitweb: Remove unused variables in git_shortlog_body and git_heads

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: fix $project usage
Matthias Lederhofer [Sun, 6 Aug 2006 11:25:41 +0000 (13:25 +0200)]
gitweb: fix $project usage

There were some places where $project was used even if it was not
defined.

Signed-off-by: Matthias Lederhofer <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: fix commitdiff_plain for root commits
Matthias Lederhofer [Sun, 6 Aug 2006 17:24:47 +0000 (19:24 +0200)]
gitweb: fix commitdiff_plain for root commits

Signed-off-by: Matthias Lederhofer <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Skip nonmatching lines in difftree output, consistently
Jakub Narebski [Sun, 6 Aug 2006 15:59:52 +0000 (17:59 +0200)]
gitweb: Skip nonmatching lines in difftree output, consistently

This fixes error for commitdiff on root commit (without parents).

Noticed-by: Matthias Lederhofer (matled)
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: fix commitdiff for root commits
Jakub Narebski [Sun, 6 Aug 2006 14:14:25 +0000 (16:14 +0200)]
gitweb: fix commitdiff for root commits

After changing all "-|" open invocations to list form, commitdiff for
initial commit (without parent) got broken; it returned incorrectly
empty patch earlier.  Use '--root' option to git-diff-tree for initial
(root) commit.

No checking for empty $hash_parent in git_commitdiff_plain -- we rely
on gitweb to give correct parameters for commitdiff_plain action.

Noticed by Matthias Lederhofer (matled).

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: check if HTTP_ACCEPT is really set
Matthias Lederhofer [Sun, 6 Aug 2006 13:55:02 +0000 (15:55 +0200)]
gitweb: check if HTTP_ACCEPT is really set

Signed-off-by: Matthias Lederhofer <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Refactor untabifying - converting tabs to spaces
Jakub Narebski [Sun, 6 Aug 2006 00:08:31 +0000 (02:08 +0200)]
gitweb: Refactor untabifying - converting tabs to spaces

Add untabify subroutine and use it.  It also fixes git_diff_print
which used to get the tabstop wrong.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Inline $rss_link
Jakub Narebski [Sat, 5 Aug 2006 11:18:58 +0000 (13:18 +0200)]
gitweb: Inline $rss_link

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: PATH_INFO=/ means no project
Jakub Narebski [Sat, 5 Aug 2006 11:16:03 +0000 (13:16 +0200)]
gitweb: PATH_INFO=/ means no project

Prepared for refactoring input validation.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: No error messages with unescaped/unprotected user input
Jakub Narebski [Sat, 5 Aug 2006 11:15:24 +0000 (13:15 +0200)]
gitweb: No error messages with unescaped/unprotected user input

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: No periods for error messages
Jakub Narebski [Sat, 5 Aug 2006 11:13:53 +0000 (13:13 +0200)]
gitweb: No periods for error messages

Signed-off-by: Jakub Narebski <redacted>
Acked-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Cleanup and uniquify error messages
Jakub Narebski [Sat, 5 Aug 2006 11:12:51 +0000 (13:12 +0200)]
gitweb: Cleanup and uniquify error messages

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Don't undefine query parameter related variables before die_error
Jakub Narebski [Sat, 5 Aug 2006 10:58:06 +0000 (12:58 +0200)]
gitweb: Don't undefine query parameter related variables before die_error

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Use undef for die_error to use default first (status) parameter value
Jakub Narebski [Sat, 5 Aug 2006 10:56:42 +0000 (12:56 +0200)]
gitweb: Use undef for die_error to use default first (status) parameter value

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: die_error first (optional) parameter is HTTP status
Jakub Narebski [Sat, 5 Aug 2006 10:56:04 +0000 (12:56 +0200)]
gitweb: die_error first (optional) parameter is HTTP status

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Separate input validation and dispatch, add comment about opml action
Jakub Narebski [Sat, 5 Aug 2006 10:55:20 +0000 (12:55 +0200)]
gitweb: Separate input validation and dispatch, add comment about opml action

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: git_tree displays blame based on repository config
Luben Tuikov [Fri, 4 Aug 2006 22:14:27 +0000 (15:14 -0700)]
gitweb: git_tree displays blame based on repository config

git_tree() will now conditionally display "blame"
depending on how "gitweb.blame" variable is configured
using "git-repo-config".

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: do not use @@FOO@@ for replaced tokens
Junio C Hamano [Wed, 2 Aug 2006 20:50:20 +0000 (13:50 -0700)]
gitweb: do not use @@FOO@@ for replaced tokens

This makes it easier to run gitweb/gitweb.perl without token substitution.
Using @@ makes Perl emit "unintended interpolation" warnings.

Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: require $ENV{'GITWEB_CONFIG'}
Matthias Lederhofer [Wed, 2 Aug 2006 20:29:36 +0000 (22:29 +0200)]
gitweb: require $ENV{'GITWEB_CONFIG'}

With this patch it is possible to use gitweb.perl for developing by
loading the configuration from $GITWEB_CONFIG.  This might also be
useful for normal usage of gitweb.

Example:

    % cat cfg
    $GIT = '/usr/bin/git';
    $projectroot = '/home/matled/src/git';
    $projects_list = '/home/matled/src/git/git/gitweb/list';
    % cat run
    #!/bin/sh
    export GATEWAY_INTERFACE="CGI/1.1"
    export HTTP_ACCEPT="*/*"
    export REQUEST_METHOD="GET"
    export GITWEB_CONFIG='./cfg'
    export QUERY_STRING=""$1""
    exec ./gitweb.perl
    % time ./run p=git/.git > /dev/null

This makes it easy to check for warnings and do performance tests
after changes, you can also pipe this to lynx -dump -force-html
/dev/stdin to get more than just html.

This also documents the original patch adding require $GITWEB_CONFIG.

Signed-off-by: Matthias Lederhofer <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: optionally read config from GITWEB_CONFIG
Jeff King [Wed, 2 Aug 2006 19:23:34 +0000 (15:23 -0400)]
gitweb: optionally read config from GITWEB_CONFIG

Configuration will first be taken from variables inside the gitweb.cgi
script, which in turn come from the Makefile. Afterwards, the contents of
GITWEB_CONFIG are read, overriding the builtin defaults.

This should eliminate the need for editing the gitweb script at all. Users
should edit the Makefile and/or add a config file.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb/README: do not bug Kay with gitweb questions anymore
Junio C Hamano [Tue, 1 Aug 2006 22:56:28 +0000 (15:56 -0700)]
gitweb/README: do not bug Kay with gitweb questions anymore

Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: use out-of-line GIT logo.
Martin Waitz [Sun, 30 Jul 2006 22:38:39 +0000 (00:38 +0200)]
gitweb: use out-of-line GIT logo.

Use the normal web server instead of the CGI to provide the git logo,
just like the gitweb.css.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: fill in gitweb configuration by Makefile
Martin Waitz [Tue, 1 Aug 2006 19:34:08 +0000 (21:34 +0200)]
gitweb: fill in gitweb configuration by Makefile

Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi
by the end user.  The GIT installation directory is already known
by the Makefile, and can be inserted directly into gitweb.
All other gitweb configuration parameters can now be specified by
providing GITWEB_* variables while building GIT.  These are described
in gitweb/README.

Signed-off-by: Martin Waitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Refactoring git_project_list
Jakub Narebski [Tue, 1 Aug 2006 00:59:12 +0000 (02:59 +0200)]
gitweb: Refactoring git_project_list

Slightly reworking git_project_list, including moving setting $order,
as it is used only in this action. Mostly reindent.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: avoid undefined value warning in print_page_path
Junio C Hamano [Tue, 1 Aug 2006 04:00:16 +0000 (21:00 -0700)]
gitweb: avoid undefined value warning in print_page_path

The function unconditionally tried to match $type but some
callers did not pass it.

Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: when showing history of a tree, show tree link not blob
Junio C Hamano [Tue, 1 Aug 2006 02:36:50 +0000 (19:36 -0700)]
gitweb: when showing history of a tree, show tree link not blob

Otherwise clicking on that erroneous blob link would produce nonsense.

Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: fix use of uninitialized value.
Junio C Hamano [Tue, 1 Aug 2006 02:24:37 +0000 (19:24 -0700)]
gitweb: fix use of uninitialized value.

Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: an obvious cut and paste error.
Junio C Hamano [Tue, 1 Aug 2006 02:12:18 +0000 (19:12 -0700)]
gitweb: an obvious cut and paste error.

Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: There can be more than two levels of subdirectories
Junio C Hamano [Tue, 1 Aug 2006 02:18:34 +0000 (19:18 -0700)]
gitweb: There can be more than two levels of subdirectories

Earlier code to read .git/refs/{tags,heads} hierarchy had a
hardcoded up-to-two-level assumption.  Lift it by using
File::Find.

Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: use a hash to lookup the sub for an action
Matthias Lederhofer [Mon, 31 Jul 2006 21:46:25 +0000 (23:46 +0200)]
gitweb: use a hash to lookup the sub for an action

Signed-off-by: Matthias Lederhofer <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Reordering code and dividing it into categories
Jakub Narebski [Mon, 31 Jul 2006 19:22:15 +0000 (21:22 +0200)]
gitweb: Reordering code and dividing it into categories

Reorder gitweb code around, divide it into sections (categories) and
add some comments.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Remove characters entities entirely when shortening string -- correction
Jakub Narebski [Mon, 31 Jul 2006 18:58:00 +0000 (20:58 +0200)]
gitweb: Remove characters entities entirely when shortening string -- correction

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: do not quote path for list version of open "-|"
Jakub Narebski [Mon, 31 Jul 2006 16:33:37 +0000 (18:33 +0200)]
gitweb: do not quote path for list version of open "-|"

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Refactor generation of shortlog, tags and heads body
Jakub Narebski [Mon, 31 Jul 2006 09:22:13 +0000 (11:22 +0200)]
gitweb: Refactor generation of shortlog, tags and heads body

Add git_shortlog_body, git_tags_body and git_heads_body to generate
table with shortlog, tags and heads respectively in git_summary and
git_shortlog, git_tags, git_heads respectively.

Better support for lightweight tags in git_read_refs; currently only
lightweight tag pointing to tag object is not resolved fully.

Shortlog, tags and heads body tables have proper class now (we could
use id instead of class).

Add support for showing full comment on mouseover to tags list when
comment is shortened, similar to how full title of commit was/is
shown on mouseover when title was shortened.  Changed layout of tags
table to better show lightweight tags.

Add showing which branch (head) is current branch (current head),
using "current_head" class (we could use id instead).

Corrected "</table\n>" and hit_header_div instead of git_header_div.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Ref refactoring - use git_get_referencing for marking tagged/head commits
Jakub Narebski [Mon, 31 Jul 2006 00:21:52 +0000 (02:21 +0200)]
gitweb: Ref refactoring - use git_get_referencing for marking tagged/head commits

Use git_get_referencing to get HTML code for markers showing which
refs (tags and heads) point to current commit.  It would be much
easier to change format of markers in one or two places than thorough
the gitweb.cgi file.

Added comment about read_info_ref subroutine: for $type == "" (empty
argument) it saves only last path part of ref name e.g. from
'refs/heads/jn/gitweb' it would leave only 'gitweb'.

Some reordering.  Added $ref in one place.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Remove characters entities entirely when shortening string
Jakub Narebski [Sun, 30 Jul 2006 20:36:04 +0000 (22:36 +0200)]
gitweb: Remove characters entities entirely when shortening string

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Headers refactoring - use git_header_div for header divs
Jakub Narebski [Sun, 30 Jul 2006 18:32:01 +0000 (20:32 +0200)]
gitweb: Headers refactoring - use git_header_div for header divs

Add git_header_div subroutine which prints "header" divs, now with
class "header" (class "title" is taken, and has set CSS style,
changing appereance and maing layout wrong), and use it thorough
gitweb.cgi.  Change header linking to project summary from empty
(&nbsp; as a contents of link) to having $project as contents/name
of link.  Sometimes a little reordering.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Remove $project from git_get_paging_nav arguments
Jakub Narebski [Sun, 30 Jul 2006 18:31:00 +0000 (20:31 +0200)]
gitweb: Remove $project from git_get_paging_nav arguments

Remove $project from arguments passed to git_get_paging_nav
subroutine: it did not depend only on arguments, using $my_uri global
variable (and now $project global variable).

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Pager refactoring - use git_get_paging_nav for pagination
Jakub Narebski [Sun, 30 Jul 2006 15:49:00 +0000 (17:49 +0200)]
gitweb: Pager refactoring - use git_get_paging_nav for pagination

Add git_get_paging_nav subroutine which returns string with pager
(paging nav) for shortlog and log actions.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Add "\n" after <br/> in git_page_nav
Jakub Narebski [Sun, 30 Jul 2006 14:14:43 +0000 (16:14 +0200)]
gitweb: Add "\n" after <br/> in git_page_nav

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Show project descriptions with utf-8 characters in project list correctly
Jakub Narebski [Sun, 30 Jul 2006 15:47:22 +0000 (17:47 +0200)]
gitweb: Show project descriptions with utf-8 characters in project list correctly

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
33 hours agogitweb: Replace form-feed character by ^L
Jakub Narebski [Sun, 30 Jul 2006 13:02:27 +0000 (15:02 +0200)]
gitweb: Replace form-feed character by ^L

Replace FORM FEED (FF) character (014, 12, 0xc) by it's textual
representation '^L'.  This character is used for example in GNU GPL
'COPYING' file.  With this patch "blob" output for COPYING passes
XHTML validation.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Navbar refactoring - use git_page_nav to generate navigation bar
Jakub Narebski [Sun, 30 Jul 2006 13:01:07 +0000 (15:01 +0200)]
gitweb: Navbar refactoring - use git_page_nav to generate navigation bar

Use git_page_nav subroutine to generate navigation bar.  Additional
navigation (either formats or pager/pagination) is put into variables.

Corrects error in git_search where hash parameter was added to
"summary" link instead of to "log" link.  Might differ from previous
version by additional "<br/>" in navigation bar.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Add git_page_nav for later use
Jakub Narebski [Sun, 30 Jul 2006 12:59:57 +0000 (14:59 +0200)]
gitweb: Add git_page_nav for later use

Adds git_page_nav subroutine to factor out the generation of the
navigation bar.  Based on Sven Verdoolaege code

  Message-Id: <redacted>
  http://marc.theaimsgroup.com/?l=git&m=111909432415478&w=2

I tried for the refactored navbar generate the same result.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Cleanup - chomp @lines in consistent style
Jakub Narebski [Sun, 30 Jul 2006 12:58:11 +0000 (14:58 +0200)]
gitweb: Cleanup - chomp @lines in consistent style

Use 'my @lines = map { chomp; $_ } <$fd>;' form to read all lines of
git command output into array without trailing newlines.

It has advantage over 'chomp (my (@lines) = <$fd>);' in that it does
not modify array.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Cleanup - chomp $line in consistent style
Jakub Narebski [Sun, 30 Jul 2006 02:08:17 +0000 (04:08 +0200)]
gitweb: Cleanup - chomp $line in consistent style

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: More explicit error messages for open "-|"
Jakub Narebski [Sat, 29 Jul 2006 21:01:00 +0000 (23:01 +0200)]
gitweb: More explicit error messages for open "-|"

Use more explicit error messages when failing magical "-|" open,
stating at least the name of the git command that failed.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: simplify git_get_hash_by_path
Jakub Narebski [Sat, 29 Jul 2006 20:55:01 +0000 (22:55 +0200)]
gitweb: simplify git_get_hash_by_path

Simplify git_get_hash_by_path by using git-ls-tree to do path
limiting, instead of finding correct ttree and parsing unconstrained
git-ls-tree output.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Use list for of open for running git commands, thorougly.
Jakub Narebski [Mon, 31 Jul 2006 01:28:34 +0000 (18:28 -0700)]
gitweb: Use list for of open for running git commands, thorougly.

Use list form of open for running git commands and reading their
output through pipe, for example

open my $fd, "-|", $GIT, "rev-list", "--header", "--parents", $hash

instead of

open my $fd, "-|", "$GIT rev-list --header --parents $hash"

Single letter options use ' instead of " as quotes, according to style
used in list form of magic "-|" open.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: whitespace cleanup
Jakub Narebski [Sat, 29 Jul 2006 20:43:40 +0000 (22:43 +0200)]
gitweb: whitespace cleanup

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: fix two warnings
Johannes Schindelin [Wed, 26 Jul 2006 14:58:35 +0000 (16:58 +0200)]
gitweb: fix two warnings

These warnings cluttered up my log.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: escape tag comments
Daniel Drake [Mon, 24 Jul 2006 22:07:23 +0000 (23:07 +0100)]
gitweb: escape tag comments

I have a tag with a comment which includes an & character. Firefox wouldn't
display my gitweb summary page due to malformed XML. This solves the problem.

Signed-off-by: Daniel Drake <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: git_blame2: slight optimization reading the blame lines
Luben Tuikov [Sun, 23 Jul 2006 21:17:48 +0000 (14:17 -0700)]
gitweb.cgi: git_blame2: slight optimization reading the blame lines

Eliminate git_read_blame_line() -- move that code inline and
optimize it.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: Centralize printing of the page path
Luben Tuikov [Sun, 23 Jul 2006 20:31:15 +0000 (13:31 -0700)]
gitweb.cgi: Centralize printing of the page path

Centralize printing of the page path so that
if the entity is a blob, we can set the page path
to be the link to the HEAD revision of the
"raw" blob.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: git_blame2: Revision blocks now have alternating colors
Luben Tuikov [Sun, 23 Jul 2006 20:37:53 +0000 (13:37 -0700)]
gitweb.cgi: git_blame2: Revision blocks now have alternating colors

A revision block is the largest number of adjacent
lines of code originating from the same revision.

This patch adds color to git_blame2(), in that no two
adjacent revision blocks have the same color.  The color
alternates between light and dark.

As we annotate the code lines, we alternate the color
(light, dark) of code lines _per revision_.  This makes it
easier to see line conglomerations per revision.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: Show "raw" head of project link even when $hash is not defined
Luben Tuikov [Sun, 23 Jul 2006 20:30:08 +0000 (13:30 -0700)]
gitweb.cgi: Show "raw" head of project link even when $hash is not defined

Some callers of git_history() do not set $hash of $file_name.
Add code to find it, if it is not defined.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: git_blame2: Allow back-trekking through commits
Luben Tuikov [Sun, 23 Jul 2006 20:36:32 +0000 (13:36 -0700)]
gitweb.cgi: git_blame2: Allow back-trekking through commits

This patch adds the capability of back-trekking through
commits from git_blame2() as follows:
blame2->commit->blame2->commit->blame2->...->initial commit.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: git_blame2: an alternative simple working git blame
Luben Tuikov [Sun, 23 Jul 2006 20:34:55 +0000 (13:34 -0700)]
gitweb.cgi: git_blame2: an alternative simple working git blame

This patch adds an alternative simple working git-blame
called git_blame2().  Simple, because it displays just
three columns: the commit, the line number and the line
of code.  Alternative, because the original git_blame()
is left untouched.  Lines of code are printed html
escaped, but as-is.

git_blame2() uses git-blame as opposed to git-annotate
used by git_blame().

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: Include direct link to "raw" files from "history"
Luben Tuikov [Sun, 23 Jul 2006 20:28:55 +0000 (13:28 -0700)]
gitweb.cgi: Include direct link to "raw" files from "history"

In "history" view, the "page_path" is now also a URL link to
the "raw" format of the file, which will always give you
the latest version in the repository.

This is helpful for externally linking files, such that
the latest version is always referenced and in "raw" format.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: Teach git_history() to read hash from $hash_base
Luben Tuikov [Sun, 23 Jul 2006 20:26:30 +0000 (13:26 -0700)]
gitweb.cgi: Teach git_history() to read hash from $hash_base

Teach git_history() to take its hash argument from
the hb parameter, i.e. from $hash_base.  Also change
all "a=history" actions to pass "hb=" instead of "h=".

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.css: Use monospace fonts for commits and tree-diff.
Luben Tuikov [Thu, 13 Jul 2006 19:36:22 +0000 (12:36 -0700)]
gitweb.css: Use monospace fonts for commits and tree-diff.

Use monospace fonts for the commit header, commit message,
and tree-diff.  This helps viewing commit logs with ASCII art.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Make command invocations go through the git wrapper
Alp Toker [Wed, 12 Jul 2006 22:55:10 +0000 (23:55 +0100)]
gitweb: Make command invocations go through the git wrapper

This patch makes invocations of core git commands go through the 'git'
binary itself, which improves readability and might help system
administrators lock down their CGI environment for security.

Signed-off-by: Alp Toker <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Include a site name in page titles
Alp Toker [Tue, 11 Jul 2006 20:10:26 +0000 (21:10 +0100)]
gitweb: Include a site name in page titles

This helps users tell one 'git' bookmark apart from the other in their
browser and improves the indexing of gitweb sites in Web search engines.
The title defaults to the SERVER_NAME environment variable, often given
by the webserver.

Signed-off-by: Alp Toker <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Send XHTML as 'application/xhtml+xml' where possible
Alp Toker [Tue, 11 Jul 2006 10:19:34 +0000 (11:19 +0100)]
gitweb: Send XHTML as 'application/xhtml+xml' where possible

"The 'text/html' media type [RFC2854] is primarily for HTML, not for
XHTML. In general, this media type is NOT suitable for XHTML."

This patch makes gitweb use content negotiation to conservatively send
pages as Content-Type 'application/xhtml+xml' when the user agent
explicitly claims to support it.

It falls back to 'text/html' even if the user agent appears to
implicitly support 'application/xhtml+xml' due to a '*/*' glob, working
around an insidious bug in Internet Explorer where sending the correct
media type prevents the page from being displayed.

Signed-off-by: Alp Toker <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: Teach "a=blob" action to know the blob/file mime type
Luben Tuikov [Mon, 10 Jul 2006 03:18:57 +0000 (20:18 -0700)]
gitweb.cgi: Teach "a=blob" action to know the blob/file mime type

Now action "blob" knows the file type: if the file type is
not "text/*" then action "blob" defaults to "blob_plain",
i.e. the file is downloaded raw for the browser to interpret.
If the file type is "text/*", then "blob" defaults to the
current "cat -n"-like output, from which you can click
"plain", to get the "blob_plain" output.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb.cgi: Create $git_temp if it doesn't exist
Luben Tuikov [Mon, 10 Jul 2006 03:07:27 +0000 (20:07 -0700)]
gitweb.cgi: Create $git_temp if it doesn't exist

Unless we'd done diffs, $git_temp doesn't exist and then
mime lookups fail.  Explicitly create it, if it doesn't
exist already.

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agoAdd "raw" output option to blobs in "tree" view format
Luben Tuikov [Fri, 7 Jul 2006 06:39:30 +0000 (23:39 -0700)]
Add "raw" output option to blobs in "tree" view format

Add a "raw" output option to blobs in "tree" view format, so that the
user doesn't have to click on "blob", wait for the (binary) file to be
uploaded and shown in "blob" mode, and then click on "plain" to
download the (binary) file.

This is useful when the file is clearly binary and we don't want the
browser to upload and display it in "blob" mode, but we just want to
download it.  Case in point: pdf files, wlg.

Note: the "raw" format is equivalent to the blob->plain view, not
blob->head view. I.e. the view has the hash of the file as listed
by git-ls-tree, not just "HEAD".

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Declare global variables with "our"
Dennis Stosberg [Wed, 21 Jun 2006 13:07:08 +0000 (15:07 +0200)]
gitweb: Declare global variables with "our"

Variables declared with "my" in the file scope cannot be accessed from
subroutines with mod_perl.

Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Enable tree (directory) history display
Luben Tuikov [Sat, 1 Jul 2006 02:11:18 +0000 (19:11 -0700)]
gitweb: Enable tree (directory) history display

This patch allows history display of whole trees/directories a la
"git-rev-list HEAD -- <dir or file>".  I find this useful especially
when a project lives in its own subdirectory, as opposed to being all
of the GIT repository (i.e. when a sub-project is merged into a
super-project).

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: optimize per-file history generation
Junio C Hamano [Sat, 1 Jul 2006 01:54:32 +0000 (18:54 -0700)]
gitweb: optimize per-file history generation

The rev-list command that is recent enough can filter commits
based on paths they touch, so use it instead of generating the
full list and limiting it by passing it with diff-tree --stdin.

[jc: The patch originally came from Luben Tuikov but the it was
 corrupt, but it was short enough to be applied by hand.  I
 added the --full-history to make the output compatible with the
 original while doing so.]

Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: whitespace cleanup around '='
Jakub Narebski [Thu, 22 Jun 2006 06:52:57 +0000 (08:52 +0200)]
gitweb: whitespace cleanup around '='

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Use $hash_base as $search_hash if possible
Timo Hirvonen [Tue, 20 Jun 2006 13:41:05 +0000 (16:41 +0300)]
gitweb: Use $hash_base as $search_hash if possible

$hash (h parameter) does not always point to a commit. Use $hash_base as
$search_hash when it is defined.

Signed-off-by: Timo Hirvonen <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: Make use of $PATH_INFO for project parameter
Jakub Narebski [Wed, 21 Jun 2006 15:06:39 +0000 (17:06 +0200)]
gitweb: Make use of $PATH_INFO for project parameter

Allow to have project name in the path part of URL, just after the name of
script. For example instead of gitweb.cgi?p=git.git you can write
gitweb.cgi/git.git or gitweb.cgi/git.git/

Not used in URLs inside gitweb; it means that the above alternate syntax
must be generated by hand, at least for now.

Side effect: project name parameter is now stripped of leading and
trailing slash before validation.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agoMove $gitbin earlier in gitweb.cgi
Jakub Narebski [Wed, 21 Jun 2006 07:48:04 +0000 (09:48 +0200)]
Move $gitbin earlier in gitweb.cgi

(cherry picked from 9dca843086356b964f27d8fabe1e3c48074a9f02 commit)

Signed-off-by: Jakub Narebski <jnareb.com>
Signed-off-by: Junio C Hamano <redacted>
2 days agoAdd git version to gitweb output
Jakub Narebski [Wed, 21 Jun 2006 07:48:03 +0000 (09:48 +0200)]
Add git version to gitweb output

Add git-core binaries used version as the comment at the beginning of HTML
output, just below the comment with version of git web interface version.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
2 days agogitweb: whitespace cleanup
Jakub Narebski [Wed, 21 Jun 2006 07:48:02 +0000 (09:48 +0200)]
gitweb: whitespace cleanup

Do not use tabs to align variable initialization (actually use
tabs only at the beginning of line, for code indent).  Remove trailing
whitespace.  Make whitespace usage more consistent.

Signed-off-by: Jakub Narebski <jnareb.com>
Signed-off-by: Junio C Hamano <redacted>
This page took 0.627936 seconds and 4 git commands to generate.