-
Notifications
You must be signed in to change notification settings - Fork 708
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
Improve installation documentation for Windows users #225
Conversation
Add a GitHub workflow for continuous testing
--use-mailmap was defined as `--mailmap .mailmap` except that it would set args.mailmap to ".mailmap" rather than b".mailmap" (in other words, it accidentally set it to a string rather than a bytestring). Since the --mailmap parameter is always passed as a bytestring, we ran into errors with calling unknown functions due to the type mismatch. Signed-off-by: Elijah Newren <newren@gmail.com>
The --path-rename flag expected an argument with a colon character (':') in it, which it assumed without checking. If the user gave an argument with no colon in it, this backtrace would be shown: File "/usr/local/bin/git-filter-repo", line 1626, in __call__ if values[0] and values[1] and not ( IndexError: list index out of range Add a real error message in place of the backtrace. Also check that there's exactly one colon; show an error message if there's more than one, as that syntax has no interpretation that is obviously the right one. Signed-off-by: Lassi Kortela <lassi@lassi.io>
Signed-off-by: Elijah Newren <newren@gmail.com>
Since Windows do allow to install Python more easily these days and takes care of most PATH stuff, use recommendations from Microsoft. The only hiccup is that Python from the store cannot parse get-filter-repo SHEBANG value when the script is installed via pip. That value is very long by default. Changing it to #!\python.exe solves the issue. Tested under clean installation of Windows 10 Enterprise version 20H2.
Sadly no. I still cannot run I can run it via I'm using Windows Command Promt as Git for Windows shell by the way. @dscho's fix is probably for Git Bash only? |
Does it work for you if you execute the command in Git Bash? |
Also, does |
Nope.
To summarize, these shebang values work: And these do not work: Maybe it's hitting path limit or something? UPDATE2: even easier way to check, no need to create symlink. Just use something like: There is definitely something wrong with that path size in msysgit path conversion. |
It's not msysgit. Anyway, what do |
And: do |
(which is a reparse point and points to C:\Users\username\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe same for python3) python -h, using python interactively and |
Maybe this is the limit right there: https://github.com/git-for-windows/git/blob/8b8cd53ead5e816b846ab5d26052afa3f4d62c13/compat/mingw.c#L1484 |
I don't know enough about C to understand why the real limit is 96 and not 100, but yea, it could be it. |
What I really don't understand is that the hash-bang line should read BTW I broke down and interrupted my AFK to play with this a bit, and I can finally reproduce your In the meantime, could I ask you to figure out an easy way to add the script location to the |
Shebang value is autogenerated by the packager which is used to install git-filter-repo which in my case is pip from the MS Store. I'm afraid we won't have control over it. I do agree that path limit needs to be fixed in Git for Windows, however git-filter-repo documentation still needs to be improved and fixing that limit only removes step 4 in my instructions, so this pull request still stands. Regarding adding Scripts folder to PATH, I thought about it for some time but could not find an easy way make it fully automated. If we copy git-filter-repo to Git's exec-path it won't be upgraded by the next Adding Scripts folder to .bashrc still leaves us with broken path with next Python upgrade and only works when running Git for Windows with Bash, not cmd. I believe the correct way would be to contact Python Software Foundation to see if they can implement this during MS Store installation, however I didn't find an easy way to leave this feedback for them. |
Maybe |
I doubt that these instructions are easier than to copy to Git's exec path :) But maybe it's just me. |
So... I'm not particularly happy with the really lengthy instructions. They suggest there is a more fundamental issue that needs to be solved elsewhere, and since I have multiple reports of people using filter-repo successfully on Windows, I'm worried the instructions might break some of those users while fixing it for others. If it were instead another issue or something I could link to that people could check, or if we could root cause that it really affected everyone, then I'd be more at ease that these instructions wouldn't break others. But fundamentally, there are a few more issues with these instructions:
I think all that's left after the above is (a) a fix for the shebang handling in Git for Windows, and (b) maybe being more overt on the HERE-BE-DRAGONS warning in the pip section about how it can cause problems for old versions of Git for Windows (anything released prior to April 2021), and additionally that it leaves to the users one of the installation steps -- copying the script into $PATH -- and that perhaps folks should strongly consider using other package managers instead. |
I got a chance to try out this hypothesis. Increasing the size from 100 to 248 fixes the |
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: 248 (the same as for `CreateDirectory()`). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
I opened git-for-windows/git#3165 to address that. |
Awesome, thanks! |
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: 248 (the same as for `CreateDirectory()`). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: 248 (the same as for `CreateDirectory()`). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: 248 (the same as for `CreateDirectory()`). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
I will answer your other points in a minute, but let me first explain my experience as a git-filter-repo user. Current note for Windows users in install docs suggests that there is something wrong with "default python" on Windows. OK, so I went to Python.org and tried to install it from there. I have also tried to download git-filter-repo from this repository and just place the file in my PATH as suggested. This didn't work. I have searched several rabbit holes coming empty handed. Since there are multiple ways how Python can be installed on Windows from the linked issues I had to guess if that relates to my setup or not (most of the time it didn't). After digging for several hours, to the point where I forgot why do I need Python anyway, I went back to using I would never came back if not for gitlab.com which supports rewriting history only with git-filter-repo. This time I thought that I won't follow git-filter-repo documentation but just install everything as I always do, using standard Windows tools. First I had to find out that, even if documentation suggest so, there is no default python on Windows. OK, so I thought, let's try to install it. What is the best way? Naturally I consulted my OS documentation which pointed to MS Store or WSL installs. MS Store install was a breeze and I have confirmed that python was placed in my PATH via Naturally, I was frustrated because of this and thought that nobody should go through the same experience as me, hence this PR.
I can change it from "should" to "could" and your point about Scoop folks is probably correct, but I'm thinking this way: software under every OS should be installed via standard way as much as possible, be it rpm/deb on Linux, dmg on macOS, or MS Store/MSI on Windows. This way it automatically takes cares of OS specific issues, most of the time is auto-updated, provisioned, etc. etc. Not every developer uses Python for their work, I would argue that a fair amount of them doesn't even know what Python or pip is. Also, if you are HTML developer, or PHP developer, or C# developer on Visual Studio, or database developer, you probably won't have any of the package managers installed (I didn't). Requiring these folks to install separate package manager just to install one simple python script to be able to rewrite git history is insane. If you are afraid that these instructions will break something, you can always revert them (using git-filter-repo to remove them from existence :)), but facts show that folks are still stuggling without them, jumping from one install method to another without any good reason, #193 #189 #124 Some of the issues they discovered are already fixed in latest Windows/Git for Windows versions, others are just not understanding how various Python install alternatives work and which PATHs are already defined and should not be touched. By the way most of these links suggest that installing from MS Store finally solved their problems.
I still think one or two lines how to install dependencies won't hurt and will solve more issues than it produces. Instructions are pointing to official MS' documentation and if something changes they will take care of it. Even if MS Store method won't be recommended some time in the future others (or me) could make another PR to update documentation, that's natural cycle of open source software. The same goes for other OSes, if anybody is willing to provide a PR to make more detailed instructions, why not?
That's not correct. pip is not buggy, Python's install method doesn't register Scripts in the PATH, but I'm sure that will be solved sooner rather then later. I just need to find a way to reach Python folks to leave this feedback for them.
I will test it when the next Git for Windows version is released, share my experience and update the instructions if that's OK? |
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via `pip`). Let's increase it to what is probably the maximum sensible path size: MAX_PATH. This makes `parse_interpreter()` in line with what `lookup_prog()` handles. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
Since Windows do allow to install Python more easily these days and takes care of most PATH stuff, use recommendations from Microsoft.
The only hiccup is that Git for Windows cannot parse get-filter-repo SHEBANG value when the script is installed via pip. That value is very long by default. Changing it to #!\python.exe solves the issue.
Tested under clean installation of Windows 10 Enterprise version 20H2.