1
0
mirror of https://github.com/git/git.git synced 2024-10-05 04:32:10 +02:00
Commit Graph

268 Commits

Author SHA1 Message Date
Petr Baudis
8be2890c99 gitweb: Do not automatically append " git" to custom site name
If you customized the site name, you probably do not want the " git"
appended so that the page title is not bastardized; I want repo.or.cz pages
titled "Public Git Hosting", not "Public Git Hosting git" (what's hosting
what?).

This slightly changes the $site_name semantics but only very
insignificantly.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:55:41 -07:00
Petr Baudis
88ad729b73 gitweb: Make search type a popup menu
This makes the multiple search types actually usable by the user;
if you don't read the gitweb source, you don't even have an idea
that you can write things like that there.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:55:38 -07:00
Petr Baudis
4777b0141a gitweb: Restore object-named links in item lists
This restores the redundant links removed earlier. It supersedes my patch
to stick slashes to tree entries.

Sorry about the previous version of the patch, an unrelated snapshot link
addition to tree entries slipped through (and it it didn't even compile);
I've dropped the idea of snapshot links in tree entries in the meantime
anyway.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 20:55:26 -07:00
Junio C Hamano
ccbb3d17ac Merge branch 'master' into jc/web
* master: (114 commits)
  gitweb: Fix setting $/ in parse_commit()
  daemon: do not die on older clients.
  xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
  git-clone: honor --quiet
  Documentation for the [remote] config
  prune-packed: Fix uninitialized variable.
  ignore-errors requires cl
  git-send-email: do not pass custom Date: header
  Use column indexes in git-cvsserver where necessary.
  gitweb: Add '..' (up directory) to tree view if applicable
  gitweb: Improve git_print_page_path
  pager: default to LESS=FRSX not LESS=FRS
  Make prune also run prune-packed
  git-vc: better installation instructions
  gitweb: Do not esc_html $basedir argument to git_print_tree_entry
  gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)
  Fix usagestring for git-branch
  git-merge: show usage if run without arguments
  add the capability for index-pack to read from a stream
  git-clone: define die() and use it.
  ...
2006-10-23 20:53:38 -07:00
Junio C Hamano
1259404c7e Merge branch 'maint'
* maint:
  gitweb: Fix setting $/ in parse_commit()
  daemon: do not die on older clients.
  xdiff/xemit.c (xdl_find_func): Elide trailing white space in a context header.
  git-clone: honor --quiet
  Documentation for the [remote] config
  prune-packed: Fix uninitialized variable.
2006-10-23 19:29:05 -07:00
Petr Baudis
a153adf683 gitweb: Fix setting $/ in parse_commit()
If the commit couldn't have been read, $/ wasn't restored to \n properly,
causing random havoc like git_get_ref_list() returning the ref names with
trailing \n.

Aside of potential confusion in the body of git_search(), no other $/
surprises are hopefully hidden in the code.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 19:21:05 -07:00
Jakub Narebski
b6b7fc7283 gitweb: Add '..' (up directory) to tree view if applicable
Adds '..' (up directory) link at the top of "tree" view listing,
if both $hash_base and $file_name are provided, and $file_name
is not empty string.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 22:54:08 -07:00
Jakub Narebski
4df118ed60 gitweb: Improve git_print_page_path
Add link to "tree root" (root directory) also for not defined name,
for example for "tree" action without defined "file_name" which means
"tree root".

Add " / " at the end of path when $type eq "tree".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 22:54:08 -07:00
Junio C Hamano
02a20456d2 Merge branch 'maint'
* maint:
  pager: default to LESS=FRSX not LESS=FRS
  Make prune also run prune-packed
  git-vc: better installation instructions
  gitweb: Do not esc_html $basedir argument to git_print_tree_entry
  gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)
  Fix usagestring for git-branch
  git-merge: show usage if run without arguments
2006-10-22 22:40:30 -07:00
Jakub Narebski
300454feab gitweb: Do not esc_html $basedir argument to git_print_tree_entry
In git_tree, rename $base variable (which is passed as $basedir
argument to git_print_tree_entry) to $basedir. Do not esc_html
$basedir, as it is part of file_name ('f') argument in link and not
printed. Add '/' at the end only if $basedir is not empty (it is empty
for top directory) and doesn't end in '/' already.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 13:24:37 -07:00
Jakub Narebski
e7fb022a42 gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)
Code should be aligned the same way, regardless of tab size.
Use tabs for indent, but spaces for align.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 12:56:41 -07:00
Junio C Hamano
72bbc38b0a Merge branch 'mw/pathinfo'
* mw/pathinfo:
  gitweb: Fix search form when PATH_INFO is enabled
  gitweb: Document features better
  gitweb: warn if feature cannot be overridden.
  gitweb: start to generate PATH_INFO URLs.

