2

I am using git on a windows machine, and I'm trying to use it with both the cygwin terminal and Git Bash. When I try to rebase a topic branch to master, I get the following cryptic error:

☻~/code/project $ git rebase master
First, rewinding head to replay your work on top of it...
fatal: cannot convert from etf8 to utf8

What does this mean and how can I solve it? Google gives me zero results on this.

My locale is en_US.UTF-8, but I do not have any LC environment variables.

~ $ env | grep LC
~ $ env | grep LANG
LANG=en_US.UTF-8

This is the version I am using:

~ $ git --version
git version 1.7.9
danr
  • 2,405
  • 23
  • 24
  • What encodings are you using, with what locales? – Arafangion Jul 04 '12 at 16:13
  • @Arafangion: Good question! How do I figure out? I'm not very confident on windows. I might add that this repo is usually developed in Linux. – danr Jul 04 '12 at 16:14
  • From your prompt, it looks like you're using Cygwin -- if so, the `LC_*` and `LANG` variables are what you need, just as on Linux. – Andrew Aylett Jul 04 '12 at 16:39
  • What version of git are you using? – VonC Jul 04 '12 at 18:46
  • @VonC 1.7.9, so almost up to date – danr Jul 04 '12 at 18:50
  • Can you show the output of `git config i18n.commitencoding`? – CB Bailey Jul 04 '12 at 19:14
  • Also, can you show the output of `git log --pretty="%h %e" master..` from the branch that you are rebasing from? – CB Bailey Jul 04 '12 at 19:48
  • Is it the same version for cygwin (1.7.9) and windows (could be a msysgit1.7.10 or 1.7.11). Because utf8 was supported only for 1.7.10+: http://stackoverflow.com/questions/5854967/git-msysgit-accents-utf-8-the-definitive-answers/5855213#5855213 – VonC Jul 04 '12 at 19:59
  • @VonC: I'm sure that's not true (that utf-8 was only supported for >1.7.10). UTF-8 has been the primary log message encoding since the beginning. If you've committed messages in other encodings you've often been on your own until support for `i18n.commitencoding` has been honoured more widely. – CB Bailey Jul 04 '12 at 20:15
  • @CharlesBailey right, "supported" wasn't the appropriate term. I just wonder if a pre 1.7.10 version (on Cygwin) and a post 1.7.10 (msysgit on windows) might have an influence, considering a rebase has to replay commits (and their log message). – VonC Jul 04 '12 at 20:22
  • @CharlesBailey Plus, the only part of git which has that error message is [`mailinfo.c`](https://github.com/git/git/blob/master/builtin/mailinfo.c#L504-L521). Not sure how it is linked to rebase though, even if an old thread mentions that rebase was using git-am which was using mailinfo! (http://lists-archives.com/git/705623-git-mailinfo-doesn-t-stop-parsing-at-the-end-of-the-header.html) – VonC Jul 04 '12 at 20:25
  • I'm currently struggling with a Linux box w/ `1.7.2.3` that claims `fatal: cannot convert from Latin-1 to UTF-8` during rebase when trying to apply a commit with a utf8 multibyte in the commit message. Annoying. – Felix Frank Jul 03 '15 at 08:44
  • This particular issue seems to be resolved in `1.7.10.x` at least, so meh. – Felix Frank Jul 03 '15 at 09:07

1 Answers1

1

I think you have some corrupted files or messed configuration in your repository.

My google-fu didn't come up with a character encoding named etf8. I think it is utf8 with one bit error (the fifth position) in the letter u :

  • The ASCII code of u is 0x75 or 0111 0101 in binary
  • The ASCII code of e is 0x65 or 0110 0101 in binary

This is in my sense the most probable cause for the fatal error reported by git.

It can probably be fixed by editing an internal file or some config value in the repo (but unfortunately I'm not comfortable with git internals to know where to look).

overcoder
  • 1,523
  • 14
  • 24