Closed zosrothko closed 4 years ago
Git for Windows does not include Python, and neither does it include filter-branch
. How did you install them?
filter-branch
has been deprecated by Git in favor of git-filter-repo.
C:\Users\fandre\Documents\MXW\DEMOS\release>git filter-branch
WARNING: git-filter-branch has a glut of gotchas generating mangled history
rewrites. Hit Ctrl-C before proceeding to abort, then use an
alternative filtering tool such as 'git filter-repo'
(https://github.com/newren/git-filter-repo/) instead. See the
filter-branch manual page for more details; to squelch this warning,
set FILTER_BRANCH_SQUELCH_WARNING=1.
Installation steps are there reported as below
filter-repo only consists of a few files that need to be installed:
git-filter-repo
This is the only thing needed for basic use.
This can be installed in the directory pointed to by git --exec-path, or placed anywhere in $PATH.
If your python3 executable is named "python" instead of "python3" (this particularly appears to affect a number of Windows users), then you'll also need to modify the first line of git-filter-repo to replace "python3" with "python".
The full nigthmare story about new python packagin on Windows10 is there.
From a user's perspective, it would be nice to put a "python" into the C:\Program Files\Git\mingw64\bin
directory so that the git-filter-repo could be run without execute right problem.
@zosrothko but how did you install them? I.e. from where did you download Python, where did you install it, how/where did you install filter-repo
?
From a user's perspective, it would be nice to put a "python" into the
C:\Program Files\Git\mingw64\bin
directory so that the git-filter-repo could be run without execute right problem.
It sounds so easy, doesn't it? And it would be easy, but it would also increase the size of the Git for Windows installer, and it would put an even heavier maintenance burden on me, the Git for Windows maintainer, because now you would not only ask me to take care of all Git issues but also of all Python issues users might encounter. For those reasons, Python is intentionally not bundled with Git for Windows.
Python is installed from the Windows Store and it is installed here C:\Users\fandre\AppData\Local\Microsoft\WindowsApps\python.exe
with all issues mentioned here permission-denied-trying-to-run-python-on-windows-10 which do not have a solution/workaround.
There is already a lot of executable in C:\Program Files\Git\mingw64\bin
, so I was thinking that adding Python was a good idea.
Python is installed from the Windows Store and it is installed here
C:\Users\fandre\AppData\Local\Microsoft\WindowsApps\python.exe
with all issues mentioned here permission-denied-trying-to-run-python-on-windows-10 which do not have a solution/workaround.
Thank you.
I cannot promise anything, of course, as I am preparing my way toward Git for Windows v2.29.0, but I do certainly hope to get a chance to reproduce the issue you reported. Eventually, I'd like to have a smooth path to use git filter-repo
in Git for Windows (maybe via a convenient script that would install Python and then clone git filter-repo
into a suitable location).
Okay, this is what I did over here:
git-filter-repo
script from that worktree to ~/bin/
(in Git Bash; If you want to do this in CMD, you will most likely need to do something like cp git-filter-repo %USERPROFILE%\bin\
)I then verified that I could reproduce your problem:
C:\Users\me\test-worktree>git filter-repo --analyse
/usr/bin/env: 'python3': Permission denied
I then edited the git-filter-repo
script and removed the trailing 3
from the python3
, and now it works:
C:\Users\me\test-worktree>git filter-repo --analyze
Processed 25 blob sizes
Processed 9 commits
Writing reports to .git\filter-repo\analysis...done.
Of course, I do have a working python.exe
in my PATH
, actually even two:
C:\Users\me\test-worktree>where python
C:\Users\me\AppData\Local\Programs\Python\Python38-32\python.exe
C:\Users\me\AppData\Local\Microsoft\WindowsApps\python.exe
Neither of them have the "Permission denied" problem that python3
has, apparently.
Setup
insert your response here
Details
CMD
May be adding a python processor in
C:\Program Files\Git\mingw64\bin
could solve this issue.