-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NameError: name 'git' is not defined
#360
Comments
If anyone has a Windows machine and can take a look, I'd appreciate it. I have no way to reproduce or test. Looks like the scoop developers also struggled to understand how to reproduce given the link above. |
@newren I can reproduce easily. Did you check ScoopInstaller/Main#3471 for my hypothesis/workaround? I believe the symbolic link git_filter_repo.py is not being created properly under Windows. If I can help by providing debug logs or other info, let me know. |
@dafurtney: If the hypothesis is that git_filter_repo.py is not being created properly under Windows, and is a "text" file without execute permissions or the equivalent, then it sounds like something the installer (Scoop) would handle and perhaps I should close this out in favor of the link you provided; it's not something I'd have access to fix. But I'm hesitant to do that given that the Scoop developers seemed to be unsure how to duplicate when they first read the report and asked for more info. I have no Windows system and no way to try to reproduce either. |
@newren Please check ScoopInstaller/Main#3471 Is it the case that since mklink (cmd) or New-Item -ItemType SymbolicLink both require admin privilege, the app manifest can't just do that in post_install? At minimum the scoop package should somehow inform the install user of the manual fix up required ... Or is there a way to have the scoop install run in admin mode and create the link as expected via post_install? Another workaround is to not create a link and just copy the file either in the original zip or via post_install in the app package manifest. |
You're asking me questions about Windows? I haven't used Windows in decades other than incidentally (e.g. at someone else's house). The fine Scoop folks would be much better at answering questions like that. I honestly have absolutely no clue, and no system to test on to find out. As far as I can tell, there aren't any changes I can make that would help or hinder with this issue; it's all in packaging stuff that exists outside this repository. However, if symlinks are the whole problem here, then you could suggest to the Scoop folks that they avoid symlinks and just make "git-filter-repo.py" be a copy of "git-filter-repo" instead. |
If it's an issue with scoop, it might be better to figure out a step by step guide for dummies that get consistent result. Because people will blame the software, not the installer for issues. |
Not so sure it has to do with scoop, even cloning the repo will produce a Usually what I've seen for python repos is the opposite setup: the main code would be in the .py file, and the pretty named file would just call python on that file. |
Re-reading the scoop issue, it indeed appears to be an issue related to symlinks and they are willing to accept a patch to their installer that makes the file be a copy rather than a symlink (an issue I already mentioned in INSTALL.md). So, looks like there's nothing further to be done on the git-filter-repo side. Thanks for reporting! |
I have had days of dealing with related issues with none of the fixes I found working. (Could not try installing python from the store, as I am running this on a legacy windows server machine that cannot be upgraded, etc.) My final solution was to download the raw file, rename it with the .py extension, and remove the shebang. That should fix related issues on windows systems for single use cases like mine. The file can then be run as a normal python script with "py 'path\to\file.py' --args" from the repository directory. I would recommend adding this to the list of windows user tips, as if I had found it there it would have saved me hours. |
Raising the issue, with error name so anyone losing hours to this aren't as lost.
Part of the issue is related to poor installation guide for Window users.
Steps I took:
I was able to confirm that "git" works fine, "python" worked fine.
Workaround solution found thank to some helpful people another community:
%userprofile%\scoop\apps\git-filter-repo\current
git-filter-repo
(Not git-filter-repo.py)%programfiles%\Git\mingw64\libexec\git-core
I do not know why this is, but the install guide was an information overload and the second worse installation I've ever had to do.
The text was updated successfully, but these errors were encountered: