Sets EOL convention ANY in case SYSTEM-EXTERNALFORMAT defaults to :THROUGH #2090
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow on to the issue I brought up in the technical meeting 3/31/2025.
The problem is that information returned by a GIT-COMMAND is read from a file with the value returned by SYSTEM-EXTERNALFORMAT. For a separate unknown reason, sometimes on my Mac UNIX-GETENV returns NIL for all of the possible ways that it tries to detect the system's default encoding, and in that case it returns the format :THROUGH, which just does byte-for-byte with no interpretation.
And if the command result-string has entries separated by LF, those don't get broken up when they are read by GIT-RESULT-TO-LINES. For the GIT-BRANCHES command, you get one big string with all the branch names that it knows about, separated by LF, and that one big string can't be converted to an atom. So, for example, it can't even decide that origin/master is one of the branches--it fails.
We talked about changing the default system format to something else (:THROUGH-ANY or :ISO8859/1). In this update I took the easy way out: I explicit assert that the EOL convention is ANY, no matter the selected format.
At least this error goes away. But presumably the return really is UTF-8, so if it had non-ASCII characters it would probably not do the right thing. We should figure out why e.g. (UNIX-GETENV "LANG") is sometimes defined and sometimes not (on Mac, maybe others). If we can't guarantee it automatically, then perhaps there should be a Lisp variable DEFAULT-SYSTEM-EXTERNALFORMAT that the function uses instead of :THROUGH when it gets no other information. At least the user has easier control.
But what I did here is a first improvement.