commitName = Just "F\56515\56489lix"
-Which is I think ok, that's a utf-8 surrogate. But then
-that's passed into commitWithMetaData, which sets the environment
-variable to its content. And setting an environment variable to a String
-like that does not pass it through the filesystem encoding. And so the
-utf-8 surrogate is not converted back to the right bytes.
+Which is I think ok, that's a utf-8 surrogate in the filesystem encoding.
+Then that's passed into commitWithMetaData, which sets the environment
+variable to its content. And apparently it fails to be converted back to
+the right bytes.
One fix would be to keep it a ByteString all the way though, using
`System.Posix.Env.ByteString`. I tried converting all environment in
not incur mojibake -- it doesn't seem possible with the current library
ecosystem.
-So, I think the best fix is to avoid commitWithMetaData using environment
-variables.
+I tried making commitWithMetaData set the env var to a String that
+had the filesystem encoding applied. Eg `w82s (S.unpack (encodeBS v))`.
+Interestingly, that failed:
+
+git-annex: git: recoverEncode: invalid argument (cannot encode character '\195')
+
+Which looks like the filesystem encoding is being applied after all?
+And in System.Process.Posix, it does look like it does,
+withCEnvironment uses withFilePath on the contents of env.
+
+So huh, why then does the value not roundtrip?
"""]]