Re: Commit f5bbc322 to git broke pre-commit hooks which read stdin
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 4, 2008, 11:48 UTC
- Message-ID
- <47CD370A.3070404@viscovery.net>
- In-Reply-To
- <7vk5ki91zj.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 18 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: >> On Tue, 4 Mar 2008, David Bremner wrote: >> >>> It looks like line 435 of builtin-commit.c disables stdin for hooks >>> (with the disclaimer that I first looked at the git source ten minutes >>> ago). >>> >>> hook.no_stdin = 1 >>> >>> I'm not sure if this was by design, but just so you know, this breaks >>> people's hooks. In particular the default metastore pre-commit hook no >>> longer works. I didn't find anything relevant in the docs [1]. >> Pardon my ignorance, but what business has metastore reading stdin? There >> should be nothing coming in, so the change you mentioned should be >> correct, and your hook relies on something it should not rely on. > > It is not metastore. It is an interactive hook that reads from the user > who is sitting on the terminal and invoked the git-commit program.
Are you saying stdin should not be directed to /dev/null, or that an interactive hook is required to do
exec < /dev/tty || { echo 2>&1 "not interactive"; exit 1; }before it reads from stdin?
-- Hannes