{"thread":{"id":"53260","subject":"git-filter-repo For Windows (possibly a request for a bash for Windows primer)","startedAt":"2020-04-20T14:03:38Z","lastAt":"2020-04-25T14:15:12Z","messageCount":6,"participants":["Kerry, Richard","Elijah Newren","Philip Oakley","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"395743","messageId":"AM0PR02MB371559B3C5445A3C9D39821B9CD40@AM0PR02MB3715.eurprd02.prod.outlook.com","threadId":"53260","inReplyTo":null,"subject":"git-filter-repo For Windows (possibly a request for a bash for Windows primer)","fromName":"Kerry, Richard","fromEmail":"richard.kerry@atos.net","sentAt":"2020-04-20T14:03:27Z","receivedAt":"2020-04-20T14:03:38Z","isPatch":false,"sender":{"key":"richard.kerry@atos.net","avatar":null},"body":"\nThis follows my earlier query for which the answer was \"use git-filter-repo\".\nI've cloned git-filter-repo from GitHub, and I've installed the latest Python (version 3.8).  I'm working on Windows.  Windows 10 if it makes any difference, so git is Git For Windows.\nThe first instruction for git-filter-repo is to copy it into the \"--exec-path\" of git.  That fails, saying Access is Denied.  So leaving aside the option to change the permissions I've followed the second half of the sentence and added my git-filter-repo location to my Path (or PATH if it's in bash).  Now running \"get filter-repo\" gives:\n/usr/bin/env: 'python3.exe': No such file or directory\n\nMy python executable is called python3.exe.  There is a note in the git-filter-repo project about certain Windows installations where it isn't called python3, but that now raises in my mind the question of whether I need to tweak git-filter-repo to look for \"python3.exe\" rather than just \"python3\".  Or can I take it that the Windows version of bash understands that it needs to add \".exe\" automatically?\n\nAssuming that is handled automatically, what do I now need to do to satisfy the error message?  Do I need to put something in bash-for-Windows' /usr/bin/env directory?  Or is there something else entirely that I should be doing?\n\nAnd is it OK to ask about this on this list, or should I be going to a git-filter-branch resource?  Or for Git For Windows?\n\nRegards,\nRichard.\n\n\n\n\nRichard Kerry\nBNCS Engineer, SI SOL Telco & Media Vertical Practice\nM: +44 (0)7812 325518\n2nd Floor, MidCity Place, 71 High Holborn, London, WC1V 6EA\nhttps://webmail.siemens-it-solutions.com/owa/redir.aspx?C=9fb20d019e3e4cb99344d708709a3177&URL=mailto%3arichard.kerry%40atos.net\n\n\nThis e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.\n"},{"id":"395747","messageId":"CABPp-BGis7wswAjwgTa84m-TsQznrQWQJVJZW0_MyN9ieFMzeA@mail.gmail.com","threadId":"53260","inReplyTo":"AM0PR02MB371559B3C5445A3C9D39821B9CD40@AM0PR02MB3715.eurprd02.prod.outlook.com","subject":"Re: git-filter-repo For Windows (possibly a request for a bash for Windows primer)","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2020-04-20T16:53:37Z","receivedAt":"2020-04-20T16:53:52Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Mon, Apr 20, 2020 at 8:11 AM Kerry, Richard <richard.kerry@atos.net> wrote:\n>\n>\n> This follows my earlier query for which the answer was \"use git-filter-repo\".\n> I've cloned git-filter-repo from GitHub, and I've installed the latest Python (version 3.8).  I'm working on Windows.  Windows 10 if it makes any difference, so git is Git For Windows.\n> The first instruction for git-filter-repo is to copy it into the \"--exec-path\" of git.  That fails, saying Access is Denied.  So leaving aside the option to change the permissions I've followed the second half of the sentence and added my git-filter-repo location to my Path (or PATH if it's in bash).  Now running \"get filter-repo\" gives:\n> /usr/bin/env: 'python3.exe': No such file or directory\n>\n> My python executable is called python3.exe.  There is a note in the git-filter-repo project about certain Windows installations where it isn't called python3, but that now raises in my mind the question of whether I need to tweak git-filter-repo to look for \"python3.exe\" rather than just \"python3\".  Or can I take it that the Windows version of bash understands that it needs to add \".exe\" automatically?\n>\n> Assuming that is handled automatically, what do I now need to do to satisfy the error message?  Do I need to put something in bash-for-Windows' /usr/bin/env directory?  Or is there something else entirely that I should be doing?\n>\n> And is it OK to ask about this on this list, or should I be going to a git-filter-branch resource?  Or for Git For Windows?\n>\n> Regards,\n> Richard.\n\nEmailing this list is fine.  You can also open an issue on GitHub for\nthe project if you prefer; I respond in both places.  I may have\nlimited ability to help with Windows issues since I don't have a\nWindows system to use or test on, though I have succeeded in fixing a\nfew Windows bugs based on reporter feedback. (So maybe this list is\nbetter because more people can chime in with Windows experience?)\nI've got at least a dozen or so reports of people using it\nsuccessfully on Windows so someone has figured it out.  I'll try to\nprovide a few pointers that might help.\n\nYou don't have to use \"#!/usr/bin/env python3\" or \"#!/usr/bin/env\npython\".  I could have put \"#!/usr/bin/python3\" there, but that might\nmake it specific to my system.  I figured other systems installed\npython3 somewhere other than /usr/bin/, but that /usr/bin/env should\nbe somewhat common and should find the python installation.  If\n/usr/bin/env doesn't happen to exist on your system, though, it is\nperfectly fine to have \"#!/System/Commands/python3\" or whatever is\nneeded.\n\nIf installation is difficult, you could consider using a package\nmanager.  In particular, the scoop package manager, built for Windows,\nwas one of the first out there to package git-filter-repo -- it was\neven ahead of most the linux package managers.  (And, yes, scoop can\nalso be used to install python3 as far as I understand.)  I haven't\nused it myself (because I don't have a Windows system as I mentioned\nbefore), but since they were so interested in packaging\ngit-filter-repo and making \"scoop install git-filter-repo\" part of the\ninstructions (https://github.com/newren/git-filter-repo/issues/20),\nthey look like a friendly bunch that are willing to help.\n\nI also looked through the issues and PRs related to Windows, and\nthought that the following links particularly had interesting comments\nthat might be useful to someone running on Windows:\n  * https://github.com/newren/git-filter-repo/issues/36\n  * https://github.com/newren/git-filter-repo/pull/10\n  * https://github.com/newren/git-filter-repo/issues/48\nI don't know if any of them will solve your particular problem, but\nthey seemed more likely to be of interest or use than most.  Also,\nI'll repeat the link for search for reports of Windows issues with\ngit-filter-repo in case I missed one that might be useful to you:\n  * https://github.com/newren/git-filter-repo/issues?q=is%3Aissue+windows\n\nAnyway, I hope at least one of those pointers is useful to you.\n\nElijah\n"},{"id":"395749","messageId":"CABPp-BHjF4AJdTrdqxvgsZq+UBZd06upFOHEx-8eQ8qKO-CtkA@mail.gmail.com","threadId":"53260","inReplyTo":"CABPp-BGis7wswAjwgTa84m-TsQznrQWQJVJZW0_MyN9ieFMzeA@mail.gmail.com","subject":"Re: git-filter-repo For Windows (possibly a request for a bash for Windows primer)","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2020-04-20T17:24:42Z","receivedAt":"2020-04-20T17:24:56Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Mon, Apr 20, 2020 at 9:53 AM Elijah Newren <newren@gmail.com> wrote:\n>\n> On Mon, Apr 20, 2020 at 8:11 AM Kerry, Richard <richard.kerry@atos.net> wrote:\n> >\n> >\n> > This follows my earlier query for which the answer was \"use git-filter-repo\".\n> > I've cloned git-filter-repo from GitHub, and I've installed the latest Python (version 3.8).  I'm working on Windows.  Windows 10 if it makes any difference, so git is Git For Windows.\n> > The first instruction for git-filter-repo is to copy it into the \"--exec-path\" of git.  That fails, saying Access is Denied.  So leaving aside the option to change the permissions I've followed the second half of the sentence and added my git-filter-repo location to my Path (or PATH if it's in bash).  Now running \"get filter-repo\" gives:\n> > /usr/bin/env: 'python3.exe': No such file or directory\n> >\n> > My python executable is called python3.exe.  There is a note in the git-filter-repo project about certain Windows installations where it isn't called python3, but that now raises in my mind the question of whether I need to tweak git-filter-repo to look for \"python3.exe\" rather than just \"python3\".  Or can I take it that the Windows version of bash understands that it needs to add \".exe\" automatically?\n> >\n> > Assuming that is handled automatically, what do I now need to do to satisfy the error message?  Do I need to put something in bash-for-Windows' /usr/bin/env directory?  Or is there something else entirely that I should be doing?\n> >\n> > And is it OK to ask about this on this list, or should I be going to a git-filter-branch resource?  Or for Git For Windows?\n> >\n> > Regards,\n> > Richard.\n>\n> Emailing this list is fine.  You can also open an issue on GitHub for\n> the project if you prefer; I respond in both places.  I may have\n> limited ability to help with Windows issues since I don't have a\n> Windows system to use or test on, though I have succeeded in fixing a\n> few Windows bugs based on reporter feedback. (So maybe this list is\n> better because more people can chime in with Windows experience?)\n> I've got at least a dozen or so reports of people using it\n> successfully on Windows so someone has figured it out.  I'll try to\n> provide a few pointers that might help.\n>\n> You don't have to use \"#!/usr/bin/env python3\" or \"#!/usr/bin/env\n> python\".  I could have put \"#!/usr/bin/python3\" there, but that might\n> make it specific to my system.  I figured other systems installed\n> python3 somewhere other than /usr/bin/, but that /usr/bin/env should\n> be somewhat common and should find the python installation.  If\n> /usr/bin/env doesn't happen to exist on your system, though, it is\n> perfectly fine to have \"#!/System/Commands/python3\" or whatever is\n> needed.\n>\n> If installation is difficult, you could consider using a package\n> manager.  In particular, the scoop package manager, built for Windows,\n> was one of the first out there to package git-filter-repo -- it was\n> even ahead of most the linux package managers.  (And, yes, scoop can\n> also be used to install python3 as far as I understand.)  I haven't\n> used it myself (because I don't have a Windows system as I mentioned\n> before), but since they were so interested in packaging\n> git-filter-repo and making \"scoop install git-filter-repo\" part of the\n> instructions (https://github.com/newren/git-filter-repo/issues/20),\n> they look like a friendly bunch that are willing to help.\n>\n> I also looked through the issues and PRs related to Windows, and\n> thought that the following links particularly had interesting comments\n> that might be useful to someone running on Windows:\n>   * https://github.com/newren/git-filter-repo/issues/36\n>   * https://github.com/newren/git-filter-repo/pull/10\n>   * https://github.com/newren/git-filter-repo/issues/48\n> I don't know if any of them will solve your particular problem, but\n> they seemed more likely to be of interest or use than most.  Also,\n> I'll repeat the link for search for reports of Windows issues with\n> git-filter-repo in case I missed one that might be useful to you:\n>   * https://github.com/newren/git-filter-repo/issues?q=is%3Aissue+windows\n\nOh, also https://github.com/newren/git-filter-repo/issues/56 which\nsuggests PowerShell may mess things up (and in a different way than\nissue 36 showed).\n"},{"id":"395752","messageId":"9478ea01-8d1d-a897-48f1-813f88dde072@iee.email","threadId":"53260","inReplyTo":"CABPp-BHjF4AJdTrdqxvgsZq+UBZd06upFOHEx-8eQ8qKO-CtkA@mail.gmail.com","subject":"Re: git-filter-repo For Windows (possibly a request for a bash for Windows primer)","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2020-04-20T18:46:51Z","receivedAt":"2020-04-20T18:47:04Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 20/04/2020 18:24, Elijah Newren wrote:\n> On Mon, Apr 20, 2020 at 9:53 AM Elijah Newren <newren@gmail.com> wrote:\n>> On Mon, Apr 20, 2020 at 8:11 AM Kerry, Richard <richard.kerry@atos.net> wrote:\n>>>\n>>> This follows my earlier query for which the answer was \"use git-filter-repo\".\n>>> I've cloned git-filter-repo from GitHub, and I've installed the latest Python (version 3.8).  I'm working on Windows.  Windows 10 if it makes any difference, so git is Git For Windows.\n>>> The first instruction for git-filter-repo is to copy it into the \"--exec-path\" of git.  That fails, saying Access is Denied.  So leaving aside the option to change the permissions I've followed the second half of the sentence and added my git-filter-repo location to my Path (or PATH if it's in bash).  Now running \"get filter-repo\" gives:\n>>> /usr/bin/env: 'python3.exe': No such file or directory\n>>>\n>>> My python executable is called python3.exe.  There is a note in the git-filter-repo project about certain Windows installations where it isn't called python3, but that now raises in my mind the question of whether I need to tweak git-filter-repo to look for \"python3.exe\" rather than just \"python3\".  Or can I take it that the Windows version of bash understands that it needs to add \".exe\" automatically?\n>>>\n>>> Assuming that is handled automatically, what do I now need to do to satisfy the error message?  Do I need to put something in bash-for-Windows' /usr/bin/env directory?  Or is there something else entirely that I should be doing?\n>>>\n>>> And is it OK to ask about this on this list, or should I be going to a git-filter-branch resource?  Or for Git For Windows?\n>>>\n>>> Regards,\n>>> Richard.\n>> Emailing this list is fine.  You can also open an issue on GitHub for\n>> the project if you prefer; I respond in both places.  I may have\n>> limited ability to help with Windows issues since I don't have a\n>> Windows system to use or test on, though I have succeeded in fixing a\n>> few Windows bugs based on reporter feedback. (So maybe this list is\n>> better because more people can chime in with Windows experience?)\n>> I've got at least a dozen or so reports of people using it\n>> successfully on Windows so someone has figured it out.  I'll try to\n>> provide a few pointers that might help.\n>>\n>> You don't have to use \"#!/usr/bin/env python3\" or \"#!/usr/bin/env\n>> python\".  I could have put \"#!/usr/bin/python3\" there, but that might\n>> make it specific to my system.  I figured other systems installed\n>> python3 somewhere other than /usr/bin/, but that /usr/bin/env should\n>> be somewhat common and should find the python installation.  If\n>> /usr/bin/env doesn't happen to exist on your system, though, it is\n>> perfectly fine to have \"#!/System/Commands/python3\" or whatever is\n>> needed.\n>>\n>> If installation is difficult, you could consider using a package\n>> manager.  In particular, the scoop package manager, built for Windows,\n>> was one of the first out there to package git-filter-repo -- it was\n>> even ahead of most the linux package managers.  (And, yes, scoop can\n>> also be used to install python3 as far as I understand.)  I haven't\n>> used it myself (because I don't have a Windows system as I mentioned\n>> before), but since they were so interested in packaging\n>> git-filter-repo and making \"scoop install git-filter-repo\" part of the\n>> instructions (https://github.com/newren/git-filter-repo/issues/20),\n>> they look like a friendly bunch that are willing to help.\n>>\n>> I also looked through the issues and PRs related to Windows, and\n>> thought that the following links particularly had interesting comments\n>> that might be useful to someone running on Windows:\n>>   * https://github.com/newren/git-filter-repo/issues/36\n>>   * https://github.com/newren/git-filter-repo/pull/10\n>>   * https://github.com/newren/git-filter-repo/issues/48\n>> I don't know if any of them will solve your particular problem, but\n>> they seemed more likely to be of interest or use than most.  Also,\n>> I'll repeat the link for search for reports of Windows issues with\n>> git-filter-repo in case I missed one that might be useful to you:\n>>   * https://github.com/newren/git-filter-repo/issues?q=is%3Aissue+windows\n> Oh, also https://github.com/newren/git-filter-repo/issues/56 which\n> suggests PowerShell may mess things up (and in a different way than\n> issue 36 showed).\nA similar Python issue occurs on Windows, as reported at\nhttps://github.com/git-for-windows/git/issues/2594\n\nwith a reply by dscho reminding that:\n\nThis issue is listed specifically in the Known Issues in our Release Notes:\n\n        Some console programs, most notably non-MSYS2 Python, PHP, Node\nand OpenSSL, interact correctly with MinTTY only when called through\nwinpty (e.g. the Python console needs to be started as winpty python\ninstead of just python).\n\nThe installer even suggests (on the page titled \"Configuring the\nterminal emulator to use with Git Bash\") to\n\n    Use Windows' default console window\n    [...] which works well with Win32 console programs such as\ninteractive Python or node.js [...]\n\nHope that helps.\n--\nPhilip\n\n"},{"id":"395834","messageId":"AM0PR02MB37150CFFDD7A3871DB43DFBD9CD50@AM0PR02MB3715.eurprd02.prod.outlook.com","threadId":"53260","inReplyTo":"9478ea01-8d1d-a897-48f1-813f88dde072@iee.email","subject":"Re: git-filter-repo For Windows (possibly a request for a bash for Windows primer)","fromName":"Kerry, Richard","fromEmail":"richard.kerry@atos.net","sentAt":"2020-04-21T14:52:56Z","receivedAt":"2020-04-21T14:53:10Z","isPatch":false,"sender":{"key":"richard.kerry@atos.net","avatar":null},"body":"Thanks for everyone's advice and assistance.\nI had a look at all the links provided and wasn't convinced any of them quite covered my requirement, but I have now made some progress using Scoop.\n\nI had hoped that all I would need to do would be:\n1. Install latest Python for Windows (3.8). Install for All Users means it's in C:\\Program Files\\Python38, and that's in the Path.\n2. Clone git-filter-repo.\n3. Point Path at git-filter-repo.  (Alternative was to copy it into \"exec-path\" folder under Git, but that was protected.)\n4. Run it.\n\nThat didn't work: /usr/bin/env: 'python3': No such file or directory.\nThat string pointed me at the shebang line of git-filter-repo, so I set about trying anything that I thought might point at my Python installation.  Nothing I tried worked.  Some things, like \"/bin/sh\", did indicate that the right file was being found and executed, but gave errors that it was being executed as a shell script, which of course it isn't.  Any attempt to point at the python exe seemed to say things along the lines of \"git can find it but not understand it\" (sorry I can't now copy in the real error message as I had to close the Bash shell in order to update GfW.)\n\nSo I gave up on getting it to run using raw Windows - well not entirely raw Windows as it's going to be run from Bash-for-git-for-windows (or so I thought).\nInstalled Scoop.  Got Scoop to install git-filter-repo and python.  At last that lets me run it and have it do something useful.\nThough actually as Scoop gives its instructions for being run from PowerShell I'm not in the end running from bash at all.\n\nFirst attempt at running it was using:\n\ngit filter-repo --analyze --source=core_system_archive\nwhich responded \"not a git repository\" even though core_system_archive does contain a \".git\".\nBut then \ngit filter-repo --analyze --source=core_system_archive/.git\nor\ngit filter-repo --analyze --source=./core_system_archive/.git\ndidn't work either, same error, although it looks to me like core_system_archive/.git is a git repo.  So would I need some different syntax to make that work?  (And I've since noticed that examples use space rather than '=' to separate keyword from param, so I've tried that, with the same failures)\nSo next option was to \"cd .\\core_system_archive\", then just\ngit filter-repo --analyze \nWhich has worked.\nThough it isn't clear what was wrong with the parameter I used for --source.  How am I supposed to reference a source repo without cd-ing into it?\n\nSo thanks everyone for a lot of hints, but for me, under Windows, only the Scoop package manager managed to get all the right settings for filter-repo to work.\nAnd only now, having been rather rushing to get this to work due to other priorities, have I seen the comment about using pip to install it, so maybe that would also have worked.\n\nRegards,\nRichard.\n\nOh, and having also seen Philip's reply (below) I don't think I would have recognized it as relating to my issue.\nWhat is winpty?  Should that have gone in the shebang line of git-filter-repo in some form?\n\n\nFrom: Philip Oakley <philipoakley@iee.email>\n\nwith a reply by dscho reminding that:\n\nThis issue is listed specifically in the Known Issues in our Release Notes:\n\n        Some console programs, most notably non-MSYS2 Python, PHP, Node\nand OpenSSL, interact correctly with MinTTY only when called through\nwinpty (e.g. the Python console needs to be started as winpty python\ninstead of just python).\n\nThe installer even suggests (on the page titled \"Configuring the\nterminal emulator to use with Git Bash\") to\n    Use Windows' default console window\n    [...] which works well with Win32 console programs such as\ninteractive Python or node.js [...]\n\n\nRegards\nRichard Kerry\n\nBNCS Engineer, SI SOL Telco & Media Vertical Practice\nM: +44 (0)7812 325518\n2nd Floor, MidCity Place, 71 High Holborn, London, WC1V 6EA\nrichard.kerry@atos.net\n\nThis e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy\n it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free\n and will not be liable for any damages resulting from any virus transmitted.\n\n\n"},{"id":"396256","messageId":"nycvar.QRO.7.76.6.2004251610300.18039@tvgsbejvaqbjf.bet","threadId":"53260","inReplyTo":"AM0PR02MB37150CFFDD7A3871DB43DFBD9CD50@AM0PR02MB3715.eurprd02.prod.outlook.com","subject":"Re: git-filter-repo For Windows (possibly a request for a bash for Windows primer)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-04-25T14:15:07Z","receivedAt":"2020-04-25T14:15:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Richard,\n\nOn Tue, 21 Apr 2020, Kerry, Richard wrote:\n\n> Thanks for everyone's advice and assistance.\n> I had a look at all the links provided and wasn't convinced any of them\n> quite covered my requirement, but I have now made some progress using\n> Scoop.\n>\n> I had hoped that all I would need to do would be:\n> 1. Install latest Python for Windows (3.8). Install for All Users means it's in C:\\Program Files\\Python38, and that's in the Path.\n\nI installed it via the Microsoft Store. This put it into my user-specific\nAppData, and it added two items to the PATH.\n\nUnfortunately, even calling `python3.exe` from the PATH does not work: it\nis apparently some placeholder that MSYS2 (and therefore Git Bash and\n`env.exe`) have no idea what to do with.\n\nWhat did work for me was `env python`. Of course, I don't have Python 2.x\ninstalled, so that might not be an option for you.\n\n> 2. Clone git-filter-repo.\n> 3. Point Path at git-filter-repo.  (Alternative was to copy it into \"exec-path\" folder under Git, but that was protected.)\n\nFor the record, Git for Windows also adds the `bin` folder in your home\ndirectory to the PATH. That is where you are supposed to put additional\nthings.\n\nGit for Windows considers C:\\Program Files\\Git its own home, and\nit might remove your files without prior warning during an upgrade.\n\nIt will leave `~/bin/` alone, of course.\n\nHopefully these two hints prove useful to you.\n\nCiao,\nJohannes\n\n> 4. Run it.\n>\n> That didn't work: /usr/bin/env: 'python3': No such file or directory.\n> That string pointed me at the shebang line of git-filter-repo, so I set about trying anything that I thought might point at my Python installation.  Nothing I tried worked.  Some things, like \"/bin/sh\", did indicate that the right file was being found and executed, but gave errors that it was being executed as a shell script, which of course it isn't.  Any attempt to point at the python exe seemed to say things along the lines of \"git can find it but not understand it\" (sorry I can't now copy in the real error message as I had to close the Bash shell in order to update GfW.)\n>\n> So I gave up on getting it to run using raw Windows - well not entirely raw Windows as it's going to be run from Bash-for-git-for-windows (or so I thought).\n> Installed Scoop.  Got Scoop to install git-filter-repo and python.  At last that lets me run it and have it do something useful.\n> Though actually as Scoop gives its instructions for being run from PowerShell I'm not in the end running from bash at all.\n>\n> First attempt at running it was using:\n>\n> git filter-repo --analyze --source=core_system_archive\n> which responded \"not a git repository\" even though core_system_archive does contain a \".git\".\n> But then \n> git filter-repo --analyze --source=core_system_archive/.git\n> or\n> git filter-repo --analyze --source=./core_system_archive/.git\n> didn't work either, same error, although it looks to me like core_system_archive/.git is a git repo.  So would I need some different syntax to make that work?  (And I've since noticed that examples use space rather than '=' to separate keyword from param, so I've tried that, with the same failures)\n> So next option was to \"cd .\\core_system_archive\", then just\n> git filter-repo --analyze \n> Which has worked.\n> Though it isn't clear what was wrong with the parameter I used for --source.  How am I supposed to reference a source repo without cd-ing into it?\n>\n> So thanks everyone for a lot of hints, but for me, under Windows, only the Scoop package manager managed to get all the right settings for filter-repo to work.\n> And only now, having been rather rushing to get this to work due to other priorities, have I seen the comment about using pip to install it, so maybe that would also have worked.\n>\n> Regards,\n> Richard.\n>\n> Oh, and having also seen Philip's reply (below) I don't think I would have recognized it as relating to my issue.\n> What is winpty?  Should that have gone in the shebang line of git-filter-repo in some form?\n>\n>\n> From: Philip Oakley <philipoakley@iee.email>\n>\n> with a reply by dscho reminding that:\n>\n> This issue is listed specifically in the Known Issues in our Release Notes:\n>\n>         Some console programs, most notably non-MSYS2 Python, PHP, Node\n> and OpenSSL, interact correctly with MinTTY only when called through\n> winpty (e.g. the Python console needs to be started as winpty python\n> instead of just python).\n>\n> The installer even suggests (on the page titled \"Configuring the\n> terminal emulator to use with Git Bash\") to\n>     Use Windows' default console window\n>     [...] which works well with Win32 console programs such as\n> interactive Python or node.js [...]\n>\n>\n> Regards\n> Richard Kerry\n>\n> BNCS Engineer, SI SOL Telco & Media Vertical Practice\n> M: +44 (0)7812 325518\n> 2nd Floor, MidCity Place, 71 High Holborn, London, WC1V 6EA\n> richard.kerry@atos.net\n>\n> This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy\n>  it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free\n>  and will not be liable for any damages resulting from any virus transmitted.\n>\n>\n>\n"}]}