* [PATCH 0/3] minor gitweb modifications @ 2010-12-16 21:43 Sylvain Rabot 2010-12-16 21:43 ` [PATCH 1/3] gitweb: add extensions to highlight feature Sylvain Rabot ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: Sylvain Rabot @ 2010-12-16 21:43 UTC (permalink / raw) To: git; +Cc: Sylvain Rabot Hi, here a three patch serie with minor updates for gitweb based on master. I'm not really fond of the third patch but it solves a problem I've encountered on several files. Regards. Sylvain Rabot (3): gitweb: add extensions to highlight feature gitweb: decorate a bit more remotes gitweb: remove test when closing file descriptor gitweb/gitweb.perl | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) -- 1.7.3.2 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/3] gitweb: add extensions to highlight feature 2010-12-16 21:43 [PATCH 0/3] minor gitweb modifications Sylvain Rabot @ 2010-12-16 21:43 ` Sylvain Rabot 2010-12-16 22:22 ` Jakub Narebski 2010-12-16 21:43 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot 2010-12-16 21:43 ` [PATCH 3/3] gitweb: remove test when closing file descriptor Sylvain Rabot 2 siblings, 1 reply; 16+ messages in thread From: Sylvain Rabot @ 2010-12-16 21:43 UTC (permalink / raw) To: git; +Cc: Sylvain Rabot added: sql, php5, phps, bash, zsh, mk Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> --- gitweb/gitweb.perl | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index d521c93..db18d06 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -250,13 +250,14 @@ our %highlight_ext = ( # main extensions, defining name of syntax; # see files in /usr/share/highlight/langDefs/ directory map { $_ => $_ } - qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl), + qw(py c cpp rb java css php pl js tex bib xml awk bat ini spec tcl sql), # alternate extensions, see /etc/highlight/filetypes.conf 'h' => 'c', + map { $_ => 'sh' } qw(bash zsh), map { $_ => 'cpp' } qw(cxx c++ cc), - map { $_ => 'php' } qw(php3 php4), + map { $_ => 'php' } qw(php3 php4 php5 phps), map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi' - 'mak' => 'make', + map { $_ => 'make'} qw(mak mk), map { $_ => 'xml' } qw(xhtml html htm), ); -- 1.7.3.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] gitweb: add extensions to highlight feature 2010-12-16 21:43 ` [PATCH 1/3] gitweb: add extensions to highlight feature Sylvain Rabot @ 2010-12-16 22:22 ` Jakub Narebski 2010-12-16 22:33 ` Sylvain Rabot 0 siblings, 1 reply; 16+ messages in thread From: Jakub Narebski @ 2010-12-16 22:22 UTC (permalink / raw) To: Sylvain Rabot; +Cc: git, Jakub Narebski Sylvain Rabot <sylvain@abstraction.fr> writes: > added: sql, php5, phps, bash, zsh, mk > There is one issue with this patch (see below), but otherwise I like it. > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> > --- > gitweb/gitweb.perl | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index d521c93..db18d06 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -250,13 +250,14 @@ our %highlight_ext = ( > # main extensions, defining name of syntax; > # see files in /usr/share/highlight/langDefs/ directory > map { $_ => $_ } > - qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl), > + qw(py c cpp rb java css php pl js tex bib xml awk bat ini spec tcl sql), Why did you remove 'sh' => 'sh' mapping? Shouldn't it be - qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl), + qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql), > # alternate extensions, see /etc/highlight/filetypes.conf > 'h' => 'c', > + map { $_ => 'sh' } qw(bash zsh), Good idea. > map { $_ => 'cpp' } qw(cxx c++ cc), > - map { $_ => 'php' } qw(php3 php4), > + map { $_ => 'php' } qw(php3 php4 php5 phps), Good idea. > map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi' > - 'mak' => 'make', > + map { $_ => 'make'} qw(mak mk), Good idea. Sidenote: git itself uses *.mak extension. Is *.mk popular? > map { $_ => 'xml' } qw(xhtml html htm), > ); > > -- > 1.7.3.2 > -- Jakub Narebski Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] gitweb: add extensions to highlight feature 2010-12-16 22:22 ` Jakub Narebski @ 2010-12-16 22:33 ` Sylvain Rabot 2010-12-17 11:17 ` Jakub Narebski 0 siblings, 1 reply; 16+ messages in thread From: Sylvain Rabot @ 2010-12-16 22:33 UTC (permalink / raw) To: Jakub Narebski; +Cc: git [-- Attachment #1: Type: text/plain, Size: 2089 bytes --] On Thu, 2010-12-16 at 14:22 -0800, Jakub Narebski wrote: > Sylvain Rabot <sylvain@abstraction.fr> writes: > > > added: sql, php5, phps, bash, zsh, mk > > > > There is one issue with this patch (see below), but otherwise I like > it. > > > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> > > --- > > gitweb/gitweb.perl | 7 ++++--- > > 1 files changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > > index d521c93..db18d06 100755 > > --- a/gitweb/gitweb.perl > > +++ b/gitweb/gitweb.perl > > @@ -250,13 +250,14 @@ our %highlight_ext = ( > > # main extensions, defining name of syntax; > > # see files in /usr/share/highlight/langDefs/ directory > > map { $_ => $_ } > > - qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl), > > + qw(py c cpp rb java css php pl js tex bib xml awk bat ini spec tcl sql), > > Why did you remove 'sh' => 'sh' mapping? Shouldn't it be > > - qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl), > + qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql), > I removed it on purpose but should have not, I was thinking the mapping made below would be enough but no, you're right. > > # alternate extensions, see /etc/highlight/filetypes.conf > > 'h' => 'c', > > + map { $_ => 'sh' } qw(bash zsh), > > Good idea. Does ksh, csh can be highlighted as sh too ? > > > map { $_ => 'cpp' } qw(cxx c++ cc), > > - map { $_ => 'php' } qw(php3 php4), > > + map { $_ => 'php' } qw(php3 php4 php5 phps), > > Good idea. > > > map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi' > > - 'mak' => 'make', > > + map { $_ => 'make'} qw(mak mk), > > Good idea. > > Sidenote: git itself uses *.mak extension. Is *.mk popular? Don't know but mk is mapped to Makefiles in the gtksourceview lib so I added it here. > > > map { $_ => 'xml' } qw(xhtml html htm), > > ); > > > > -- > > 1.7.3.2 > > > -- Sylvain Rabot <sylvain@abstraction.fr> [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 490 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/3] gitweb: add extensions to highlight feature 2010-12-16 22:33 ` Sylvain Rabot @ 2010-12-17 11:17 ` Jakub Narebski 0 siblings, 0 replies; 16+ messages in thread From: Jakub Narebski @ 2010-12-17 11:17 UTC (permalink / raw) To: Sylvain Rabot; +Cc: git On Thu, 16 Dec 2010, Sylvain Rabot wrote: > On Thu, 2010-12-16 at 14:22 -0800, Jakub Narebski wrote: > > Sylvain Rabot <sylvain@abstraction.fr> writes: > > > # alternate extensions, see /etc/highlight/filetypes.conf > > > 'h' => 'c', > > > + map { $_ => 'sh' } qw(bash zsh), > > > > Good idea. > > Does ksh, csh can be highlighted as sh too ? My /etc/highlight/filetypes.conf does include only $ext(sh)=bash All of bash, zsh and ksh are POSIX shell (sh) compatibile, so sh syntax (which is according to my /usr/share/highlight/langDefs/sh.lang file "Bash script language definition file" ;-)) should work. csh IIRC isn't. So therefore I am not sure if csh can be highlighted correctly using sh syntax. -- Jakub Narebski Poland ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/3] gitweb: decorate a bit more remotes 2010-12-16 21:43 [PATCH 0/3] minor gitweb modifications Sylvain Rabot 2010-12-16 21:43 ` [PATCH 1/3] gitweb: add extensions to highlight feature Sylvain Rabot @ 2010-12-16 21:43 ` Sylvain Rabot 2010-12-16 22:23 ` Jakub Narebski 2010-12-16 21:43 ` [PATCH 3/3] gitweb: remove test when closing file descriptor Sylvain Rabot 2 siblings, 1 reply; 16+ messages in thread From: Sylvain Rabot @ 2010-12-16 21:43 UTC (permalink / raw) To: git; +Cc: Sylvain Rabot Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> --- gitweb/gitweb.perl | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index db18d06..9398475 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5127,13 +5127,13 @@ sub git_remote_block { if (defined $fetch) { if ($fetch eq $push) { - $urls_table .= format_repo_url("URL", $fetch); + $urls_table .= format_repo_url("<strong>URL:</strong>", $fetch); } else { - $urls_table .= format_repo_url("Fetch URL", $fetch); - $urls_table .= format_repo_url("Push URL", $push) if defined $push; + $urls_table .= format_repo_url("<strong>Fetch URL:</strong>", $fetch); + $urls_table .= format_repo_url("<strong>Push URL:</strong>", $push) if defined $push; } } elsif (defined $push) { - $urls_table .= format_repo_url("Push URL", $push); + $urls_table .= format_repo_url("<strong>Push URL:</strong>", $push); } else { $urls_table .= format_repo_url("", "No remote URL"); } -- 1.7.3.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] gitweb: decorate a bit more remotes 2010-12-16 21:43 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot @ 2010-12-16 22:23 ` Jakub Narebski 2010-12-20 12:04 ` Drew Northup 0 siblings, 1 reply; 16+ messages in thread From: Jakub Narebski @ 2010-12-16 22:23 UTC (permalink / raw) To: Sylvain Rabot; +Cc: git, Jakub Narebski Sylvain Rabot <sylvain@abstraction.fr> writes: > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> > --- > gitweb/gitweb.perl | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index db18d06..9398475 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -5127,13 +5127,13 @@ sub git_remote_block { > > if (defined $fetch) { > if ($fetch eq $push) { > - $urls_table .= format_repo_url("URL", $fetch); > + $urls_table .= format_repo_url("<strong>URL:</strong>", $fetch); I would really prefer to use CSS for that... -- Jakub Narebski Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] gitweb: decorate a bit more remotes 2010-12-16 22:23 ` Jakub Narebski @ 2010-12-20 12:04 ` Drew Northup 0 siblings, 0 replies; 16+ messages in thread From: Drew Northup @ 2010-12-20 12:04 UTC (permalink / raw) To: Jakub Narebski; +Cc: Sylvain Rabot, git On Thu, 2010-12-16 at 14:23 -0800, Jakub Narebski wrote: > Sylvain Rabot <sylvain@abstraction.fr> writes: > > > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> > > --- > > gitweb/gitweb.perl | 8 ++++---- > > 1 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > > index db18d06..9398475 100755 > > --- a/gitweb/gitweb.perl > > +++ b/gitweb/gitweb.perl > > @@ -5127,13 +5127,13 @@ sub git_remote_block { > > > > if (defined $fetch) { > > if ($fetch eq $push) { > > - $urls_table .= format_repo_url("URL", $fetch); > > + $urls_table .= format_repo_url("<strong>URL:</strong>", $fetch); > > I would really prefer to use CSS for that... Agreed; <span class="repo_url">URL:</span> is far more appropriate in my opinion. -- -Drew Northup N1XIM AKA RvnPhnx on OPN ________________________________________________ "As opposed to vegetable or mineral error?" -John Pescatore, SANS NewsBites Vol. 12 Num. 59 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/3] gitweb: remove test when closing file descriptor 2010-12-16 21:43 [PATCH 0/3] minor gitweb modifications Sylvain Rabot 2010-12-16 21:43 ` [PATCH 1/3] gitweb: add extensions to highlight feature Sylvain Rabot 2010-12-16 21:43 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot @ 2010-12-16 21:43 ` Sylvain Rabot 2010-12-16 22:30 ` Jakub Narebski 2 siblings, 1 reply; 16+ messages in thread From: Sylvain Rabot @ 2010-12-16 21:43 UTC (permalink / raw) To: git; +Cc: Sylvain Rabot it happens that closing file descriptor fails whereas the blob is perfectly readable. Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> --- gitweb/gitweb.perl | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 9398475..9a885b1 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3450,8 +3450,7 @@ sub run_highlighter { my ($fd, $highlight, $syntax) = @_; return $fd unless ($highlight && defined $syntax); - close $fd - or die_error(404, "Reading blob failed"); + close $fd; open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ". quote_command($highlight_bin). " --xhtml --fragment --syntax $syntax |" -- 1.7.3.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] gitweb: remove test when closing file descriptor 2010-12-16 21:43 ` [PATCH 3/3] gitweb: remove test when closing file descriptor Sylvain Rabot @ 2010-12-16 22:30 ` Jakub Narebski 2010-12-16 22:37 ` Sylvain Rabot 0 siblings, 1 reply; 16+ messages in thread From: Jakub Narebski @ 2010-12-16 22:30 UTC (permalink / raw) To: Sylvain Rabot; +Cc: git, Jakub Narebski Sylvain Rabot <sylvain@abstraction.fr> writes: > it happens that closing file descriptor fails whereas > the blob is perfectly readable. > > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> > --- > gitweb/gitweb.perl | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index 9398475..9a885b1 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -3450,8 +3450,7 @@ sub run_highlighter { > my ($fd, $highlight, $syntax) = @_; > return $fd unless ($highlight && defined $syntax); > > - close $fd > - or die_error(404, "Reading blob failed"); > + close $fd; Actually what I think happens is the following. "close $fh" cannot usually fail, unless (`perldoc -f close`): If the file handle came from a piped open, "close" will additionally return false if one of the other system calls involved fails, or if the program exits with non-zero status. (If the only problem was that the program exited non-zero, $! will be set to 0.) Closing a pipe also waits for the process executing on the pipe to complete, in case you want to look at the output of the pipe afterwards, and implicitly puts the exit status value of that command into $?. Prematurely closing the read end of a pipe (i.e. before the process writ- ing to it at the other end has closed it) will result in a SIGPIPE being delivered to the writer. If the other end can't handle that, be sure to read all the data before closing the pipe. In this place we close read end of pipe after at most reading a few bytes (what -T test does), so what might happen is that writer got SIGPIPE and "failed". But we are not interested in this, so we can safely ignore return from 'close'. I think that some from above explanation should make it to commit message. > open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ". > quote_command($highlight_bin). > " --xhtml --fragment --syntax $syntax |" P.S. A better solution would be to redirect opened $fd to highlighter, instead of closing and reopening a pipe... but I'm not sure how it could be implemented. -- Jakub Narebski Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] gitweb: remove test when closing file descriptor 2010-12-16 22:30 ` Jakub Narebski @ 2010-12-16 22:37 ` Sylvain Rabot 2010-11-16 23:02 ` Jakub Narebski 0 siblings, 1 reply; 16+ messages in thread From: Sylvain Rabot @ 2010-12-16 22:37 UTC (permalink / raw) To: Jakub Narebski; +Cc: git [-- Attachment #1: Type: text/plain, Size: 2599 bytes --] On Thu, 2010-12-16 at 14:30 -0800, Jakub Narebski wrote: > Sylvain Rabot <sylvain@abstraction.fr> writes: > > > it happens that closing file descriptor fails whereas > > the blob is perfectly readable. > > > > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> > > --- > > gitweb/gitweb.perl | 3 +-- > > 1 files changed, 1 insertions(+), 2 deletions(-) > > > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > > index 9398475..9a885b1 100755 > > --- a/gitweb/gitweb.perl > > +++ b/gitweb/gitweb.perl > > @@ -3450,8 +3450,7 @@ sub run_highlighter { > > my ($fd, $highlight, $syntax) = @_; > > return $fd unless ($highlight && defined $syntax); > > > > - close $fd > > - or die_error(404, "Reading blob failed"); > > + close $fd; > > Actually what I think happens is the following. "close $fh" cannot > usually fail, unless (`perldoc -f close`): > > If the file handle came from a piped open, "close" will additionally > return false if one of the other system calls involved fails, or if the > program exits with non-zero status. (If the only problem was that the > program exited non-zero, $! will be set to 0.) Closing a pipe also waits > for the process executing on the pipe to complete, in case you want to > look at the output of the pipe afterwards, and implicitly puts the exit > status value of that command into $?. > > Prematurely closing the read end of a pipe (i.e. before the process writ- > ing to it at the other end has closed it) will result in a SIGPIPE being > delivered to the writer. If the other end can't handle that, be sure to > read all the data before closing the pipe. > > In this place we close read end of pipe after at most reading a few > bytes (what -T test does), so what might happen is that writer got > SIGPIPE and "failed". But we are not interested in this, so we can > safely ignore return from 'close'. > > I think that some from above explanation should make it to commit > message. Thanks for explaining it, I did not have any idea why it was failing. Can I use your explanation as commit message ? > > > open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ". > > quote_command($highlight_bin). > > " --xhtml --fragment --syntax $syntax |" > > P.S. A better solution would be to redirect opened $fd to highlighter, > instead of closing and reopening a pipe... but I'm not sure how it > could be implemented. I don't know either. > -- Sylvain Rabot <sylvain@abstraction.fr> [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 490 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/3] gitweb: remove test when closing file descriptor 2010-12-16 22:37 ` Sylvain Rabot @ 2010-11-16 23:02 ` Jakub Narebski 0 siblings, 0 replies; 16+ messages in thread From: Jakub Narebski @ 2010-11-16 23:02 UTC (permalink / raw) To: Sylvain Rabot; +Cc: git On Thu, 16 Dec 2010, Sylvain Rabot wrote: > On Thu, 2010-12-16 at 14:30 -0800, Jakub Narebski wrote: > > Sylvain Rabot <sylvain@abstraction.fr> writes: > > > > > it happens that closing file descriptor fails whereas > > > the blob is perfectly readable. > > > > > > Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> > > > --- [...] > > > - close $fd > > > - or die_error(404, "Reading blob failed"); > > > + close $fd; [...] > > In this place we close read end of pipe after at most reading a few > > bytes (what -T test does), so what might happen is that writer got > > SIGPIPE and "failed". But we are not interested in this, so we can > > safely ignore return from 'close'. > > > > I think that some from above explanation should make it to commit > > message. > > Thanks for explaining it, I did not have any idea why it was failing. > Can I use your explanation as commit message ? Of course. Though I am not sure if it is really the reason, it looks reasonable. -- Jakub Narebski Poland ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 0/3 v2] minor gitweb modifications @ 2010-12-20 19:01 Sylvain Rabot 2010-12-20 19:01 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot 0 siblings, 1 reply; 16+ messages in thread From: Sylvain Rabot @ 2010-12-20 19:01 UTC (permalink / raw) To: git; +Cc: Sylvain Rabot here a three patch serie with minor updates for gitweb based on master. This serie has been improved regarding the comments of Jakub Narebski <jnareb@gmail.com> Regards. Sylvain Rabot (3): gitweb: add extensions to highlight feature gitweb: decorate a bit more remotes gitweb: remove test when closing file descriptor gitweb/gitweb.perl | 18 +++++++++--------- gitweb/static/gitweb.css | 4 ++++ 2 files changed, 13 insertions(+), 9 deletions(-) -- 1.7.3.4.523.g72f0d.dirty ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/3] gitweb: decorate a bit more remotes 2010-12-20 19:01 [PATCH 0/3 v2] minor gitweb modifications Sylvain Rabot @ 2010-12-20 19:01 ` Sylvain Rabot 2010-12-20 20:02 ` Jonathan Nieder 2010-12-20 23:11 ` Jakub Narebski 0 siblings, 2 replies; 16+ messages in thread From: Sylvain Rabot @ 2010-12-20 19:01 UTC (permalink / raw) To: git; +Cc: Sylvain Rabot Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> --- gitweb/gitweb.perl | 8 ++++---- gitweb/static/gitweb.css | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index a37094e..c460f27 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5127,13 +5127,13 @@ sub git_remote_block { if (defined $fetch) { if ($fetch eq $push) { - $urls_table .= format_repo_url("URL", $fetch); + $urls_table .= format_repo_url("<span class=\"bold\">URL:</span>", $fetch); } else { - $urls_table .= format_repo_url("Fetch URL", $fetch); - $urls_table .= format_repo_url("Push URL", $push) if defined $push; + $urls_table .= format_repo_url("<span class=\"bold\">Fetch URL:</span>", $fetch); + $urls_table .= format_repo_url("<span class=\"bold\">Push URL:</span>", $push) if defined $push; } } elsif (defined $push) { - $urls_table .= format_repo_url("Push URL", $push); + $urls_table .= format_repo_url("<span class=\"bold\">Push URL:</span>", $push); } else { $urls_table .= format_repo_url("", "No remote URL"); } diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 79d7eeb..ce902f5 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -579,6 +579,10 @@ div.remote { display: inline-block; } +.bold { + font-weight: bold; +} + /* Style definition generated by highlight 2.4.5, http://www.andre-simon.de/ */ /* Highlighting theme definition: */ -- 1.7.3.4.523.g72f0d.dirty ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] gitweb: decorate a bit more remotes 2010-12-20 19:01 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot @ 2010-12-20 20:02 ` Jonathan Nieder 2010-12-20 23:06 ` Jakub Narebski 2010-12-20 23:11 ` Jakub Narebski 1 sibling, 1 reply; 16+ messages in thread From: Jonathan Nieder @ 2010-12-20 20:02 UTC (permalink / raw) To: Sylvain Rabot; +Cc: git, Jakub Narebski, John 'Warthog9' Hawley Sylvain Rabot wrote: > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -5127,13 +5127,13 @@ sub git_remote_block { > > if (defined $fetch) { > if ($fetch eq $push) { > - $urls_table .= format_repo_url("URL", $fetch); > + $urls_table .= format_repo_url("<span class=\"bold\">URL:</span>", $fetch); > } else { > - $urls_table .= format_repo_url("Fetch URL", $fetch); > - $urls_table .= format_repo_url("Push URL", $push) if defined $push; > + $urls_table .= format_repo_url("<span class=\"bold\">Fetch URL:</span>", $fetch); > + $urls_table .= format_repo_url("<span class=\"bold\">Push URL:</span>", $push) if defined $push; This makes the formatting of the remote URLs table inconsistent with the other projects_list table (namely the description ... homepage URL ... repository URL ... owner ... last change ... table on a repository's summary page). Is that the right thing to do? If so, maybe something like the following would make sense. -- 8< -- From: Sylvain Rabot <sylvain@abstraction.fr> Date: Mon, 20 Dec 2010 20:01:20 +0100 Subject: gitweb: decorate a bit more remotes Put the text "URL" introducing a remote's url in bold and follow it with a colon. This makes the url list easier to visually scan. Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- The justification above is totally made up; I have not checked to see whether it makes the table easier or harder to read. Also: untested. Maybe the $url part should be esc_url($url)? gitweb/gitweb.perl | 16 ++++++++++------ gitweb/static/gitweb.css | 13 +++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index d521c93..b870b56 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3862,7 +3862,11 @@ sub git_print_header_div { sub format_repo_url { my ($name, $url) = @_; - return "<tr class=\"metadata_url\"><td>$name</td><td>$url</td></tr>\n"; + my $row = "<tr class=\"metadata_url\">"; + $row .= ($name eq "" ? "<td></td>" : "<td class=\"metadata_tag\">$name</td>"); + $row .= "<td>$url</td>"; + $row .= "</tr>\n"; + return $row; } # Group output by placing it in a DIV element and adding a header. @@ -5122,7 +5126,7 @@ sub git_remote_block { my $fetch = $rdata->{'fetch'}; my $push = $rdata->{'push'}; - my $urls_table = "<table class=\"projects_list\">\n" ; + my $urls_table = "<table class=\"remote_urls\">\n" ; if (defined $fetch) { if ($fetch eq $push) { @@ -5368,10 +5372,10 @@ sub git_summary { print "<div class=\"title\"> </div>\n"; print "<table class=\"projects_list\">\n" . - "<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" . - "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n"; + "<tr id=\"metadata_desc\"><td class=\"metadata_tag\">description</td><td>" . esc_html($descr) . "</td></tr>\n" . + "<tr id=\"metadata_owner\"><td class=\"metadata_tag\">owner</td><td>" . esc_html($owner) . "</td></tr>\n"; if (defined $cd{'rfc2822'}) { - print "<tr id=\"metadata_lchange\"><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n"; + print "<tr id=\"metadata_lchange\"><td class=\"metadata_tag\">last change</td><td>$cd{'rfc2822'}</td></tr>\n"; } # use per project git URL list in $projectroot/$project/cloneurl @@ -5390,7 +5394,7 @@ sub git_summary { if ($show_ctags) { my $ctags = git_get_project_ctags($project); my $cloud = git_populate_project_tagcloud($ctags); - print "<tr id=\"metadata_ctags\"><td>Content tags:<br />"; + print "<tr id=\"metadata_ctags\"><td class=\"metadata_tag\">Content tags:<br />"; print "</td>\n<td>" unless %$ctags; print "<form action=\"$show_ctags\" method=\"post\"><input type=\"hidden\" name=\"p\" value=\"$project\" />Add: <input type=\"text\" name=\"t\" size=\"8\" /></form>"; print "</td>\n<td>" if %$ctags; diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css index 79d7eeb..feb09e5 100644 --- a/gitweb/static/gitweb.css +++ b/gitweb/static/gitweb.css @@ -579,6 +579,19 @@ div.remote { display: inline-block; } +/* + * <b>URL:</b> http://www.example.com/ + * <b>Fetch URL:</b> http://www.example.com/ + * <b>Push URL:</b> http://www.example.com/ + */ +table.remote_urls tr.metadata_url td.metadata_tag:after { + content: ":" +} + +table.remote_urls tr.metadata_url td.metadata_tag { + font-weight: bold; +} + /* Style definition generated by highlight 2.4.5, http://www.andre-simon.de/ */ /* Highlighting theme definition: */ -- 1.7.2.3.554.gc9b5c.dirty ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] gitweb: decorate a bit more remotes 2010-12-20 20:02 ` Jonathan Nieder @ 2010-12-20 23:06 ` Jakub Narebski 0 siblings, 0 replies; 16+ messages in thread From: Jakub Narebski @ 2010-12-20 23:06 UTC (permalink / raw) To: Jonathan Nieder; +Cc: Sylvain Rabot, git, John 'Warthog9' Hawley On Mon, 20 Dec 2010, Jonathan Nieder wrote: > diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css > index 79d7eeb..feb09e5 100644 > --- a/gitweb/static/gitweb.css > +++ b/gitweb/static/gitweb.css > @@ -579,6 +579,19 @@ div.remote { > display: inline-block; > } > > +/* > + * <b>URL:</b> http://www.example.com/ > + * <b>Fetch URL:</b> http://www.example.com/ > + * <b>Push URL:</b> http://www.example.com/ > + */ > +table.remote_urls tr.metadata_url td.metadata_tag:after { > + content: ":" > +} I'd rather not use 'content' (pseudo-)property, as not all web browsers implement it,... unless of course not having it doesn't make view worse. -- Jakub Narebski Poland ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] gitweb: decorate a bit more remotes 2010-12-20 19:01 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot 2010-12-20 20:02 ` Jonathan Nieder @ 2010-12-20 23:11 ` Jakub Narebski 1 sibling, 0 replies; 16+ messages in thread From: Jakub Narebski @ 2010-12-20 23:11 UTC (permalink / raw) To: Sylvain Rabot; +Cc: git Sylvain Rabot <sylvain@abstraction.fr> writes: > - $urls_table .= format_repo_url("URL", $fetch); > + $urls_table .= format_repo_url("<span class=\"bold\">URL:</span>", $fetch); [...] > diff --git a/gitweb/static/gitweb.css b/gitweb/static/gitweb.css > index 79d7eeb..ce902f5 100644 > --- a/gitweb/static/gitweb.css > +++ b/gitweb/static/gitweb.css > @@ -579,6 +579,10 @@ div.remote { > display: inline-block; > } > > +.bold { > + font-weight: bold; > +} <span class="bold"> is not much different from <strong> or <b>; I'd rather you use some semantic name for the class, describing what content it contains rather than what style it uses. -- Jakub Narebski Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2010-12-20 23:11 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-12-16 21:43 [PATCH 0/3] minor gitweb modifications Sylvain Rabot 2010-12-16 21:43 ` [PATCH 1/3] gitweb: add extensions to highlight feature Sylvain Rabot 2010-12-16 22:22 ` Jakub Narebski 2010-12-16 22:33 ` Sylvain Rabot 2010-12-17 11:17 ` Jakub Narebski 2010-12-16 21:43 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot 2010-12-16 22:23 ` Jakub Narebski 2010-12-20 12:04 ` Drew Northup 2010-12-16 21:43 ` [PATCH 3/3] gitweb: remove test when closing file descriptor Sylvain Rabot 2010-12-16 22:30 ` Jakub Narebski 2010-12-16 22:37 ` Sylvain Rabot 2010-11-16 23:02 ` Jakub Narebski -- strict thread matches above, loose matches on Subject: below -- 2010-12-20 19:01 [PATCH 0/3 v2] minor gitweb modifications Sylvain Rabot 2010-12-20 19:01 ` [PATCH 2/3] gitweb: decorate a bit more remotes Sylvain Rabot 2010-12-20 20:02 ` Jonathan Nieder 2010-12-20 23:06 ` Jakub Narebski 2010-12-20 23:11 ` Jakub Narebski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).