From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: commit-msg hook Date: Sat, 11 Apr 2015 13:09:12 -0700 Organization: UCLA Computer Science Department Message-ID: <55297F68.4080103@cs.ucla.edu> References: <83y4m0tgac.fsf@gnu.org> <55288A2D.5030809@cs.ucla.edu> <83d23bruui.fsf@gnu.org> <83a8yff0pl.fsf@gnu.org> <5529406D.4040304@cs.ucla.edu> <83sic6ehzc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040107060901040805090405" X-Trace: ger.gmane.org 1428782982 17526 80.91.229.3 (11 Apr 2015 20:09:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Apr 2015 20:09:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 11 22:09:35 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Yh1ig-00035h-7Y for ged-emacs-devel@m.gmane.org; Sat, 11 Apr 2015 22:09:34 +0200 Original-Received: from localhost ([::1]:43722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yh1if-0004s1-3z for ged-emacs-devel@m.gmane.org; Sat, 11 Apr 2015 16:09:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yh1iS-0004oZ-Oz for emacs-devel@gnu.org; Sat, 11 Apr 2015 16:09:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yh1iR-0001WR-M4 for emacs-devel@gnu.org; Sat, 11 Apr 2015 16:09:20 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:46008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yh1iN-0001RQ-Un; Sat, 11 Apr 2015 16:09:16 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id F19BFA60018; Sat, 11 Apr 2015 13:09:14 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uWrOgXNSFMme; Sat, 11 Apr 2015 13:09:13 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id A56E6A60013; Sat, 11 Apr 2015 13:09:13 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <83sic6ehzc.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185300 Archived-At: This is a multi-part message in MIME format. --------------040107060901040805090405 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Eli Zaretskii wrote: > That hangs as well, and I found out why: Gawk waits for input. Ah, that could be due to an incompatibility with the MSYS shell; but the BEGIN can't hurt, and I installed the attached patch to redirect from stdin as well. Since this appears to be the real problem, I'd rather go back to the all-ASCII script, for portability to pre-POSIX shells (probably doesn't matter nowadays, but shouldn't hurt). --------------040107060901040805090405 Content-Type: text/x-patch; name="0001-Port-commit-msg-to-MSYS-Bash-Gawk.patch" Content-Disposition: attachment; filename="0001-Port-commit-msg-to-MSYS-Bash-Gawk.patch" Content-Transfer-Encoding: quoted-printable >From ad3a0eac324a7163ab0e345e60f741e2d55087b9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 11 Apr 2015 13:04:37 -0700 Subject: [PATCH] Port commit-msg to MSYS Bash+Gawk See Eli Zaretskii in: http://lists.gnu.org/archive/html/emacs-devel/2015-04/msg00610.html * build-aux/git-hooks/commit-msg (cent_sign_utf8_format) (cent_sign, print_at_sign, at_sign): Revert previous change. (print_at_sign): Prepend "BEGIN". (at_sign): Redirect from /dev/null to be safer with pre-POSIX awk. --- build-aux/git-hooks/commit-msg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-= msg index 3fc6e19..6e31dbc 100755 --- a/build-aux/git-hooks/commit-msg +++ b/build-aux/git-hooks/commit-msg @@ -29,11 +29,12 @@ fi =20 # Use a UTF-8 locale if available, so that the UTF-8 check works. # Use U+00A2 CENT SIGN to test whether the locale works. -cent_sign=3D'=C2=A2' -print_at_sign=3D'{print substr("'$cent_sign'@", 2)}' -at_sign=3D`$awk "$print_at_sign" 2>/dev/null` +cent_sign_utf8_format=3D'\302\242\n' +cent_sign=3D`printf "$cent_sign_utf8_format"` +print_at_sign=3D'BEGIN {print substr("'$cent_sign'@", 2)}' +at_sign=3D`$awk "$print_at_sign" /dev/null` if test "$at_sign" !=3D @; then - at_sign=3D`LC_ALL=3Den_US.UTF-8 $awk "$print_at_sign" 2>/dev/null` + at_sign=3D`LC_ALL=3Den_US.UTF-8 $awk "$print_at_sign" /de= v/null` if test "$at_sign" =3D @; then LC_ALL=3Den_US.UTF-8; export LC_ALL fi --=20 2.1.0 --------------040107060901040805090405--