git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"David Bremner" <bremner@unb.ca>,
	"Kristian Høgsberg" <krh@redhat.com>,
	"Git Mailing List" <git@vger.kernel.org>,
	469250@bugs.debian.org
Subject: Re: Commit f5bbc322 to git broke pre-commit hooks which read stdin
Date: Tue, 04 Mar 2008 04:17:30 -0800	[thread overview]
Message-ID: <7vbq5u7kf9.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <47CD370A.3070404@viscovery.net> (Johannes Sixt's message of "Tue, 04 Mar 2008 12:48:26 +0100")

Johannes Sixt <j.sixt@viscovery.net> writes:

>> 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?

I am saying that scripted version left the stdin as-is but somehow we
ended up spawning with .no_stdin = 1 in the C-rewrite, which is a change
in established behaviour.  It is often called a regression, unless the
change has a very good reason.  And I tend to think this particular one
falls into the former.

We should audit how the hooks are called from various commands
re-implemented, comparing the environment the scripted version used to
give them, which includes:

 - what directory the hook is run in;
 - what environment variables are exported to it;
 - what temporary files are visible to them for inspection;
 - in what order they are run;
 - which file descriptor is connected to what;

I think we already caught some of the environment and ordering issues in
commit and checkout, but I am far from confident to say that what we have
behave identically to the scripted version.

  reply	other threads:[~2008-03-04 12:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04  8:38 Bug#469250: Commit f5bbc322 to git broke pre-commit hooks which read stdin David Bremner
2008-03-04 10:45 ` Johannes Schindelin
2008-03-04 11:12   ` Junio C Hamano
2008-03-04 11:48     ` Johannes Sixt
2008-03-04 12:17       ` Junio C Hamano [this message]
2008-03-04 11:48     ` David Bremner
2008-03-04 12:04       ` Johannes Schindelin
2008-03-04 18:16         ` Joey Hess
2008-03-04 22:15         ` David Bremner
2008-03-05  5:12           ` Shawn O. Pearce
2008-03-05  5:36             ` Junio C Hamano
2008-03-05  5:46               ` Shawn O. Pearce
2008-03-04 11:51   ` Jakub Narebski
2008-03-04 12:03     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vbq5u7kf9.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=469250@bugs.debian.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=bremner@unb.ca \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=krh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).