Commit graph

23 commits

Author SHA1 Message Date
Jakub Narebski 59e3b14e08 gitweb: New improved formatting of chunk header in diff
If we have provided enough info, and diff is not combined diff,
and if provided diff line is chunk header, then:
* split chunk header into .chunk_info and .section span elements,
  first containing proper chunk header, second section heading
  (aka. which function), for separate styling: the proper chunk
  header is on non-white background, section heading part uses
  slightly lighter color.
* hyperlink from-file-range to starting line of from-file, if file
  was not created.
* hyperlink to-file-range to starting line of to-file, if file
  was not deleted.
Links are of invisible variety (and "list" class).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-21 14:35:40 -08:00
Jakub Narebski 744d0ac33a gitweb: New improved patchset view
Replace "gitweb diff header" with its full sha1 of blobs and replace
it by "git diff" header and extended diff header. Change also somewhat
highlighting of diffs.

Added `file_type_long' subroutine to convert file mode in octal to
file type description (only for file modes which used by git).

Changes:
* "gitweb diff header" which looked for example like below:
    file:_<sha1 before>_ -> file:_<sha1 after>_
  where 'file' is file type and '<sha1>' is full sha1 of blob is
  changed to
    diff --git _a/<file before>_ _b/<file after>_
  In both cases links are visible and use default link style. If file
  is added, a/<file> is not hyperlinked. If file is deleted, b/<file>
  is not hyperlinked.
* there is added "extended diff header", with <path> and <hash>
  hyperlinked (and <hash> shortened to 7 characters), and <mode>
  explained: '<mode>' is extended to '<mode> (<file type description>)',
  where added text is slightly lighter to easy distinguish that it
  was added (and it is difference from git-diff output).
* from-file/to-file two-line header lines have slightly darker color
  than removed/added lines.
* chunk header has now delicate line above for easier finding chunk
  boundary, and top margin of 2px, both barely visible.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-08 12:34:19 -08:00
Jakub Narebski 403d0906e9 gitweb: Better git-unquoting and gitweb-quoting of pathnames
Extend unquote subroutine, which unquotes quoted and escaped filenames
which git may return, to deal not only with octal char sequence
quoting, but also quoting ordinary characters including '\"' and '\\'
which are respectively quoted '"' and '\', and to deal also with
C escape sequences including '\t' for TAB and '\n' for LF.

Add esc_path subroutine for gitweb quoting and HTML escaping filenames
(currently it does equivalent of ls' --hide-control-chars, which means
showing undisplayable characters (including '\n' and '\t') as '?'
(question mark) character, and use 'span' element with cntrl CSS class
to help rendering them differently.

Convert gitweb to use esc_path correctly to print pathnames.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-08 10:38:48 -08: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
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
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
Jakub Narebski 6fd92a28eb gitweb: Add author information to commitdiff view
Add subroutine git_print_authorship to print author and date of
commit, div.author_date style to CSS, and use them in git_commitdiff.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-28 16:21:34 -07:00
Jakub Narebski ef10ee877f gitweb: Add invisible hyperlink to from-file/to-file diff header
Change replacing hashes as from-file/to-file with filenames from
difftree to adding invisible (except underlining on hover/mouseover)
hyperlink to from-file/to-file blob.  /dev/null as from-file or
to-file is not changed (is not hyperlinked).

This makes two-file from-file/to-file unified diff header parsing in
git_patchset_body more generic, and not only for legacy blobdiffs.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25 19:41:12 -07:00
Jakub Narebski e4e4f82545 gitweb: Parse two-line from-file/to-file diff header in git_patchset_body
Parse two-line from-file/to-file unified diff header in
git_patchset_body directly, instead of leaving pretty-printing to
format_diff_line function.  Hashes as from-file/to-file are replaced
by proper from-file and to-file names (from $diffinfo); in the future
we can put hyperlinks there.  This makes possible to do blobdiff with
only blobs hashes.

The lines in two-line unified diff header have now class "from_file"
and "to_file"; the style is chosen to match previous output (classes
"rem" and "add" because of '-' and '+' as first character of patch
line).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25 19:41:09 -07:00
Jakub Narebski af33ef21bf gitweb: Show information about incomplete lines in commitdiff
In format_diff_line, instead of skipping errors/incomplete lines,
for example
  "\ No newline at end of file"
in HTML pretty-printing of diff, use "incomplete" class for div.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25 19:29:36 -07:00
Jakub Narebski 63e4220b75 gitweb: Replace some presentational HTML by CSS
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22 15:51:01 -07:00
Jakub Narebski 7c27801473 gitweb: bugfix: a.list formatting regression
Fix regression introduced by
commit 17d0744318.

"a.list" being "bold", makes a myriad of things shown by
gitweb in bold font-weight, which is a regression from
pre-17d07443188909ef5f8b8c24043cb6d9fef51bca behavior.

The fix is to add "subject" class and use this class
to replace pre-format_subject_html formatting of subject
(comment) via using (or not) <b>...</b> element. This
should go back to the pre-17d0744318... style.

Regression noticed by Luben Tuikov.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22 15:50:54 -07:00
Jakub Narebski 4a4a1a53d1 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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 17:40:50 -07:00
Jakub Narebski d294e1cad4 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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 17:28:01 -07:00
Jakub Narebski 17d0744318 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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 17:02:42 -07:00
Luben Tuikov 82f930dead 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 <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-07 18:15:29 -07:00
Jakub Narebski 9f5dcb8168 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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 03:09:28 -07:00
Luben Tuikov 4b7ce6e2d6 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 <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 22:02:43 -07:00
Jakub Narebski 7a9b4c5fe3 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 <junkio@cox.net>
2006-06-21 02:02:00 -07:00
Jakub Narebski 1f1ab5f05b gitweb: style done with stylesheet
Replace (almost) all 'style' attributes with 'class' attribute
and adding rule to CSS file. Some tables use CSS for styling
instead of legacy styling attributes.

[jc: too many rejects -- hand fixed and reindented]
2006-06-20 14:01:13 -07:00
Jakub Narebski 75c84ddb46 Make CSS file gitweb/gitweb.css more readable
Taken from git://git.xmms.se/xmms2/gitweb-xmms2.git
commit  561262030d58a6325f500b36d836dbe02a5abc68
"Make CSS readable" by Daniel Svensson, with extra
parts removed and consistent whitespace usage.

[jc: tabified the results to cleaning things up, and removed an
 added item that was commented out. ]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19 13:13:07 -07:00
Jakub Narebski c729127ca7 Fix gitweb stylesheet
An earlier commit forgot to move some piece from the CGI script
to the external stylesheet.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 21:19:14 -07:00
Jakub Narebski aedd9425ce Move gitweb style to gitweb.css
Move gitweb style from embedded <style> element in gitweb/gitweb.cgi
to external CSS file gitweb/gitweb.css.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 21:19:13 -07:00