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 <junkio@cox.net>
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 <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Use the normal web server instead of the CGI to provide the git logo,
just like the gitweb.css.
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Slightly reworking git_project_list, including moving setting $order,
as it is used only in this action. Mostly reindent.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <junkio@cox.net>
Reorder gitweb code around, divide it into sections (categories) and
add some comments.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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
( as a contents of link) to having $project as contents/name
of link. Sometimes a little reordering.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Add git_get_paging_nav subroutine which returns string with pager
(paging nav) for shortlog and log actions.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
From 2be5cab10486cba804ccae063e93b146288054fe Mon Sep 17 00:00:00 2001
From: Jakub Narebski <jnareb@gmail.com>
Date: Sun, 30 Jul 2006 13:11:56 +0200
Subject: [PATCH]
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Adds git_page_nav subroutine to factor out the generation of the
navigation bar. Based on Sven Verdoolaege code
Message-Id: <20050618113121.GA13122@pc117b.liacs.nl>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Since you can tar just a subdirectory of a certain revision, tell
the users so, by showing an example how to do it.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
With this, the configuration mechanism can be used to say:
[alias]
init = init-db --template=/path/to/template
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Earlier we barfed when GIT_DIR environment variable points at a
directory yet to be created, which made it impossible to use
configuration mechanism in "git-init-db".
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Patch from Petr Salinger to make the build process detect and support the
Debian GNU/kFreeBSD architecture, see
http://bugs.debian.org/380209
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
* lt/web:
gitweb.cgi: git_blame2: slight optimization reading the blame lines
gitweb.cgi: git_blame2: Revision blocks now have alternating colors
gitweb.cgi: git_blame2: Allow back-trekking through commits
gitweb.cgi: git_blame2: an alternative simple working git blame
* jn/make:
Set datarootdir in config.mak.in
Quote all calls to GIT_CONF_APPEND_LINE
Typofix in configure.ac comment.
configure.ac vertical whitespace usage cleanup
autoconf: Checks for some programs
autoconf: Checks for libraries
autoconf: Checks for some library functions.
autoconf: Checks for typedefs, structures, and compiler characteristics.
autoconf: Preparing the way for autodetection
Copy description of build configuration variables to configure.ac
Teach make clean about configure and autoconf
autoconf: Use autoconf to write installation directories to config.mak.autogen
This merges the new built-in calling convention code into Johannes's
builtin-mv topic in order to resolve their conflicts early on.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This changes the calling convention of built-in commands and
passes the "prefix" (i.e. pathname of $PWD relative to the
project root level) down to them.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Any git command that expects to work in a subdirectory of a project, and
that reads the git config files (which is just about all of them) needs to
make sure that it does the "setup_git_directory()" call before it tries to
read the config file.
This means, among other things, that we need to move the call out of
"init_revisions()", and into the caller.
This does the mostly trivial conversion to do that.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Alex Riesen (raa.lkml@gmail.com) recently observed that git branch
would fail with no error message due to unexpected situations with
regards to refs. For example, if .git/refs/heads/gu is a file but
"git branch -b refs/heads/gu/fixa HEAD" was invoked by the user
it would fail silently due to refs/heads/gu being a file and not
a directory.
This change adds a test for trying to create a ref within a directory
that is actually currently a file, and adds error printing within
the ref locking routine should the resolve operation fail.
The error printing code probably belongs at this level of the library
as other failures within the ref locking, writing and logging code
are also currently at this level of the code.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
With the latest changes in fetch.c, http-fetch crashed accessing
write_ref[i], where write_ref was NULL.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
* pb/multi-fetch:
Teach git-http-fetch the --stdin switch
Teach git-local-fetch the --stdin switch
Make pull() support fetching multiple targets at once
Make pull() take some implicit data as explicit arguments