Conflicts:

	gitweb/README
2006-10-18 22:09:11 -07:00
Junio C Hamano
63e02a1be3 gitweb: use for-each-ref to show the latest activity across branches
The project list page shows last change from the HEAD branch but
often people would want to view activity on any branch.

Unfortunately that is fairly expensive without the core-side
support.  for-each-ref was invented exactly for that.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-15 03:29:09 -07:00
Petr Baudis
34c06118ed gitweb: Fix search form when PATH_INFO is enabled
Currently that was broken. Ideal fix would make the search form use
PATH_INFO too, but it's just one insignificant place so it's no big deal if
we don't for now... This at least makes it work.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-11 14:42:22 -07:00
Jakub Narebski
9a7a62ff71 gitweb: Cleanup Git logo and Git logo target generation
Rename $githelp_url and $githelp_label to $logo_url and $logo_label to
be more obvious what they refer to; while at it add commented out
previous contents (git documentation at kernel.org). Add comment about
logo size.

Use $cgi->a(...) to generate Git logo link; it automatically escapes
attribute values when it is needed.  Escape href attribute using
esc_url instead of (incorrect!) esc_html.

Move styling of git logo <img> element from "style" attribute to CSS
via setting class to "logo".  Perhaps we should set it by id rather
than by class.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-08 13:36:58 -07:00
Petr Baudis
45a3b12cfd gitweb: Document features better
This expands gitweb/README to talk some more about GITWEB_CONFIG, moves
feature-specific documentation in gitweb.cgi to the inside of the %features
array, and adds some short description of all the features.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-07 23:12:12 -07:00
Petr Baudis
a144154f85 gitweb: [commit view] Do not suppress commitdiff link in root commit
There's no reason for that, the commitdiff view is meaningful for the
root commit as well and we link to it everywhere else.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-07 02:19:17 -07:00
Petr Baudis
7e0fe5c939 gitweb: Handle commits with empty commit messages more reasonably
Currently those look very weird, you can't get easily at the commit view
etc. This patch makes their title '(no commit message)'.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-07 02:16:33 -07:00
Petr Baudis
689b7f5ccb gitweb: Separate (new) and (deleted) in commitdiff by a space
Currently it's pasted to the sha1 of the blob and looks ugly.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-07 02:16:22 -07:00
Petr Baudis
55ff35cb64 Show snapshot link in shortlog only if have_snapsho
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-07 01:38:46 -07:00
Yasushi SHOJI
847abc0f2a gitweb: refactor decode() for utf8 conversion
we already had a few place using decode() to convert perl internal
encode to utf8.  added a new thin wrapper to do just that.

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-06 02:56:50 -07:00
Junio C Hamano
51a7c66a73 gitweb: Make the Git logo link target to point to the homepage
It provides more useful information for causual Git users than the Git docs
(especially about where to get Git and such).

People can override with GITWEB_CONFIG if they want to.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Petr Baudis <pasky@suse.cz>
2006-10-05 15:02:13 -07:00
Luben Tuikov
db94b41aee gitweb: blame: Minimize vertical table row padding
Minimize vertical table row padding for blame only.  I
discovered this while having the browser's blame output
right next to my editor's window, only to notice how much
vertically stretched the blame output was.

Blame most likely shows source code and is in this way
more "spartan" than the rest of the tables gitweb shows.

This patch makes the blame table more vertically compact,
thus being closer to what you'd see in your editor's window,
as well as reusing more window estate to show more
information (which in turn minimizes scrolling).

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05 14:21:12 -07:00
Luben Tuikov
6e0e92fda8 gitweb: Do not print "log" and "shortlog" redundantly in commit view
Do not print "log" and "shortlog" redundantly in commit
view.  This is passed into the $extra argument of
git_print_page_nav from git_commit, but git_print_page_nav
prints "log" and "shortlog" already with the same head.

Noticed by Junio.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05 13:05:00 -07:00
Junio C Hamano
9ccb64c8e0 tar-tree deprecation: we eat our own dog food.
It is silly to keep using git-tar-tree in dist target when the
command gives a big deprecation warning when called.  Instead,
use "git-archive --format=tar" which we recommend to our users.

Update gitweb's snapshot feature to use git-archive for the same
reason.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05 02:26:12 -07:00
Martin Waitz
a945591906 gitweb: warn if feature cannot be overridden.
If the administrator configures pathinfo to be overrideable by the
local repository a warning is shown.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-04 23:02:31 -07:00
Alan Chandler
b2d3476e15 Gitweb - provide site headers and footers
This allows web sites with a header and footer standard for each page
to add them to the pages produced by gitweb.

