Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] pre-commit.sample: don't print incidental SHA1

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:47

Jim Meyering [off-list ref] writes:
I enabled the sample pre-commit hook and was surprised to
see new output with every commit.  It was due to that script's
use of git-rev-parse.
Thanks.  I am half surprised that nobody has complained about this,
because the problem has been there since early 2006, and am half
unsurprised because I have long suspected that nobody would be using
pre-commit hook in real life.
Also, I noticed the use of "git-hyphen" git-rev-parse.
Perhaps that hyphen has been left in deliberately,
for portability to very old versions of git?
Sample hooks do use features available only in the version of git that
ships them; we do not strive to retain such a portability in that sense.

The hook scripts are special in that they are invoked in an environment in
which the git subcommands in their dashed form are always available on its
$PATH.  People tend to learn by looking at examples, so it is a good idea
to change them to use the new, separate subcommand, form to set examples.

But that is obviously a much wider patch, so let's make that a separate
issue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help