[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: commit-msg hook

From: Eli Zaretskii
Subject: Re: commit-msg hook
Date: Sat, 11 Apr 2015 10:24:05 +0300

> Date: Fri, 10 Apr 2015 19:42:53 -0700
> From: Paul Eggert <address@hidden>
> CC: address@hidden, Johan Bockgård
>  <address@hidden>
> Eli Zaretskii wrote:
> > On MS-Windows, this hook fails commits with valid UTF-8 characters in
> > the log messages, probably because the version of Gawk I have here is
> > too old (3.0.4; that's what MSYS comes with).
> Ouch.  That's old.  Why is MSYS still using a circa-1999 gawk?  Can we talk 
> the 
> MSYS folks into having something more up-to-date?

Actually, I see now that this old Gawk comes with the Windows port of
Git (which includes part of [an older] MSYS).  The official MSYS
distribution, by contrast, comes with Gawk 3.1.7, which is 10 years
older (2009), but it still doesn't support [[:print:]].  When was that

Hmm...  I now tried a native Windows Gawk, and there even Gawk 3.1.4,
the oldest one I still have, works with [[:print:]].  So I think the
problem is not with [[:print:]] support per se, but instead with UTF-8
multibyte characters in the MSYS build of Gawk (the Windows port of
Git also uses MSYS Gawk, just from an older MSYS, it seems).  I think
MSYS only supports non-ASCII characters encoded in codepage 1252.

> It's better to check for features rather than versions.  I got a copy of Gawk 
> 3.0.4 out of mothballs and hacked for a while until I got something that 
> worked 
> for me.

Thanks, this would be even better.

However, the new hook hangs on Windows, in this line:

  print_at_sign='{print substr("'$cent_sign'@", 2)}'

It hangs with both MSYS and native Gawk, including the native build of
the latest Gawk 4.1.1c.

I don't think that UTF-8 will work reliabloy in MS-Windows Gawk,
certainly not with Gawk that comes with msysGit.

So it sounds like on MS-Windows we are stuck with the "approximate"
method of detecting non-printable characters.  One way of detecting
MS-Windows from a shell script is to see whether the environment
variable MSYSTEM is defined.

> > Btw, when the hook is run by Git, the "; see 'CONTRIBUTE'" part of the
> > message is not shown; could it be that the semi-colon gets interpreted
> > by the shell, or something like that?  (My Git version is 1.9.5.)
> Most likely you've got an obsolete hook.  Please try "git pull" followed by 
> "./autogen.sh".

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]