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

Re: [PATCH 2/2] Ensure the file in the diff pane is always in the list of selected files

From
Jakub Narębski <jnareb@gmail.com>
Date
Jun 27, 2016, 17:32 UTC
Message-ID
<57716329.8000809@gmail.com>
In-Reply-To
<20160627132308.GD4194@pflmari>
W dniu 2016-06-27 o 15:23, Alex Riesen pisze:
Show 6 quoted lines
> It is very confusing that the file, diff of which is displayed and which is
> marked as selected in the file list, is not, in fact, selected. I.e. the array
> of selected files does not contain an entry for it.
> 
> Fixing this also improves the use of $FILENAMES in custom defined tools: one
> does not have to click the file in the list to make it selected.

Could you improve the readability of the commit message, please? Perhaps something like the following:

  It is very confusing that the file which diff is displayed is marked as
  selected, but it is not in fact selected (that means the array of selected
  files does not include the file in question).
  ...
This patch lacks sign-off.
Show 19 quoted lines
> ---
>  lib/diff.tcl | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/diff.tcl b/lib/diff.tcl
> index 0d56986..30bdd69 100644
> --- a/lib/diff.tcl
> +++ b/lib/diff.tcl
> @@ -127,6 +127,9 @@ proc show_diff {path w {lno {}} {scroll_pos {}} {callback {}}} {
>  	} else {
>  		start_show_diff $cont_info
>  	}
> +
> +	global current_diff_path selected_paths
> +	set selected_paths($current_diff_path) 1
>  }
>  
>  proc show_unmerged_diff {cont_info} {
> 
Previous: Alex RiesenNext: Alex Riesen
Message 3 of 10 in “Support for $FILENAMES in tool definitions”
  1. 1/2 Support for $FILENAMES in tool definitionsAlex Riesen, Jun 27, 2016
  2. 2/2 Ensure the file in the diff pane is always in the list of selected filesAlex Riesen, Jun 27, 2016
  3. Jakub NarębskiJun 27, 2016
  4. Alex RiesenJun 28, 2016
  5. Johannes SchindelinJun 27, 2016
  6. Alex RiesenJun 28, 2016
  7. Jakub NarębskiJun 27, 2016
  8. Junio C HamanoJun 27, 2016
  9. Jakub NarębskiJun 27, 2016
  10. Alex RiesenJun 28, 2016

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.