From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.5 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 896942055F for ; Sat, 9 Apr 2016 09:15:03 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/3] import: set binmode before printing author names Date: Sat, 9 Apr 2016 09:14:57 +0000 Message-Id: <20160409091457.14741-4-e@80x24.org> In-Reply-To: <20160409091457.14741-1-e@80x24.org> References: <20160409091457.14741-1-e@80x24.org> List-Id: Author names may have wide characters in them, so avoid warnings as git favors UTF-8 for names and fast-import even requires them for commit messages --- lib/PublicInbox/Import.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index e2156f1..4c7bbf1 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -162,11 +162,16 @@ sub add { unless ($parent) { print $w "reset $ref\n" or wfail; } + + # quiet down wide character warnings: + binmode $w, ':utf8' or die "binmode :utf8 failed: $!"; print $w "commit $ref\nmark :$commit\n", "author $name <$email> $date\n", "committer $self->{ident} ", now2822(), "\n", "data ", (length($subject) + 1), "\n", $subject, "\n\n" or wfail; + binmode $w, ':raw' or die "binmode :raw failed: $!"; + if ($tip ne '') { print $w 'from ', ($parent ? $parent : $tip), "\n" or wfail; } -- EW