0

Using vscode and windows 10 i get the error message:

warning: LF will be replaced by CRLF in debug.log.
The file will have its original line endings in your working directory.
error: read error while indexing all_ASMX_trades.gsheet: Invalid argument
error: all_ASMX_trades.gsheet: failed to insert into database
error: unable to index file all_ASMX_trades.gsheet
fatal: adding files failed

According to other answers on stack, this can be resolved with the following:

git config core.autocrlf true

For example this answer appears to be complete: LF will be replaced by CRLF in git - What is that and is it important?

However, this did not seem to resolve the error message which seems to relate to a google sheet.

The only fix was to delete the google sheet, but naturally the user might want to use a google sheet (or other google docs).

So the question is, how to fix this error without having to remove the google sheet ?

D.L
  • 4,339
  • 5
  • 22
  • 45
  • Setting `core.autocrlf` is usually the wrong thing to do. Instead, set text or binary attributes and `eol` settings per file extension via `.gitattributes`. I don't know how gsheet files are encoded (and it may have changed since this) but see [this page](https://webapps.stackexchange.com/questions/89969/google-spreadsheets-csv-encoding-not-utf-8) for some background on gsheet encoding. – torek Feb 17 '22 at 00:26
  • @torek, this seems to be the correct path towards a solution. I can add that the issue appears to be the case **for all** google files (sheets, docs, sites etc...). – D.L Feb 18 '22 at 08:38
  • Google docs files are (often?) some kind of binary archive, it seems. In any case binary files need to be left alone; `core.autocrlf` tries to *guess* if a file is binary, and this guess can be wrong, so it's best not to have some dumb software like Git guess whether to wreck a file. :-) – torek Feb 18 '22 at 22:54

0 Answers0