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 08:40:29 -0700 Organization: UCLA Computer Science Department Message-ID: <5529406D.4040304@cs.ucla.edu> References: <83y4m0tgac.fsf@gnu.org> <55288A2D.5030809@cs.ucla.edu> <83d23bruui.fsf@gnu.org> <83a8yff0pl.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000305050400090703090700" X-Trace: ger.gmane.org 1428766883 1455 80.91.229.3 (11 Apr 2015 15:41:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Apr 2015 15:41:23 +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 17:41:13 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 1YgxWy-0003LA-2g for ged-emacs-devel@m.gmane.org; Sat, 11 Apr 2015 17:41:12 +0200 Original-Received: from localhost ([::1]:43041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgxWx-0006NM-Cv for ged-emacs-devel@m.gmane.org; Sat, 11 Apr 2015 11:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgxWa-0006NE-F0 for emacs-devel@gnu.org; Sat, 11 Apr 2015 11:40:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgxWZ-00056a-3c for emacs-devel@gnu.org; Sat, 11 Apr 2015 11:40:48 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:38031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgxWV-0004wb-7B; Sat, 11 Apr 2015 11:40:43 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1B264A60015; Sat, 11 Apr 2015 08:40:42 -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 f72y+NQkFmoA; Sat, 11 Apr 2015 08:40:41 -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 2D48CA60013; Sat, 11 Apr 2015 08:40:41 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <83a8yff0pl.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:185294 Archived-At: This is a multi-part message in MIME format. --------------000305050400090703090700 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Eli Zaretskii wrote: > the problem with hanging is not due > to Gawk, but instead due to 'printf': it doesn't produce the UTF-8 > encoding of the percent sign OK, so we're dealing with a broken MS-Windows shell rather than a broken MS-Windows gawk. That 'printf' command is there only so that the script can be pure ASCII, and it's simpler to avoid that nicety. I installed the attached patch to try to work around the shell bug. As regards the idea of using Emacs rather than the shell, I'm with Dmitry: let's not assume Emacs is already working when bootstrapping a new Emacs. Instead, let's merely assume that a new developer has a working shell, since that's needed anyway for other reasons. > Is it possible to install the hooks in GNUMakefile, so that running > autogen.sh manually wouldn't be needed? I normally almost never run > autogen.sh, I always just run "make" from the top-level directory. I'm leery of that. GNUMakefile is run by everybody, not just by developers. And there are good reasons that the Git hooks are not themselves in the Git repository (if they were in the repository, and they were sufficiently messed up, then one couldn't 'git commit' fixes). If we routinely updated the Git hooks automatically, we'd make it more likely that Git non-experts would put their painfully constructed repositories into a "broken" state, and we already have too much panic in that neighborhood. That being said, it might make sense to separate the Git hook (re)initialization into an autogen.sh option, since it's cheap whereas autogen.sh by default is expensive. --------------000305050400090703090700 Content-Type: text/x-patch; name="0001-Port-commit-msg-to-broken-MS-Windows-shell.patch" Content-Disposition: attachment; filename="0001-Port-commit-msg-to-broken-MS-Windows-shell.patch" Content-Transfer-Encoding: quoted-printable >From 2cc9a32d361492f28faeced22e3800eb1a59c252 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 11 Apr 2015 08:19:13 -0700 Subject: [PATCH] Port commit-msg to broken MS-Windows shell * build-aux/git-hooks/commit-msg (cent_sign): Just use UTF-8 here rather than ASCII + printf, as the latter fails on a broken MS-Windows shell. Reported by Eli Zaretskii in: http://lists.gnu.org/archive/html/emacs-devel/2015-04/msg00592.html --- build-aux/git-hooks/commit-msg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-= msg index ea8d909..3fc6e19 100755 --- a/build-aux/git-hooks/commit-msg +++ b/build-aux/git-hooks/commit-msg @@ -29,8 +29,7 @@ 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_utf8_format=3D'\302\242\n' -cent_sign=3D`printf "$cent_sign_utf8_format"` +cent_sign=3D'=C2=A2' print_at_sign=3D'{print substr("'$cent_sign'@", 2)}' at_sign=3D`$awk "$print_at_sign" 2>/dev/null` if test "$at_sign" !=3D @; then @@ -45,7 +44,7 @@ exec $awk -v at_sign=3D"$at_sign" -v cent_sign=3D"$cent= _sign" ' BEGIN { # These regular expressions assume traditional Unix unibyte behavior= . # They are needed for old or broken versions of awk, e.g., - # mawk 1.3.3 (1996), Gawk 3.0.4 (1999). + # mawk 1.3.3 (1996), or gawk on MSYS (2015). space =3D "[ \f\n\r\t\v]" non_space =3D "[^ \f\n\r\t\v]" non_print =3D "[\1-\37\177]" --=20 2.1.0 --------------000305050400090703090700--