Re: Broken interactive rebase text after some UTF-8 characters
- From
Alban Gruin <alban.gruin@gmail.com>
- Date
- Jan 31, 2019, 17:43 UTC
- Message-ID
- <505c2e2e-c9bc-aa57-c498-2acced0b8afa@gmail.com>
- In-Reply-To
- <8c43e31b-01d8-a1c5-d19c-8efd0e5c1714@talktalk.net>
Hi Phillip and Michal,
I think I found the bug.
If you look at .git/rebase-merge/git-rebase-todo.backup, which is created before the editor is opened, you can see that it does not have this problem. In between, transform_todos() is called and causes the problem reported by Michal.
This seems to be caused by a single line, sequencer:4661 (on b5101f9297, "Fourth batch after 2.20", 2019-01-29)[1]. If you add just before a something like this:
fwrite(item->arg, item->arg_len, sizeof(char), stdout);
You will see that the argument is properly written to stdout. But if you write this:
printf("%.*s\n", item->arg_len, item->arg);You will have the same broken output as in the todo file.
Are we misusing C formats?
[1] https://github.com/git/git/blob/master/sequencer.c#L4661
Cheers, Alban