git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: correctly store previous rev in javascript-actions mode

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 27, 2019, 10:27 UTC
Message-ID
<86eeyybi0z.fsf@gmail.com>
In-Reply-To
<8073f537-4380-4571-6997-546a9ca919f4@debian.org>
Robert Luberda <robert@debian.org> writes:
Show 17 quoted lines
> 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>
> Signed-off-by: Robert Luberda <robert@debian.org>
For what it is worth it (because I am not active in gitweb development):
Acked-by: Jakub Narębski <jnareb@gmail.com>
Show 16 quoted lines
> ---
>> 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.
>
> Hi,
>
> Somehow I missed your e-mail and just have found it today by a chance :(
>
>> 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.
>
> Done, I've added the Signed-off-line above.
Thanks for following this up.
>> 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?

We currently have no tests for the JavaScript in gitweb code; I am not sure how one would go to add such tests (and whether it would be possible while gitweb is part of git - if they need externel dependencies like Node.js or Selenium they would need to be able to be disabled or enabled with builld option).

Show 17 quoted lines
>  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]);
Thanks,
-- 
Jakub Narębski
Previous: Robert Luberda
Message 4 of 4 in “Two gitweb bugs related to javascript-actions”
  1. Robert LuberdaJul 22, 2014
  2. gitweb: correctly store previous rev in javascript-actions modeJonathan Nieder, Dec 16, 2018
  3. Robert LuberdaOct 27, 2019
  4. Jakub NarebskiOct 27, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.