Re: [PATCH v2 3/3] sequencer: reencode to utf-8 before arrange rebase's todo list
From: Jeff King <hidden>
Date: 2019-11-01 16:59:23
On Fri, Nov 01, 2019 at 03:25:11PM +0700, Doan Tran Cong Danh wrote:
This problem wasn't specific to musl libc. On Linux with glibc, this problem can be observed by: for encoding in utf-8 iso-8859-1; do # commit using the encoding echo $encoding >file && git add file echo "éñcödèd with $encoding" | iconv -f utf-8 -t $encoding | git -c i18n.commitEncoding=$encoding commit -F - # and then fixup without it echo "$encoding fixed" >file && git add file git commit --fixup HEAD done git rebase -i --autosquash --root
Is it worth adding this as a test in t3900?
--- The code that demonstrate the problem on Linux with glibc is written by Jeff. But I don't know how to attribute him properly.
I'm OK with or without attribution, but people sometimes add a "Helped-by" trailer if they want to acknowledge someone.
quoted hunk ↗ jump to hunk
diff --git a/sequencer.c b/sequencer.c index 9d5964fd81..69430fe23f 100644 --- a/sequencer.c +++ b/sequencer.c@@ -5169,7 +5169,7 @@ int todo_list_rearrange_squash(struct todo_list *todo_list) *commit_todo_item_at(&commit_todo, item->commit) = item; parse_commit(item->commit); - commit_buffer = get_commit_buffer(item->commit, NULL); + commit_buffer = logmsg_reencode(item->commit, NULL, "UTF-8");
I think there are several other spots in this file that could use the same treatment. But I can live with it if you want to just fix the one that's bugging you and move on. It's still a strict improvement. -Peff