Two new variables $site_header and $site_footer are defined (default
to null) each of which can specify a file containing the header and
footer html.

In addition, if the $stylesheet variable is undefined, a new array
@stylesheets (which defaults to a single element of gitweb.css) can be
used to specify more than one style sheet.  This allows the clasical
gitweb.css styles to be retained, but a site wide style sheet used
within the header and footer areas.

Signed-off-by: Alan Chandler <alan@chandlerfamily.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-04 15:00:49 -07:00
Luben Tuikov
c8aeaaf7fc gitweb: blame: Mouse-over commit-8 shows author and date
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-04 14:56:50 -07:00
Luben Tuikov
9dc5f8c9c2 gitweb: blame: print commit-8 on the leading row of a commit-block
Print commit-8 only on the first, leading row of
a commit block, to complement the per-commit block coloring.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-04 14:56:13 -07:00
Junio C Hamano
9074484a2b Revert 954a6183756a073723a7c9fd8d2feb13132876b0
Luben makes a good argument against it, and I agree with him in general.
The clickable handle that appear at seemingly random places makes them
look as if they are separating groups when it is not.

This also restores the executable bit I lost by mistake.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-04 14:55:16 -07:00
Alan Chandler
604cb211a9 Update the gitweb/README file to include setting the GITWEB_CONFIG environment
Signed-off-by: Alan Chandler <alan@chandlerfamily.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-03 23:58:38 -07:00
Junio C Hamano
2172ce4b01 gitweb: prepare for repositories with packed refs.
When a repository is initialized long time ago with symbolic
HEAD, and "git-pack-refs --prune" is run, HEAD will be a
dangling symlink to refs/heads/ somewhere.

Running -e "$dir/HEAD" to guess if $dir is a git repository does
not give us the right answer anymore in such a case.

Also factor out two places that checked if the repository can be
exported with similar code into a call to a new function,
check_export_ok.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-03 02:30:47 -07:00
Junio C Hamano
954a618375 gitweb: make leftmost column of blame less cluttered.
Instead of labelling each and every line with clickable commit
object name, this makes the blame output to show them only on
the first line of each group of lines from the same revision.
Placing too many lines in one group would make the commit object
name to appear too widely separated and also makes it consume
more memory, the number of lines in one group is capped to 20
lines or so.

Also it makes mouse-over to show the minimum authorship and
authordate information for extra cuteness ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-03 01:10:03 -07:00
Martin Waitz
128eead198 gitweb: document webserver configuration for common gitweb/repo URLs.
Add a small apache configuration which shows how to use apache
to put gitweb and GIT repositories at the same URL.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-03 01:09:56 -07:00
Luben Tuikov
e70866f53a gitweb: Escape ESCAPE (\e) character
Take a look at commit 20a3847d8a5032ce41f90dcc68abfb36e6fee9b1
using gitweb before this patch.  This patch fixes this.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-03 01:04:41 -07:00
Martin Waitz
9e756904d0 gitweb: start to generate PATH_INFO URLs.
Instead of providing the project as a ?p= parameter it is simply appended to
the base URI.  All other parameters are appended to that, except for ?a=summary
which is the default and can be omitted.

The this can be enabled with the "pathinfo" feature in gitweb_config.perl.

[jc: let's introduce new features disabled by default not to
 upset too many existing installations.]

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-02 00:49:42 -07:00
Junio C Hamano
99692dc213 Merge branch 'lt/web'
* lt/web:
  gitweb: tree view: hash_base and hash are now context sensitive
  gitweb: History: blob and tree are first, then commitdiff, etc
  gitweb: Remove redundant "commit" from history
  gitweb: Don't use quotemeta on internally generated strings
  gitweb: Add snapshot to shortlog
  gitweb: Factor out gitweb_have_snapshot()
  gitweb: Remove redundant "commit" link from shortlog
  gitweb: "alternate" starts with shade (i.e. 1)
  gitweb: Add history and blame to git_difftree_body()
  gitweb: Remove excessively redundant entries from git_difftree_body
  Revert "gitweb: extend blame to show links to diff and previous"
  gitweb: Quote filename in HTTP Content-Disposition: header
  gitweb: Add git_url subroutine, and use it to quote full URLs
  gitweb: Split validate_input into validate_pathname and validate_refname
  gitweb: Use "return" instead of "return undef" for some subs
  gitweb: Strip trailing slashes from $path in git_get_hash_by_path
  gitweb: extend blame to show links to diff and previous
  gitweb: Remove redundant "tree" link
  gitweb: tree view: eliminate redundant "blob"
