You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately os.environ["PROGRAMFILES"] is C:\Program Files even though Git is located in C:\Program Files (x86). As a result, running an editor fails:
Traceback (most recent call last):
File "C:\Users\nyanpasu64\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\nyanpasu64\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "c:\users\nyanpasu64\.local\bin\git-revise.exe\__main__.py", line 7, in <module>
File "C:\Users\nyanpasu64\.local\pipx\venvs\git-revise\lib\site-packages\gitrevise\tui.py", line 263, in main
inner_main(args, repo)
File "C:\Users\nyanpasu64\.local\pipx\venvs\git-revise\lib\site-packages\gitrevise\tui.py", line 254, in inner_main
interactive(args, repo, staged, head)
File "C:\Users\nyanpasu64\.local\pipx\venvs\git-revise\lib\site-packages\gitrevise\tui.py", line 137, in interactive
todos = edit_todos(repo, todos, msgedit=args.edit)
File "C:\Users\nyanpasu64\.local\pipx\venvs\git-revise\lib\site-packages\gitrevise\todo.py", line 208, in edit_todos
response = run_sequence_editor(
File "C:\Users\nyanpasu64\.local\pipx\venvs\git-revise\lib\site-packages\gitrevise\utils.py", line 202, in run_sequence_editor
return run_specific_editor(
File "C:\Users\nyanpasu64\.local\pipx\venvs\git-revise\lib\site-packages\gitrevise\utils.py", line 142, in run_specific_editor
data = edit_file_with_editor(editor, path)
File "C:\Users\nyanpasu64\.local\pipx\venvs\git-revise\lib\site-packages\gitrevise\utils.py", line 66, in edit_file_with_editor
run(cmd, check=True, cwd=path.parent)
File "C:\Users\nyanpasu64\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\nyanpasu64\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\nyanpasu64\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1311, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Is there a better way to auto-detect the correct Git path?
The text was updated successfully, but these errors were encountered:
As far as I know, there's no reliable way to find it on windows other than looking in specific directories one at a time, checking if they exist. We could perhaps consider having a priority list of program files paths to check in rather than using a single callback, perhaps checking PROGRAMFILES, PROGRAMFILES(X86), PROGRAMW6432 in that order (if they're defined) would make sense? (based on https://en.wikipedia.org/wiki/Environment_variable#ProgramFiles). That way it should handle any combination of 32/64-bit python3 install and 32/64-bit git install.
I accidentally installed 32-bit Git on 64-bit Windows, so Git ended up in
C:\Program Files (x86)\Git
.On Windows, git-revise launches the editor in a
sh.exe -ec exec ...
environment. The path to sh.exe is calculated insh_path()
:git-revise/gitrevise/utils.py
Lines 301 to 308 in 7e3bf8d
Unfortunately
os.environ["PROGRAMFILES"]
isC:\Program Files
even though Git is located inC:\Program Files (x86)
. As a result, running an editor fails:Is there a better way to auto-detect the correct Git path?
The text was updated successfully, but these errors were encountered: