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

[PATCH] gitk: switch to patch mode when searching for line origin

From
Max Kirillov <max@max630.net>
Date
Apr 5, 2014, 20:38 UTC
Message-ID
<20140405203850.GA20967@wheezy.local>
If the "Show origin of this line" is started from tree mode,
it still shows the result in tree mode, which I suppose not
what user expects to see.
---
 gitk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gitk b/gitk
index 90764e8..5a99350 100755
--- a/gitk
+++ b/gitk
@@ -3870,7 +3870,7 @@ proc read_line_source {fd inst} {
 	    set id $nullid2
 	}
 	if {[commitinview $id $curview]} {
-	    selectline [rowofcommit $id] 1 [list $fname $lnum]
+	    selectline [rowofcommit $id] 1 [list $fname $lnum] 1
 	} else {
 	    error_popup [mc "That line comes from commit %s, \
 			     which is not in this view" [shortids $id]]
@@ -7161,7 +7161,7 @@ proc make_idmark {id} {
     $canv raise $t
 }
 
-proc selectline {l isnew {desired_loc {}}} {
+proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
     global canv ctext commitinfo selectedline
     global canvy0 linespc parents children curview
     global currentid sha1entry
@@ -7187,6 +7187,10 @@ proc selectline {l isnew {desired_loc {}}} {
 	setcanvscroll
     }
 
+    if {$cmitmode ne "patch" && $switch_to_patch} {
+        set cmitmode "patch"
+    }
+
     set y [expr {$canvy0 + $l * $linespc}]
     set ymax [lindex [$canv cget -scrollregion] 3]
     set ytop [expr {$y - $linespc - 1}]
-- 
1.8.5.2.421.g4cdf8d0
Next: Paul Mackerras
Message 1 of 2 in “gitk: switch to patch mode when searching for line origin”
  1. gitk: switch to patch mode when searching for line originMax Kirillov, Apr 5, 2014
  2. Paul MackerrasJun 15, 2014

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.