]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: don't reset PATH in the commit-msg git hook
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 15 Feb 2013 13:39:39 +0000 (14:39 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 18 Feb 2013 01:27:47 +0000 (01:27 +0000)
I have a custom 'editor' script in ~/bin, and a system-provided
'editor' program in /usr/bin (on Debian, this is a link set up the
"debian alternatives" subsystem).  My '$EDITOR' and '$GIT_EDITOR'
variables are set simply to 'editor' (no absolute path), which I
expect should point to my 'editor' script, since ~/bin precedes
/usr/bin in my PATH definition.  But the 'commit-msg' hook used in
coreutils unconditionally resets its PATH to '/bin:/usr/bin', which
causes it to call the "wrong" editor (the one in /usr/bin, not the
one in ~/bin) when it makes me update a botched commit message.

* scripts/git-hooks: Don't reset $ENV{PATH} to '/bin:/usr/bin',
which was only done to avoid failure when enabling Perl's taint
checking.

scripts/git-hooks/commit-msg

index 3e91e8ea410d239b73bcee703f05798ca8f5936a..7a11489493646d46cfb336285f7766971fad6276 100755 (executable)
@@ -7,7 +7,6 @@ use warnings;
 (my $ME = $0) =~ s|.*/||;
 
 my $editor = $ENV{EDITOR} || 'vi';
-$ENV{PATH} = '/bin:/usr/bin';
 
 # Keywords allowed before the colon on the first line of a commit message:
 # program names and a few general category names.