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

[PATCH 2/2] git-gui: ensure the file in the diff pane is in the list of selected files

From
Alex Riesen <alexander.riesen@cetitec.com>
Date
Jun 28, 2016, 08:59 UTC
Message-ID
<20160628085925.GE3710@pflmari>
In-Reply-To
<20160628085742.GD3710@pflmari>

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).

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.

Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com>
---
 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} {
-- 
2.9.0.45.g28c608e.dirty


---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus
Previous: Alex RiesenNext: Pat Thoyts
Message 2 of 3 in “git-gui: support for $FILENAMES in tool definitions”
  1. 1/2 git-gui: support for $FILENAMES in tool definitionsAlex Riesen, Jun 28, 2016
  2. 2/2 git-gui: ensure the file in the diff pane is in the list of selected filesAlex Riesen, Jun 28, 2016
  3. Pat ThoytsOct 3, 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.