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

[PATCH v2 2/3] gitk: _search_exe is no longer needed

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Apr 1, 2025, 03:01 UTC
Message-ID
<20250401030102.297272-3-mlevedahl@gmail.com>
In-Reply-To
<20250401030102.297272-1-mlevedahl@gmail.com>

The _search_exe variable allows specifying the suffix used for executables, typically {} on unix, .exe on Windows. But, the override code is now used only on Windows, so _search_exe is no longer needed. Eliminate it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
---
 gitk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gitk b/gitk
index a101b07..e4d0500 100755
--- a/gitk
+++ b/gitk
@@ -27,7 +27,7 @@ proc is_Windows {} {
 if {[is_Windows]} {
 	set _search_path {}
 	proc _which {what args} {
-		global env _search_exe _search_path
+		global env _search_path
 
 		if {$_search_path eq {}} {
 			set gitguidir [file dirname [info script]]
@@ -37,13 +37,12 @@ if {[is_Windows]} {
 			# Skip empty `PATH` elements
 			set _search_path [lsearch -all -inline -not -exact \
 				$_search_path ""]
-			set _search_exe .exe
 		}
 
 		if {[lsearch -exact $args -script] >= 0} {
 			set suffix {}
 		} else {
-			set suffix $_search_exe
+			set suffix .exe
 		}
 
 		foreach p $_search_path {
-- 
2.49.0.99.31
Previous: Mark LevedahlNext: Mark Levedahl
Message 9 of 13 in “git v2.49.0 - gitk regression on Cygwin”
  1. Mark LevedahlMar 28, 2025
  2. Johannes SixtMar 28, 2025
  3. Mark LevedahlMar 29, 2025
  4. gitk - override $PATH search only on WindowsMark Levedahl, Mar 31, 2025
  5. Johannes SixtMar 31, 2025
  6. Mark LevedahlMar 31, 2025
  7. 0/3 gitk: override PATH search only on WindowsMark Levedahl, Apr 1, 2025
  8. 1/3 gitk: override $PATH search only on WindowsMark Levedahl, Apr 1, 2025
  9. 2/3 gitk: _search_exe is no longer neededMark Levedahl, Apr 1, 2025
  10. 3/3 gitk: limit PATH search to bare executable namesMark Levedahl, Apr 1, 2025
  11. Johannes SchindelinApr 1, 2025
  12. Mark LevedahlApr 1, 2025
  13. Johannes SixtApr 1, 2025

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.