You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This also affects 'git bash' which is just Cygwin with a different name.
When using gitlint on Cygwin, it will hang when trying to determine whether there is data being passed via stdin.
# This hangs
gitlint
# Note that Other commands do work, like:
gitlint --version
gitlint generate-config
gitlint install-hook
The issue here is with how Cygwin emulates a shell in windows. In particular, in the testing I've done, stdin is always a named pipe during gitlint invocation.
The issue with this is that once gitlint thinks that stdin is a pipe, it will then attempt and fail to read the stdin(), indefinitely waiting (i.e. gitlint hangs).
# Only return the input data if there's actually something passed
# i.e. don't consider empty piped data
ifinput_data:
returnustr(input_data)
returnFalse
The only way to work around this right now is actually pass data to stdin, like so:
git log -1 --pretty="%B"| gitlint
I did a bit of research into this and identified a few potential workarounds that need more investigation:
Detect CYGWIN environment and print a warning message. The only way to reliably detect cygwin seems to try to read the output of the uname command. Python's platform module will NOT consistently report correctly on Cygwin (if python was installed system-wide outside of Cygwin, platform will report Windows and not Cygwin).
Still find a different way to detect that data is not being piped into gitlint, or somehow fix what stat.S_ISFIFO returns by finding/making an environment change in Cygwin.
Previously, gitlint would still read from stdin and log whatever was passed,
even when the `--ignore-stin` flag was specified. This is problematic for
situations where stdin is blocking and the user is trying to have gitlint ignore
stdin all-together.
This should provide a workaround for #91
This also affects 'git bash' which is just Cygwin with a different name.
When using gitlint on Cygwin, it will hang when trying to determine whether there is data being passed via stdin.
The issue here is with how Cygwin emulates a shell in windows. In particular, in the testing I've done,
stdin
is always a named pipe during gitlint invocation.The issue with this is that once gitlint thinks that stdin is a pipe, it will then attempt and fail to read the stdin(), indefinitely waiting (i.e. gitlint hangs).
The relevant code is here:
gitlint/gitlint/cli.py
Lines 100 to 129 in e95fe61
The only way to work around this right now is actually pass data to stdin, like so:
I did a bit of research into this and identified a few potential workarounds that need more investigation:
uname
command. Python'splatform
module will NOT consistently report correctly on Cygwin (if python was installed system-wide outside of Cygwin,platform
will reportWindows
and notCygwin
).stat.S_ISFIFO
returns by finding/making an environment change in Cygwin.Some additional pointers that might be relevant:
The text was updated successfully, but these errors were encountered: