From: Etienne Vallette d'Osia <Etienne.VallettedOsia@gmail.com>
To: git@vger.kernel.org
Subject: Re: [RFC/PATCH] gitweb: link to toggle 'no merges' option
Date: Thu, 17 Dec 2009 14:03:58 +0100 [thread overview]
Message-ID: <hgda76$tf5$1@ger.gmane.org> (raw)
In-Reply-To: <1261040753-4859-1-git-send-email-giuseppe.bilotta@gmail.com>
Oh, this is exactly what I wanted for a long long time...
I hope this feature will be merged soon !
Le 12/17/2009 10:05 AM, Giuseppe Bilotta a écrit :
> In views that support --no-merges, introduce a link that toggles the
> option.
>
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
>
> ---
> gitweb/gitweb.css | 11 +++++++++++
> gitweb/gitweb.perl | 14 ++++++++++++++
> 2 files changed, 25 insertions(+), 0 deletions(-)
>
> This is something I've been wanting for a while. There are a number of
> things that don't 'click' with this proof of concept, and I'm coming to
> the list to hear the opinion of users and developers on how to improve
> the thing.
>
> The patch is live at http://git.oblomov.eu/, an example affected page is
> http://git.oblomov.eu/git/shortlog
>
> Things that are sure to change:
>
> * the aesthetics and location of the toggle link (it shows on mousehover
> in the title). Other options I've considered are:
> + next to pagination (first | prev | next), either before or after
> the existing entries
> + on mouseover for the table section that refers to the (short)log;
> this would make it possible to put it summary view too, for example
>
> * if you toggle merge view when not on the first page, the reference
> (first) commit in the view is likely to change drastically, which
> causes confusion. I have not found a satisfactory solution for this,
> since the obvious way to 'lock' the view (start paginating from the
> current top commit) prevents prev/next navigation
>
> diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
> index 50067f2..0da6ef0 100644
> --- a/gitweb/gitweb.css
> +++ b/gitweb/gitweb.css
> @@ -572,3 +572,14 @@ span.match {
> div.binary {
> font-style: italic;
> }
> +
> +span.merge_toggle a {
> + font-size: 66%;
> + color: white !important;
> + font-weight: normal;
> + vertical-align: top;
> + text-decoration:none;
> + visibility: hidden;
> +}
> +
> +*:hover > span.merge_toggle a { visibility:visible }
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 7e477af..a63f419 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3118,11 +3118,15 @@ sub git_header_html {
> my $status = shift || "200 OK";
> my $expires = shift;
>
> + my $can_have_merges = grep(/^$action$/, @{$allowed_options{'--no-merges'}});
> + my $has_merges = !grep(/^--no-merges$/, @extra_options);
> +
> my $title = "$site_name";
> if (defined $project) {
> $title .= " - " . to_utf8($project);
> if (defined $action) {
> $title .= "/$action";
> + $title .= " (no merges)" unless $has_merges;
> if (defined $file_name) {
> $title .= " - " . esc_path($file_name);
> if ($action eq "tree" && $file_name !~ m|/$|) {
> @@ -3235,6 +3239,16 @@ EOF
> print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
> if (defined $action) {
> print " / $action";
> + if ($can_have_merges) {
> + print " <span class='merge_toggle'>";
> + if ($has_merges) {
> + printf('<a href="%s">hide merges</a>', href(-replay=>1, 'extra_options'=>('--no-merges', @extra_options)));
> + } else {
> + my @href_extra = grep(!/^--no-merges$/, @extra_options);
> + printf('<a href="%s">show merges</a>', href(-replay=>1, 'extra_options'=>@href_extra));
> + }
> + print "</span>";
> + }
> }
> print "\n";
> }
--
Etienne Vallette d'Osia
next prev parent reply other threads:[~2009-12-17 13:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 9:05 [RFC/PATCH] gitweb: link to toggle 'no merges' option Giuseppe Bilotta
2009-12-17 13:03 ` Etienne Vallette d'Osia [this message]
2009-12-17 15:37 ` Jakub Narebski
2009-12-17 20:41 ` Giuseppe Bilotta
2009-12-17 21:14 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='hgda76$tf5$1@ger.gmane.org' \
--to=etienne.vallettedosia@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.