tarmolov / git-hooks-js

A tool to manage and run project git hooks
167 stars 30 forks source link

Passing stdin to all hooks broke some of them completely #26

Closed Karabur closed 7 years ago

Karabur commented 7 years ago

Change introduced in pull request #21 broke some hooks, like pre-rebase (and I believe others which do not receive data via stdin)

Git sends nothing to those hooks and and they are waiting for 'end' stream event forever.

That makes module unusable

tarmolov commented 7 years ago

I couldn't reproduce it. Could you create a simple example with the issue?

Karabur commented 7 years ago

That happens on any repo, just after installing git-hooks To clear doubts, I've created simple repo for you: https://github.com/Karabur/git-hooks-bug

nothing special, just checkout to rebase branch and do git rebase -i master. It hangs forever.

I believe it has something to do with node/git/os and streams handling solely.

my setup: git version: 2.8.4 (Apple Git-73) (also checked latest 2.10.0) node version: v4.5.0 (also checked on latest 6.6.0) osx version: OS X Sierra 10.12 (16A323) same happened on another mac (can't tell versions).

tarmolov commented 7 years ago

Thx, @Karabur. I see a bug now.

@getsnoopy give a hand?

tarmolov commented 7 years ago

I've reverted changes for a while and published 1.1.6. I'll think about adding some integration tests for catching such bugs.

@Karabur, thank you again. Please update to the new version.

getsnoopy commented 7 years ago

I thought I tested for this, but apparently not. It seems like TTY streams don't fire an end event until you hit Ctrl+D. I'll post a fix.