Re: [PATCH v2 3/3] sequencer: reencode to utf-8 before arrange rebase's todo list
- From
Jeff King <peff@peff.net>
- Date
- Nov 1, 2019, 16:59 UTC
- Message-ID
- <20191101165921.GD26219@sigill.intra.peff.net>
- In-Reply-To
- <b7927b27235422ac53595cfaa63b4f1cbe009013.1572596278.git.congdanhqx@gmail.com>
On Fri, Nov 01, 2019 at 03:25:11PM +0700, Doan Tran Cong Danh wrote:
Show 13 quoted lines
> 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.
Show 10 quoted lines
> 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