Giter Club home page Giter Club logo

Comments (3)

JeremyCaney avatar JeremyCaney commented on July 18, 2024 2

@newren: Thank you so much for the prompt response and the pointers. I really should have done the due diligence of upgrading each of my distributions before reporting this.

At this point, everything is working perfectly. It's really a remarkable tool. I previously used various calls to git-filter-branch to accomplish this type of functionality, and have run into nearly every issue the Git documentation warns about at one time or another. Thank you so much for creating this!

In the end, there turned out to be three different issues that colluded together to make this a bit harder to troubleshoot. These seem a bit silly now that I've isolated them, but I'm going to leave them here in case they help anyone else reading this in the future:

  1. Microsoft has introduced a "feature" into Windows so that there's a stub of Python built into the operating system that provides a message on how to download Python. This means that nearly any path that ends in e.g. python, python3, or python3.exe will not throw an exception, even if it's not being picked up by the actual Python interpreter.
  2. When executing git-filter-repo—or any call that ends up getting captured by the Python stub—from the normal PowerShell environment, however, the above messages are not displayed. This is why I was getting no error, no response.
  3. I have been unable to get any variation of #! paths to be accepted when called from my PowerShell or git bash environments—even when I'm quite confident that the path format and location are correct. That meant all requests were either failing, or getting intercepted by the Python stub.

When combined together, those three issues meant that I would get an error if I put in an obviously incorrect or malformed path, but wouldn't get an error if I put in a valid path that ended in python or python3—regardless of whether or not it was a correct path. With the first issue resolved, I'm able to see the error yielded from the third issue:

fatal: 'filter-repo' appears to be a git command, but we were not able to execute it. Maybe git-filter-repo is broken?

That said, if I run git-filter-repo from my Anaconda PowerShell Prompt, everything works swimmingly! Indeed, it works right out of the box using your normal distribution without needing to modify the shebang at all, as the Anaconda distribution includes aliases to handle e.g. /usr/bin/env/ python3.

I'm not entirely sure why this won't execute in the normal PowerShell or git bash. Part of the issue is that I don't have Python in my path, as I normally use it from iPython or the Anaconda PowerShell Prompt. That said, it should accept a fully-qualified path pointing to the Python interpreter; I'm not sure what's going on there, but am going to assume PEBCAK.

Thank you again for both your help as well as writing this tool.

from git-filter-repo.

newren avatar newren commented on July 18, 2024

git 2.16.1 doesn't have the necessary facilities to work with filter-repo; you should be running into this line of code:

  if b'--combined-all-paths' not in output:
    raise SystemExit(_("Error: need a version of git whose diff-tree "
                       "command has the --combined-all-paths option"))

I would assume that any string that it doesn't find a translation for it would just return the original and then output it, but I've not heard of anyone else failing to get any output so I am wondering if something is going awry with translations.

Without access to the system or more messages or something, it'll be hard for me to debug. But I'd start by either removing the call to the '_' function (just remove the underscore) and see if you get an error message, check for any special environment variables, and upgrade your git version to one that is supported once you do get error messages. Hope that helps you at least get started.

from git-filter-repo.

newren avatar newren commented on July 18, 2024

I'm glad it's working for you now. Thanks for the kind words, and the explanation of what you found on your end which might just help someone else if they hit something similar and search through the issues for similar keywords.

from git-filter-repo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.