From: Kristoffer Haugsbakk Date: Wed, 14 Jan 2026 06:13:43 GMT Subject: Re: [PATCH v2] hook: allow hooks to disable stdout_to_stderr Message-ID: <6746acf0-4538-41fc-8699-5acae6ec936e@app.fastmail.com> In-Reply-To: <20260113234528.1749921-1-adrian.ratiu@collabora.com> On Wed, Jan 14, 2026, at 00:45, Adrian Ratiu wrote: > The last batch of hooks converted to the hook.[ch] API introduced > a regression because pick_next_hook() always sets stdout_to_stderr > for its child processes. > > Pre-push is the only hook API user which requires stdout_to_stderr > to be 0, so it can be argued that pre-push needs fixing, however > this will likely break many pre-push hooks, so it's better to allow > it to be 0, i.e. to match the previous behavior. > > To prevent such regressions in the future, extend the hook tests to > verify hooks write to the expected stdout vs stderr streams and > maintain backward compatibility with the hooks output assumptions. > > The tests are independent of the actual hook implementations: I've > tested they work the same before and after the hook.[ch] conversion > and will continue to work after we eventually introduce parallel > hook execution and config-based hooks. > > Reported-by: Chris Darroch > Suggested-by: brian m. carlson > Signed-off-by: Adrian Ratiu > --- > This is based on the latest master branch. > > Changes in v2: > * Extended hook test coverage to detect future regressions (Junio, Patrick) > * Reworded commit message and added explanatory comment (Junio, Patrick) > * Set ungroup = 1 because grouping overrides stdout_to_stderr (Adrian) >[snip] This fixes the issue reported here: https://lore.kernel.org/git/249f08d1-4457-4a41-8dbe-9725c0c392de@app.fastmail.com/ (Subject: [BUG] push: pre-push hook that waits for stdin is slow) Via: https://lore.kernel.org/git/87ecntqd9f.fsf@gentoo.mail-host-address-is-not-set/