git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Robert Luberda <robert@debian.org>
Cc: git@vger.kernel.org, "Jakub Narębski" <jnareb@gmail.com>
Subject: [PATCH] gitweb: correctly store previous rev in javascript-actions mode
Date: Sun, 16 Dec 2018 15:24:29 -0800	[thread overview]
Message-ID: <20181216232429.GJ75890@google.com> (raw)
In-Reply-To: <53CECC87.7030209@debian.org>

From: Robert Luberda <robert@debian.org>
Date: Sun, 16 Mar 2014 22:57:19 +0100

Without this change, the setting

 $feature{'javascript-actions'}{'default'} = [1];

in gitweb.conf breaks gitweb's blame page: clicking on line numbers
displayed in the second column on the page has no effect.

For comparison, with javascript-actions disabled, clicking on line
numbers loads the previous version of the line.

Addresses https://bugs.debian.org/741883.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Hi Robert,

Years ago, you sent this obviously correct patch to the link mentioned
above, but it got lost in the noise.  Sorry about that.  Hopefully
late is better than never.

May we forge your sign-off?  See
https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off
for more details about what this means.

Jakub et al, any thoughts?  I don't see any unit tests in gitweb/static
that could avoid this regressing --- am I missing some, or if not any
hints for someone who would want to add a test framework?

Thanks,
Jonathan

 gitweb/static/js/blame_incremental.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gitweb/static/js/blame_incremental.js b/gitweb/static/js/blame_incremental.js
index db6eb50584..e100d8206b 100644
--- a/gitweb/static/js/blame_incremental.js
+++ b/gitweb/static/js/blame_incremental.js
@@ -484,7 +484,7 @@ function processBlameLines(lines) {
 			case 'previous':
 				curCommit.nprevious++;
 				// store only first 'previous' header
-				if (!'previous' in curCommit) {
+				if (!('previous' in curCommit)) {
 					var parts = data.split(' ', 2);
 					curCommit.previous    = parts[0];
 					curCommit.file_parent = unquote(parts[1]);
-- 
2.20.0.405.gbc1bbc6f85


  reply	other threads:[~2018-12-16 23:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 20:41 Two gitweb bugs related to javascript-actions Robert Luberda
2018-12-16 23:24 ` Jonathan Nieder [this message]
2019-10-27  9:14   ` [PATCH] gitweb: correctly store previous rev in javascript-actions mode Robert Luberda
2019-10-27 10:27     ` 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=20181216232429.GJ75890@google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=robert@debian.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 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).