Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes: > Hi Vasco, > > On Fri, 9 Dec 2016, Vasco Almeida wrote: > >> A Ter, 22-11-2016 às 09:42 -0800, Junio C Hamano escreveu: >> > The incremental update below looks sensible. We'd also want to >> > protect this codepath from a misconfigured two-or-more byte sequence >> > in core.commentchar, I would suspect, to be consistent. >> >> Are the below changes alright for what you propose? It just checks if >> the length of core.commentchar's value is 1, otherwise use '#' as the >> comment_line_char. >> As a note, when I set core.commentchar with "git config >> core.commentChar 'batata'", I get the following error message when I >> issue "git add -i": >> >> error: core.commentChar should only be one character >> fatal: bad config variable 'core.commentchar' in file '.git/config' at line 6 > > This is exactly the same issue I fixed for rebase -i recently. Yes, but the patch we see here punts "core.commentChar is not a single-byte single-letter--panic!" case differently. I think you did "just take the first one" in "rebase -i", which I think is more in line with the rest of the system, and this addition to Git.pm should do the same, I think.