git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 16, 2009, 19:12 UTC
Message-ID
<7vvdo0n9p0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<87y6sx1h6p.fsf@meyering.net>
Jim Meyering <jim@meyering.net> 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.

Previous: Jim Meyering
Message 2 of 2 in “pre-commit.sample: don't print incidental SHA1”
  1. pre-commit.sample: don't print incidental SHA1Jim Meyering, May 16, 2009
  2. Junio C HamanoMay 16, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.