2006-09-30 21:27:51 -07:00
Luben Tuikov
6f7ea5fb33 gitweb: tree view: hash_base and hash are now context sensitive
In tree view, by default, hash_base is HEAD and hash is the
entry equivalent.  Else the user had selected a hash_base or
hash, say by clicking on a revision or commit, in which case
those values are used.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-30 00:23:23 -07:00
Luben Tuikov
6d81c5a2ea gitweb: History: blob and tree are first, then commitdiff, etc
Reorder link display in history to be consistent with other
list displays: log, shortlog, etc.  We now display:

	blob | commitdiff
	blob | commitdiff | diff_to_current

and

	tree | commitdiff

Instead of the old history format where "blob" and "tree"
are between "commitdiff" and "diff_to_current" if present/
applicable.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 19:04:01 -07:00
Luben Tuikov
e46b3c027e gitweb: Remove redundant "commit" from history
Remove redundant "commit" from history -- it can be had
by clicking on the title of the commit.  This commit
makes visualization consistent with shortlog, log, etc.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 19:03:28 -07:00
Luben Tuikov
a2a3bf7b2b gitweb: Don't use quotemeta on internally generated strings
Do not use quotemeta on internally generated strings
such as filenames of snapshot, blobs, etc.
quotemeta quotes any characters not matching /A-Za-z_0-9/.
Which means that we get strings like this:

before: linux\-2\.6\.git\-5c2d97cb31fb77981797fec46230ca005b865799\.tar\.gz
after:  linux-2.6.git-5c2d97cb31fb77981797fec46230ca005b865799.tar.gz

This patch fixes this.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 18:58:16 -07:00
Luben Tuikov
ba6ef81017 gitweb: Add snapshot to shortlog
Add snapshot to each commit-row of shortlog.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 18:57:00 -07:00
Luben Tuikov
de9272f4bd gitweb: Factor out gitweb_have_snapshot()
Create gitweb_have_snapshot() which returns true
of snapshot is available and enabled, else false.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 18:56:35 -07:00
Luben Tuikov
d1d866e9b8 gitweb: Remove redundant "commit" link from shortlog
Remove the redundant "commit" link from shortlog.
It can be had by simply clicking on the entry title
of the row.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 18:52:36 -07:00
Luben Tuikov
6dd36acd32 gitweb: "alternate" starts with shade (i.e. 1)
When displaying a list of rows (difftree, shortlog, etc),
the first entry is now printed shaded, i.e. alternate is
initialized to 1, as opposed to non-shaded (alternate
initialized to 0).

This solves the problem when there is only one row to
display -- it is displayed shaded to visually indicate that
it is "active", part of a "list", etc.

(Compare this to the trivial case of more than one entry,
where the rows have alternating shade, thus suggesting
being part of a "list" of "active" entries, etc.)

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 18:52:26 -07:00
Luben Tuikov
eb51ec9c05 gitweb: Add history and blame to git_difftree_body()
Add blame and history to Deleted files.
Add blame and history to Modified or Type changed files.
Add blame and history to Renamed or Copied files.

This allows us to do
	blame->commit->blame->commit->blame->...
instead of
	blame->commit->file->blame->commit->file->blame->...
which is longer and easier to get wrong.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-27 21:56:59 -07:00
Luben Tuikov
499faeda1b gitweb: Remove excessively redundant entries from git_difftree_body
1) All entries on the left are blobs and clicking on them
leads to blobs.  No more diff or blob depending on what
happened (modified or mode changed) to the file -- this goes
to the right, in the "link" column.

2) Remove redundant "blob" from the link column on the right.
This can now be had by clicking on the entry itself.

This reduces and simplifies the code.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-27 21:30:01 -07:00
Luben Tuikov
709f898dae Revert "gitweb: extend blame to show links to diff and previous"
This concept is very fine, but it makes blame slow
across renames and across branches, so revert it.
There is a better way to do this.

This reverts commit 03d06a8e26f4fbd37800d1e1125c6ecf4c104466.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-27 21:29:10 -07:00
Jakub Narebski
ab41dfbfd4 gitweb: Quote filename in HTTP Content-Disposition: header
Finish work started by commit a2f3db2 (although not documented
in commit message) of quoting using quotemeta the filename in
HTTP -content_disposition header.

Just in case filename contains end of line character.

Also use consistent coding style to compute -content_disposition
parameter.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-27 00:41:36 -07:00
Jakub Narebski
f93bff8d45 gitweb: Add git_url subroutine, and use it to quote full URLs
Add git_url subroutine, which does what git_param did before commit
a2f3db2f5de2a3667b0e038aa65e3e097e642e7d, and is used to quote full
URLs, currently only $home_link.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-27 00:41:35 -07:00