frëd # that fr \xE...">

Is git ls-files characteristic agnostic? If not, then what?

I work on Mac OS 10.6 with git version 1.7.0.

If I do

echo "" > frëd # that fr \xEB d git ls-files --other 'f*' 

I'm coming back

 "fre\314\210d" # that 14 characters including two \'s 

whereas ls f* reports

 frëd # 4 characters, 5 bytes 

This leads to bad mage behavior in Emacs.

How can I get around this and git ls-files report the same thing that ls does without interpreting the file name bytes?

- david

+4
source share
1 answer

Git escapes the file name so that it does not contain difficulties for interpreting characters, such as terminal sequences, common delimiters, such as newlines, etc. Also (gnu) ls way, but here ls more bearable. You can use the -z flag to get the original names in a zero-terminated format with the machine. The magician must use it (escalation analysis is more fragile), correct it if you can.

+5
source

Source: https://habr.com/ru/post/1341223/


All Articles