{"thread":{"id":"21583","subject":"Re: commit log encoding [Was: [PATCH 1/2] tree-wide: fix typos \"offest\" -> \"offset\"]","startedAt":"2009-11-11T14:13:43Z","lastAt":"2009-11-25T14:00:52Z","messageCount":5,"participants":["Uwe Kleine-König","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"127332","messageId":"20091111141342.GA1849@pengutronix.de","threadId":"21583","inReplyTo":"alpine.LSU.2.00.0911111318260.15039@wotan.suse.de","subject":"Re: commit log encoding [Was: [PATCH 1/2] tree-wide: fix typos \"offest\" -> \"offset\"]","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-11-11T14:13:43Z","receivedAt":"2009-11-11T14:13:43Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"On Wed, Nov 11, 2009 at 01:19:32PM +0100, Jiri Kosina wrote:\n> On Wed, 11 Nov 2009, Uwe Kleine-König wrote:\n> \n> > > Thanks for noticing, I had a bug in my git charset config for quite some \n> > > time. Fixed it now.\n> > Now my name is latin1 encoded.  It should be utf-8, doesn't it?\n> \n> It's not latin1, it's iso-8859-2\nFor my name it makes no difference.\n\n>                                   which is what I use on my terminals.\n> And git can handle that fine too (it stores the encoding together with the \n> commit).\nAh, OK, that's news to me, but you're right.  I have here:\n\n\t~/gsrc/linux-2.6$ git cat-file commit 30ff0743f88a70f52a4de5ea5bcb1fd29bcfab2d\n\ttree 6121d35bb2606878be636e897fa77cd51804d724\n\tparent 916b7c73db593510d5c38706be2f2888981747ee\n\tauthor Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de> 1256757064 +0100\n\tcommitter Jiri Kosina <jkosina@suse.cz> 1257780224 +0100\n\tencoding ISO-8859-2\n\n\ttree-wide: fix typos \"couter\" -> \"counter\"\n\n\tThis patch was generated by\n\n\t\tgit grep -E -i -l 'couter' | xargs -r perl -p -i -e 's/couter/counter/'\n\n\tSigned-off-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>\n\tSigned-off-by: Jiri Kosina <jkosina@suse.cz>\n\nSo the remaining question is: Does the encoding specified in the\nencoding \"header\" also apply to the other headers?\n\nIf yes[1] then there's a bug in git-shortlog\n\n\t~/gsrc/linux-2.6$ git shortlog linus/master..trivial/for-next | grep Uwe\n\tUwe Kleine-K�nig (5):\n\n(with linus/master = 799dd75b1a8380a967c929a4551895788c374b31,\ntrivial/for-next = 4030ec040a0e21fe9953da70eaa59ee7b4f2297b).\n \nBest regards\nUwe\n\n[1] git log linus/master..trivial/for-next looks OK, so I suspect it\ndoes apply.\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"},{"id":"128247","messageId":"1259075555-7831-1-git-send-email-u.kleine-koenig@pengutronix.de","threadId":"21583","inReplyTo":"20091111141342.GA1849@pengutronix.de","subject":"[PATCH] shortlog: respect commit encoding","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-11-24T15:12:35Z","receivedAt":"2009-11-24T15:12:35Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Before this change the author was taken from the raw commit without\nreencoding.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\nCc: Jiri Kosina <jkosina@suse.cz>\n---\n builtin-shortlog.c  |   25 +++++++++++++++----------\n t/t4201-shortlog.sh |   24 ++++++++++++++++++++++++\n 2 files changed, 39 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex 8aa63c7..050bda8 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -139,14 +139,19 @@ static void read_from_stdin(struct shortlog *log)\n void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n {\n \tconst char *author = NULL, *buffer;\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tstruct strbuf ufbuf = STRBUF_INIT;\n+\tstruct pretty_print_context ctx = {0};\n \n-\tbuffer = commit->buffer;\n+\tpretty_print_commit(CMIT_FMT_RAW, commit, &buf, &ctx);\n+\n+\tbuffer = buf.buf;\n \twhile (*buffer && *buffer != '\\n') {\n \t\tconst char *eol = strchr(buffer, '\\n');\n \n-\t\tif (eol == NULL)\n+\t\tif (eol == NULL) {\n \t\t\teol = buffer + strlen(buffer);\n-\t\telse\n+\t\t} else\n \t\t\teol++;\n \n \t\tif (!prefixcmp(buffer, \"author \"))\n@@ -157,20 +162,20 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n \t\tdie(\"Missing author: %s\",\n \t\t    sha1_to_hex(commit->object.sha1));\n \tif (log->user_format) {\n-\t\tstruct strbuf buf = STRBUF_INIT;\n \t\tstruct pretty_print_context ctx = {0};\n \t\tctx.abbrev = DEFAULT_ABBREV;\n \t\tctx.subject = \"\";\n \t\tctx.after_subject = \"\";\n \t\tctx.date_mode = DATE_NORMAL;\n-\t\tpretty_print_commit(CMIT_FMT_USERFORMAT, commit, &buf, &ctx);\n-\t\tinsert_one_record(log, author, buf.buf);\n-\t\tstrbuf_release(&buf);\n-\t\treturn;\n-\t}\n-\tif (*buffer)\n+\t\tpretty_print_commit(CMIT_FMT_USERFORMAT, commit, &ufbuf, &ctx);\n+\t\tbuffer = ufbuf.buf;\n+\n+\t} else if (*buffer)\n \t\tbuffer++;\n+\n \tinsert_one_record(log, author, !*buffer ? \"<none>\" : buffer);\n+\tstrbuf_release(&ufbuf);\n+\tstrbuf_release(&buf);\n }\n \n static void get_from_rev(struct rev_info *rev, struct shortlog *log)\ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex 405b971..118204b 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -51,5 +51,29 @@ git log HEAD > log\n GIT_DIR=non-existing git shortlog -w < log > out\n \n test_expect_success 'shortlog from non-git directory' 'test_cmp expect out'\n+iconvfromutf8toiso885915() {\n+\tprintf \"%s\" \"$@\" | iconv -f UTF-8 -t ISO-8859-15\n+}\n+\n+git reset --hard \"$commit\"\n+git config --unset i18n.commitencoding\n+echo 2 > a1\n+git commit --quiet -m \"set a1 to 2 and some non-ASCII chars: Äßø\" --author=\"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\" a1\n+\n+git config i18n.commitencoding \"ISO-8859-15\"\n+echo 3 > a1\n+git commit --quiet -m \"$(iconvfromutf8toiso885915 \"set a1 to 3 and some non-ASCII chars: áæï\")\" --author=\"$(iconvfromutf8toiso885915 \"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\")\" a1\n+git config --unset i18n.commitencoding\n+\n+git shortlog HEAD~2.. > out\n+\n+cat > expect << EOF\n+Jöhännës \"Dschö\" Schindëlin (2):\n+      set a1 to 2 and some non-ASCII chars: Äßø\n+      set a1 to 3 and some non-ASCII chars: áæï\n+\n+EOF\n+\n+test_expect_success 'shortlog encoding' 'test_cmp expect out'\n \n test_done\n-- \n1.6.5.3\n"},{"id":"128248","messageId":"20091124160837.GA7296@pengutronix.de","threadId":"21583","inReplyTo":"1259075555-7831-1-git-send-email-u.kleine-koenig@pengutronix.de","subject":"more problems with commit encoding [Was: [PATCH] shortlog: respect commit encoding]","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-11-24T16:08:37Z","receivedAt":"2009-11-24T16:08:37Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nOn Tue, Nov 24, 2009 at 04:12:35PM +0100, Uwe Kleine-König wrote:\n> Before this change the author was taken from the raw commit without\n> reencoding.\nwhile at it, userformats have the same problem:\n\n\tlinux-2.6$ for rev in b71a8eb bc9be01; do git show --format=%an $rev | head -n1; git show $rev | grep Auth; done\n\tUwe Kleine-K�nig\n\tAuthor: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n\tUwe Kleine-König\n\tAuthor: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n\nThat is, git show correctly reencodes its output for b71a8eb, but only\nwithout --format=...\n\n(The patches above are in linux-next.)\n\nAnd now take this (assuming locale and commitencoding are utf-8):\n\n\tgit init\n\tgit config user.name 'Jöhännës Dschö'\n\techo spam > ham\n\tgit add ham\n\tgit commit -m 'initial commit'\n\tgit branch branch\n\techo more spam > ham\n\tgit add ham\n\tgit commit -m \"Commitlog matching '\\nencoding:'\n\nencoding: latin1\n\"\n\tgit checkout branch\n\techo much more spam > ham\n\tgit add ham\n\tgit commit -C master\n\tgit show | grep Author:\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"},{"id":"128273","messageId":"7vfx8376hd.fsf@alter.siamese.dyndns.org","threadId":"21583","inReplyTo":"1259075555-7831-1-git-send-email-u.kleine-koenig@pengutronix.de","subject":"Re: [PATCH] shortlog: respect commit encoding","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-25T01:12:14Z","receivedAt":"2009-11-25T01:12:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Uwe Kleine-König  <u.kleine-koenig@pengutronix.de> writes:\n\n> Before this change the author was taken from the raw commit without\n> reencoding.\n\nI see people often begin with \"before this change\" and stop the log\nmessage after making a statement of a fact.  I mildly dislike this style,\nespecially when the resulting message does not state that it is bad (and\nif necessary why it is bad) nor state in what way the code after the\nchange is good.\n\n\tDon't take the author name information without re-encoding\n        from the raw commit object buffer.\n\nis easier to read, at least for me.\n\n>  \twhile (*buffer && *buffer != '\\n') {\n>  \t\tconst char *eol = strchr(buffer, '\\n');\n>  \n> -\t\tif (eol == NULL)\n> +\t\tif (eol == NULL) {\n>  \t\t\teol = buffer + strlen(buffer);\n> -\t\telse\n> +\t\t} else\n>  \t\t\teol++;\n>  \t\tif (!prefixcmp(buffer, \"author \"))\n\nWhat is this hunk for?\n\n> @@ -157,20 +162,20 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n>  \t\tdie(\"Missing author: %s\",\n>  \t\t    sha1_to_hex(commit->object.sha1));\n>  \tif (log->user_format) {\n> -\t\tstruct strbuf buf = STRBUF_INIT;\n>  \t\tstruct pretty_print_context ctx = {0};\n>  \t\tctx.abbrev = DEFAULT_ABBREV;\n>  \t\tctx.subject = \"\";\n>  \t\tctx.after_subject = \"\";\n>  \t\tctx.date_mode = DATE_NORMAL;\n> +\t\tpretty_print_commit(CMIT_FMT_USERFORMAT, commit, &ufbuf, &ctx);\n> +\t\tbuffer = ufbuf.buf;\n> +\n> +\t} else if (*buffer)\n>  \t\tbuffer++;\n> +\n\nYou probably wanted to add an extra pair of {} around this \"else\nif\" clause instead, not the earlier one.\n\nOtherwise the change looks good from my cursory look.\n\n> diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\n> index 405b971..118204b 100755\n> --- a/t/t4201-shortlog.sh\n> +++ b/t/t4201-shortlog.sh\n> @@ -51,5 +51,29 @@ git log HEAD > log\n>  GIT_DIR=non-existing git shortlog -w < log > out\n>  \n>  test_expect_success 'shortlog from non-git directory' 'test_cmp expect out'\n> +iconvfromutf8toiso885915() {\n> +\tprintf \"%s\" \"$@\" | iconv -f UTF-8 -t ISO-8859-15\n> +}\n\nA bad use of \"$@\" that expands to $# individual words; you meant\nto say \"$*\".\n\nCould we please have the following inside its own test, so that\nany failure while preparing the test data is caught as an error?\n\n> +git reset --hard \"$commit\"\n> +git config --unset i18n.commitencoding\n> +echo 2 > a1\n> +git commit --quiet -m \"set a1 to 2 and some non-ASCII chars: Äßø\" --author=\"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\" a1\n> +\n> +git config i18n.commitencoding \"ISO-8859-15\"\n> +echo 3 > a1\n> +git commit --quiet -m \"$(iconvfromutf8toiso885915 \"set a1 to 3 and some non-ASCII chars: áæï\")\" --author=\"$(iconvfromutf8toiso885915 \"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\")\" a1\n> +git config --unset i18n.commitencoding\n> +\n> +git shortlog HEAD~2.. > out\n> +\n> +cat > expect << EOF\n> +Jöhännës \"Dschö\" Schindëlin (2):\n> +      set a1 to 2 and some non-ASCII chars: Äßø\n> +      set a1 to 3 and some non-ASCII chars: áæï\n> +\n> +EOF\n> +\n> +test_expect_success 'shortlog encoding' 'test_cmp expect out'\n\nt3900-i18n-commit already uses 8859-1 so if it is not too much to\nask, it would be much nicer to have these test work between UTF-8\nand 8859-1, not -15.\n\nThat way, I do not have to worry about breaking tests for people\nwho were able to run existing iconv tests because they do not have\nworking 8859-15.\n\nThanks\n"},{"id":"128312","messageId":"20091125140052.GA5565@pengutronix.de","threadId":"21583","inReplyTo":"7vfx8376hd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] shortlog: respect commit encoding","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-11-25T14:00:52Z","receivedAt":"2009-11-25T14:00:52Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello Junio,\n\nOn Tue, Nov 24, 2009 at 05:12:14PM -0800, Junio C Hamano wrote:\n> Uwe Kleine-König  <u.kleine-koenig@pengutronix.de> writes:\n> \n> > Before this change the author was taken from the raw commit without\n> > reencoding.\n> \n> I see people often begin with \"before this change\" and stop the log\n> message after making a statement of a fact.  I mildly dislike this style,\n> especially when the resulting message does not state that it is bad (and\n> if necessary why it is bad) nor state in what way the code after the\n> change is good.\n> \n> \tDon't take the author name information without re-encoding\n>         from the raw commit object buffer.\n> \n> is easier to read, at least for me.\nYes, that's better.  Thanks.\n \n> >  \twhile (*buffer && *buffer != '\\n') {\n> >  \t\tconst char *eol = strchr(buffer, '\\n');\n> >  \n> > -\t\tif (eol == NULL)\n> > +\t\tif (eol == NULL) {\n> >  \t\t\teol = buffer + strlen(buffer);\n> > -\t\telse\n> > +\t\t} else\n> >  \t\t\teol++;\n> >  \t\tif (!prefixcmp(buffer, \"author \"))\n> \n> What is this hunk for?\nThis is just a left-over from debugging.  Removed.\n \n> > @@ -157,20 +162,20 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n> >  \t\tdie(\"Missing author: %s\",\n> >  \t\t    sha1_to_hex(commit->object.sha1));\n> >  \tif (log->user_format) {\n> > -\t\tstruct strbuf buf = STRBUF_INIT;\n> >  \t\tstruct pretty_print_context ctx = {0};\n> >  \t\tctx.abbrev = DEFAULT_ABBREV;\n> >  \t\tctx.subject = \"\";\n> >  \t\tctx.after_subject = \"\";\n> >  \t\tctx.date_mode = DATE_NORMAL;\n> > +\t\tpretty_print_commit(CMIT_FMT_USERFORMAT, commit, &ufbuf, &ctx);\n> > +\t\tbuffer = ufbuf.buf;\n> > +\n> > +\t} else if (*buffer)\n> >  \t\tbuffer++;\n> > +\n> \n> You probably wanted to add an extra pair of {} around this \"else\n> if\" clause instead, not the earlier one.\nI removed the new line (the last changed line you quoted) instead.\nGood?\n \n> > diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\n> > index 405b971..118204b 100755\n> > --- a/t/t4201-shortlog.sh\n> > +++ b/t/t4201-shortlog.sh\n> > @@ -51,5 +51,29 @@ git log HEAD > log\n> >  GIT_DIR=non-existing git shortlog -w < log > out\n> >  \n> >  test_expect_success 'shortlog from non-git directory' 'test_cmp expect out'\n> > +iconvfromutf8toiso885915() {\n> > +\tprintf \"%s\" \"$@\" | iconv -f UTF-8 -t ISO-8859-15\n> > +}\n> \n> A bad use of \"$@\" that expands to $# individual words; you meant\n> to say \"$*\".\nOK.\n \n> Could we please have the following inside its own test, so that\n> any failure while preparing the test data is caught as an error?\nI put it in the test itself.  Isn't it ugly to have a test saying\nsomething like\n\t\n*   ok 3: prepare shortlog encoding test\n\n?  Or is it better to see where a failure occurs?\n\n> > +git reset --hard \"$commit\"\n> > +git config --unset i18n.commitencoding\n> > +echo 2 > a1\n> > +git commit --quiet -m \"set a1 to 2 and some non-ASCII chars: Äßø\" --author=\"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\" a1\n> > +\n> > +git config i18n.commitencoding \"ISO-8859-15\"\n> > +echo 3 > a1\n> > +git commit --quiet -m \"$(iconvfromutf8toiso885915 \"set a1 to 3 and some non-ASCII chars: áæï\")\" --author=\"$(iconvfromutf8toiso885915 \"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\")\" a1\n> > +git config --unset i18n.commitencoding\n> > +\n> > +git shortlog HEAD~2.. > out\n> > +\n> > +cat > expect << EOF\n> > +Jöhännës \"Dschö\" Schindëlin (2):\n> > +      set a1 to 2 and some non-ASCII chars: Äßø\n> > +      set a1 to 3 and some non-ASCII chars: áæï\n> > +\n> > +EOF\n> > +\n> > +test_expect_success 'shortlog encoding' 'test_cmp expect out'\n> \n> t3900-i18n-commit already uses 8859-1 so if it is not too much to\n> ask, it would be much nicer to have these test work between UTF-8\n> and 8859-1, not -15.\n> \n> That way, I do not have to worry about breaking tests for people\n> who were able to run existing iconv tests because they do not have\n> working 8859-15.\nOK.\n\nBelow is the updated patch.\n\nBest regards\nUwe\n\n------------------>8----------------------\nFrom: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\nSubject: [PATCH] shortlog: respect commit encoding\n\nDon't take the author name information without re-encoding from the raw\ncommit object buffer.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\nCc: Jiri Kosina <jkosina@suse.cz>\n---\n builtin-shortlog.c  |   20 ++++++++++++--------\n t/t4201-shortlog.sh |   23 +++++++++++++++++++++++\n 2 files changed, 35 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex 8aa63c7..263adc1 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -139,8 +139,13 @@ static void read_from_stdin(struct shortlog *log)\n void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n {\n \tconst char *author = NULL, *buffer;\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tstruct strbuf ufbuf = STRBUF_INIT;\n+\tstruct pretty_print_context ctx = {0};\n \n-\tbuffer = commit->buffer;\n+\tpretty_print_commit(CMIT_FMT_RAW, commit, &buf, &ctx);\n+\n+\tbuffer = buf.buf;\n \twhile (*buffer && *buffer != '\\n') {\n \t\tconst char *eol = strchr(buffer, '\\n');\n \n@@ -157,20 +162,19 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)\n \t\tdie(\"Missing author: %s\",\n \t\t    sha1_to_hex(commit->object.sha1));\n \tif (log->user_format) {\n-\t\tstruct strbuf buf = STRBUF_INIT;\n \t\tstruct pretty_print_context ctx = {0};\n \t\tctx.abbrev = DEFAULT_ABBREV;\n \t\tctx.subject = \"\";\n \t\tctx.after_subject = \"\";\n \t\tctx.date_mode = DATE_NORMAL;\n-\t\tpretty_print_commit(CMIT_FMT_USERFORMAT, commit, &buf, &ctx);\n-\t\tinsert_one_record(log, author, buf.buf);\n-\t\tstrbuf_release(&buf);\n-\t\treturn;\n-\t}\n-\tif (*buffer)\n+\t\tpretty_print_commit(CMIT_FMT_USERFORMAT, commit, &ufbuf, &ctx);\n+\t\tbuffer = ufbuf.buf;\n+\n+\t} else if (*buffer)\n \t\tbuffer++;\n \tinsert_one_record(log, author, !*buffer ? \"<none>\" : buffer);\n+\tstrbuf_release(&ufbuf);\n+\tstrbuf_release(&buf);\n }\n \n static void get_from_rev(struct rev_info *rev, struct shortlog *log)\ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex 405b971..03b6950 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -52,4 +52,27 @@ GIT_DIR=non-existing git shortlog -w < log > out\n \n test_expect_success 'shortlog from non-git directory' 'test_cmp expect out'\n \n+iconvfromutf8toiso88591() {\n+\tprintf \"%s\" \"$*\" | iconv -f UTF-8 -t ISO-8859-1\n+}\n+\n+cat > expect << EOF\n+Jöhännës \"Dschö\" Schindëlin (2):\n+      set a1 to 2 and some non-ASCII chars: Äßø\n+      set a1 to 3 and some non-ASCII chars: áæï\n+\n+EOF\n+\n+test_expect_success 'shortlog encoding' '\n+git reset --hard \"$commit\" &&\n+git config --unset i18n.commitencoding &&\n+echo 2 > a1 &&\n+git commit --quiet -m \"set a1 to 2 and some non-ASCII chars: Äßø\" --author=\"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\" a1 &&\n+git config i18n.commitencoding \"ISO-8859-1\" &&\n+echo 3 > a1 &&\n+git commit --quiet -m \"$(iconvfromutf8toiso88591 \"set a1 to 3 and some non-ASCII chars: áæï\")\" --author=\"$(iconvfromutf8toiso88591 \"Jöhännës \\\"Dschö\\\" Schindëlin <Johannes.Schindelin@gmx.de>\")\" a1 &&\n+git config --unset i18n.commitencoding &&\n+git shortlog HEAD~2.. > out &&\n+test_cmp expect out'\n+\n test_done\n-- \n1.6.5.3\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"}]}