From: Mark Levedahl <mlevedahl@gmail.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Cc: j6t@kdbg.org, johannes.schindelin@gmx.de
Subject: git v2.49.0 - gitk regression on Cygwin
Date: Fri, 28 Mar 2025 08:34:55 -0400 [thread overview]
Message-ID: <23088b7d-ed98-4b78-bb9a-c3674da1117d@gmail.com> (raw)
referencing the upstream gitk repo at published at
https://github.com/j6t/gitk.git:
Since commit 4cbe9e0e2 - "gitk(Windows): avoid inadvertently calling
executables in the worktree,"
gitk no longer works on Cygwin. This commit is in Junio's tree as part
of release v2.49.0, but I didn't trace to the specific merge commit.
The proximal issue is an endless loop caused by routine _which invoking
exec, which is now a wrapper that invokes _which, while the builtin exec
is renamed to real_exec. This results in stack exhaustion. There are
other problems due to munging Cygwin's $PATH into Windows rather than
Unix format, so changing _which to invoke real_exec just changes the
failure mode on Cygwin.
Removing the Cygwin specific code so that gitk treats Cygwin as a Linux
variant does work: e.g.,
diff --git a/gitk b/gitk
index bc9efa1..2c29118 100755
--- a/gitk
+++ b/gitk
@@ -49,14 +49,7 @@ proc _which {what args} {
global env _search_exe _search_path
if {$_search_path eq {}} {
- if {[is_Cygwin] && [regexp {^(/|\.:)} $env(PATH)]} {
- set _search_path [split [exec cygpath \
- --windows \
- --path \
- --absolute \
- $env(PATH)] {;}]
- set _search_exe .exe
- } elseif {[is_Windows]} {
+ if {[is_Windows]} {
set gitguidir [file dirname [info script]]
regsub -all ";" $gitguidir "\\;" gitguidir
set env(PATH) "$gitguidir;$env(PATH)"
However, the above leaves code in place affecting path search on all
platforms without justification. The commit message references the TCL
man page for "exec", listing a number of directories (including the
current working directory) and file suffixes searched on the Windows
platform that could be problematic. However, that man page does not list
any such issues for other platforms. So, it appears the patch does not
address a known issue on Unix platforms, which includes Cygwin.
I believe the correct fix to 4cbe9e0e2 is limiting the override of exec
and open to Windows, and I also have a patch to do that rather than what
I show above. Let me know.
Mark
next reply other threads:[~2025-03-28 12:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 12:34 Mark Levedahl [this message]
2025-03-28 17:30 ` git v2.49.0 - gitk regression on Cygwin Johannes Sixt
2025-03-29 21:49 ` Mark Levedahl
2025-03-31 15:12 ` [PATCH] gitk - override $PATH search only on Windows Mark Levedahl
2025-03-31 17:12 ` Johannes Sixt
2025-03-31 19:29 ` Mark Levedahl
2025-04-01 3:00 ` [PATCH v2 0/3] gitk: override PATH " Mark Levedahl
2025-04-01 3:01 ` [PATCH v2 1/3] gitk: override $PATH " Mark Levedahl
2025-04-01 3:01 ` [PATCH v2 2/3] gitk: _search_exe is no longer needed Mark Levedahl
2025-04-01 3:01 ` [PATCH v2 3/3] gitk: limit PATH search to bare executable names Mark Levedahl
2025-04-01 16:10 ` [PATCH v2 0/3] gitk: override PATH search only on Windows Johannes Schindelin
2025-04-01 16:44 ` Mark Levedahl
2025-04-01 16:40 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23088b7d-ed98-4b78-bb9a-c3674da1117d@gmail.com \
--to=mlevedahl@gmail.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=johannes.schindelin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).