Skip to content

Commit 8cdd5e7

Browse files
committed
Merge branch 'ma/locate-in-path-for-windows'
"git bisect visualize" stopped running "gitk" on Git for Windows when the command was reimplemented in C around Git 2.34 timeframe. This has been corrected. * ma/locate-in-path-for-windows: docs: update when `git bisect visualize` uses `gitk` compat/mingw: implement a native locate_in_PATH() run-command: conditionally define locate_in_PATH()
2 parents b6e2a0c + fff1594 commit 8cdd5e7

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

Documentation/git-bisect.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,14 @@ as an alternative to `visualize`):
204204
$ git bisect visualize
205205
------------
206206

207-
If the `DISPLAY` environment variable is not set, 'git log' is used
208-
instead. You can also give command-line options such as `-p` and
209-
`--stat`.
207+
Git detects a graphical environment through various environment variables:
208+
`DISPLAY`, which is set in X Window System environments on Unix systems.
209+
`SESSIONNAME`, which is set under Cygwin in interactive desktop sessions.
210+
`MSYSTEM`, which is set under Msys2 and Git for Windows.
211+
`SECURITYSESSIONID`, which may be set on macOS in interactive desktop sessions.
212+
213+
If none of these environment variables is set, 'git log' is used instead.
214+
You can also give command-line options such as `-p` and `--stat`.
210215

211216
------------
212217
$ git bisect visualize --stat

compat/mingw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,11 @@ static char *path_lookup(const char *cmd, int exe_only)
13471347
return prog;
13481348
}
13491349

1350+
char *mingw_locate_in_PATH(const char *cmd)
1351+
{
1352+
return path_lookup(cmd, 0);
1353+
}
1354+
13501355
static const wchar_t *wcschrnul(const wchar_t *s, wchar_t c)
13511356
{
13521357
while (*s && *s != c)

compat/mingw.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ pid_t waitpid(pid_t pid, int *status, int options);
177177
#define kill mingw_kill
178178
int mingw_kill(pid_t pid, int sig);
179179

180+
#define locate_in_PATH mingw_locate_in_PATH
181+
char *mingw_locate_in_PATH(const char *cmd);
182+
180183
#ifndef NO_OPENSSL
181184
#include <openssl/ssl.h>
182185
static inline int mingw_SSL_set_fd(SSL *ssl, int fd)

run-command.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ int is_executable(const char *name)
170170
return st.st_mode & S_IXUSR;
171171
}
172172

173+
#ifndef locate_in_PATH
173174
/*
174175
* Search $PATH for a command. This emulates the path search that
175176
* execvp would perform, without actually executing the command so it
@@ -218,6 +219,7 @@ static char *locate_in_PATH(const char *file)
218219
strbuf_release(&buf);
219220
return NULL;
220221
}
222+
#endif
221223

222224
int exists_in_PATH(const char *command)
223225
{

0 commit comments

Comments
 (0)