diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-08-10 02:18:15 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-08-10 02:18:16 +0300 |
commit | 8cdd5e713d7ba54b9d26ac997408bb745ab55088 (patch) | |
tree | 89df70d128a7f41f454a9eb29cdac0dfe86b994d | |
parent | b6e2a0c0b30dccd050706354eaa64a9e8ed900e5 (diff) | |
parent | fff1594fa77372ea7a51f6b445267f23fdbf3089 (diff) |
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()
-rw-r--r-- | Documentation/git-bisect.txt | 11 | ||||
-rw-r--r-- | compat/mingw.c | 5 | ||||
-rw-r--r-- | compat/mingw.h | 3 | ||||
-rw-r--r-- | run-command.c | 2 |
4 files changed, 18 insertions, 3 deletions
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt index fbb39fbdf5..7872dba3ae 100644 --- a/Documentation/git-bisect.txt +++ b/Documentation/git-bisect.txt @@ -204,9 +204,14 @@ as an alternative to `visualize`): $ git bisect visualize ------------ -If the `DISPLAY` environment variable is not set, 'git log' is used -instead. You can also give command-line options such as `-p` and -`--stat`. +Git detects a graphical environment through various environment variables: +`DISPLAY`, which is set in X Window System environments on Unix systems. +`SESSIONNAME`, which is set under Cygwin in interactive desktop sessions. +`MSYSTEM`, which is set under Msys2 and Git for Windows. +`SECURITYSESSIONID`, which may be set on macOS in interactive desktop sessions. + +If none of these environment variables is set, 'git log' is used instead. +You can also give command-line options such as `-p` and `--stat`. ------------ $ git bisect visualize --stat diff --git a/compat/mingw.c b/compat/mingw.c index f7f5d0ce0c..ec5280da16 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1347,6 +1347,11 @@ static char *path_lookup(const char *cmd, int exe_only) return prog; } +char *mingw_locate_in_PATH(const char *cmd) +{ + return path_lookup(cmd, 0); +} + static const wchar_t *wcschrnul(const wchar_t *s, wchar_t c) { while (*s && *s != c) diff --git a/compat/mingw.h b/compat/mingw.h index 5e34c87347..6aec50e412 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -177,6 +177,9 @@ pid_t waitpid(pid_t pid, int *status, int options); #define kill mingw_kill int mingw_kill(pid_t pid, int sig); +#define locate_in_PATH mingw_locate_in_PATH +char *mingw_locate_in_PATH(const char *cmd); + #ifndef NO_OPENSSL #include <openssl/ssl.h> static inline int mingw_SSL_set_fd(SSL *ssl, int fd) diff --git a/run-command.c b/run-command.c index b22ee36073..a558042c87 100644 --- a/run-command.c +++ b/run-command.c @@ -170,6 +170,7 @@ int is_executable(const char *name) return st.st_mode & S_IXUSR; } +#ifndef locate_in_PATH /* * Search $PATH for a command. This emulates the path search that * execvp would perform, without actually executing the command so it @@ -218,6 +219,7 @@ static char *locate_in_PATH(const char *file) strbuf_release(&buf); return NULL; } +#endif int exists_in_PATH(const char *command) { |