git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Kato Kazuyoshi <kato.kazuyoshi@gmail.com>,
	Jakub Narebski <jnareb@gmail.com>
Subject: [PATCHv3 7/8] gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"
Date: Mon, 31 Oct 2011 00:36:26 +0100	[thread overview]
Message-ID: <1320017787-18048-8-git-send-email-jnareb@gmail.com> (raw)
In-Reply-To: <1320017787-18048-1-git-send-email-jnareb@gmail.com>

Use href(-replay->1,...) in (sub)navigation links (like changing style
of view, or going to parent commit) so that extra options are
preserved.

This is needed so clicking on such (sub)navigation link would preserve
style of diff; for example when using "side-by-side" diff style then
going to parent commit would now also use this style.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in this series, and independent on side-by-side stuff.
It can (and perhaps should) be moved earlier in this series.

 gitweb/gitweb.perl |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f69ed08..ffaea45 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -7267,8 +7267,8 @@ sub git_commitdiff {
 				}
 			}
 			$formats_nav .= ': ' .
-				$cgi->a({-href => href(action=>"commitdiff",
-				                       hash=>$hash_parent)},
+				$cgi->a({-href => href(-replay=>1,
+				                       hash=>$hash_parent, hash_base=>undef)},
 				        esc_html($hash_parent_short)) .
 				')';
 		} elsif (!$co{'parent'}) {
@@ -7278,28 +7278,28 @@ sub git_commitdiff {
 			# single parent commit
 			$formats_nav .=
 				' (parent: ' .
-				$cgi->a({-href => href(action=>"commitdiff",
-				                       hash=>$co{'parent'})},
+				$cgi->a({-href => href(-replay=>1,
+				                       hash=>$co{'parent'}, hash_base=>undef)},
 				        esc_html(substr($co{'parent'}, 0, 7))) .
 				')';
 		} else {
 			# merge commit
 			if ($hash_parent eq '--cc') {
 				$formats_nav .= ' | ' .
-					$cgi->a({-href => href(action=>"commitdiff",
+					$cgi->a({-href => href(-replay=>1,
 					                       hash=>$hash, hash_parent=>'-c')},
 					        'combined');
 			} else { # $hash_parent eq '-c'
 				$formats_nav .= ' | ' .
-					$cgi->a({-href => href(action=>"commitdiff",
+					$cgi->a({-href => href(-replay=>1,
 					                       hash=>$hash, hash_parent=>'--cc')},
 					        'compact');
 			}
 			$formats_nav .=
 				' (merge: ' .
 				join(' ', map {
-					$cgi->a({-href => href(action=>"commitdiff",
-					                       hash=>$_)},
+					$cgi->a({-href => href(-replay=>1,
+					                       hash=>$_, hash_base=>undef)},
 					        esc_html(substr($_, 0, 7)));
 				} @{$co{'parents'}} ) .
 				')';
-- 
1.7.6

  parent reply	other threads:[~2011-10-30 23:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-30 23:36 [PATCHv3 0/8] gitweb: side-by-side diff Jakub Narebski
2011-10-30 23:36 ` [PATCHv3 1/8] gitweb: Refactor diff body line classification Jakub Narebski
2011-10-30 23:36 ` [PATCHv3 2/8] gitweb: Extract formatting of diff chunk header Jakub Narebski
2011-10-30 23:36 ` [PATCHv3 3/8] gitweb: Add a feature to show side-by-side diff Jakub Narebski
2011-10-30 23:36 ` [PATCHv3 4/8] gitweb: Give side-by-side diff extra CSS styling Jakub Narebski
2011-10-30 23:36 ` [PATCHv3 5/8] t9500: Add test for handling incomplete lines in diff by gitweb Jakub Narebski
2011-10-30 23:36 ` [PATCHv3 6/8] t9500: Add basic sanity tests for side-by-side diff in gitweb Jakub Narebski
2011-10-30 23:36 ` Jakub Narebski [this message]
2011-10-30 23:36 ` [PATCHv3 8/8] gitweb: Add navigation to select side-by-side diff 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=1320017787-18048-8-git-send-email-jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kato.kazuyoshi@gmail.com \
    /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 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).