Skip to content
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

Narrow scope of minimum version error messages #510

Open
ParkerRobb opened this issue Oct 9, 2023 · 0 comments
Open

Narrow scope of minimum version error messages #510

ParkerRobb opened this issue Oct 9, 2023 · 0 comments

Comments

@ParkerRobb
Copy link

When trying to run git filter-repo on a repo, I kept getting an Error: need git >= 2.22.0 message, even though I have both git versions 2.37.1 and 2.41.0 installed on my system.

Initially I spent a long time trying to figure out if git-filter-repo was pointing to an old version of git (2.10.0) I had recently uninstalled, or something like that.

After tracking the error message to line 2092 of the Python script, I was able to figure out that prior lines were looking for certain things in the output of git diff-tree -h:

# If we don't have fast-exoprt --reencode, we may also be missing
# diff-tree --combined-all-paths, which is even more important...
p = subproc.Popen('git diff-tree -h'.split(),
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.stdout.read()
if b'--combined-all-paths' not in output:
# We need a version of git-diff-tree with --combined-all-paths
raise SystemExit(_("Error: need git >= 2.22.0"))

I ran git diff-tree -h on my repo and found that I get error messages from git itself because something's wrong with my repo.

My point is that the canned error message thrown by git-filter-repo was hiding the real problem (that git itself was throwing errors when trying to operate on my repo) and opaquely telling me things that weren't true (that I had the wrong git version installed). The opaqueness of git-filter-repo's error message misdirected me and caused me to spend way longer than necessary trying to fix the problem. Narrowing the scope of and clarifying the error messages thrown by git-filter-repo would prevent people from going on a wild goose chase and spending hours trying to fix problems that do not actually exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant