Subject: Re: [PATCH v2 3/3] sequencer: reencode to utf-8 before arrange rebase's todo list

From: Danh Doan <[email-masked]>
Date: Sat, 2 Nov 2019 19:20:23 +0700

On 2019-11-02 08:02:15 +0700, Danh Doan wrote:
> Anyway, if we're going to working with a single encoding internally,
> can we take other extreme approach: reencode the commit message to
> utf-8 before writing the commit object? (Is there any codepoint in
> other encoding that can't be reencoded to utf-8?)

With this test (added into t3900):

    git checkout -b fixup-ISO-2022-JP-ISO-8859-1 C0 &&
    git config i18n.commitencoding ISO-2022-JP &&
    echo ISO-2022-JP >>F &&
    git commit -a -F "$TEST_DIRECTORY"/t3900/ISO-2022-JP.txt &&
    test_tick &&
    echo intermediate stuff >>G &&
    git add G &&
    git commit -a -m "intermediate commit" &&
    test_tick &&
    git config i18n.commitencoding ISO-8859-1 &&
    echo ISO-8859-1-fixup >>F &&
    git commit -a --fixup HEAD^ &&
    git config --unset-all i18n.commitencoding &&
    git rebase --autosquash -i HEAD^^^ &&
    git rev-list HEAD >actual &&
    test_line_count = 3 actual

reencode the commit message to utf-8 before writing the commit object
is (likely) the most simple option to fix it.

At the very least, the commit message for fixup/squash-ing commit must
be encoded in either utf-8 or the target-commit's encode.

-- 
Danh