Hi,
I have a applypatch-msg hook that implements some policy for
acceptable commit messages and reject non-conformant patches. It also
is able to prompt me to override it's rejection. The prompting only
happens when stdin is a tty (as determined by pythons
sys.stdin.isatty())
For example this would reject the patch and cause am stop
$ cat bad.patch | git am
And this would prompt me to allow the patch and am would proceed if I answer Y
$ git am bad.patch
Patch message invalid apply (Y/N)?
As of git 2.6 this has stopped working and stdin always fails the tty
check. Here's a minimal reproduction
$ cat >.git/hooks/applypatch-msg <<EOF
#!/usr/bin/env python
import sys
if sys.stdin.isatty():
print("TTY")
else:
print("NOT")
EOF
$ chmod +x .git/hooks/applypatch-msg
$ git checkout -b temp origin/master^
$ git format-patch master -1
# With git 2.6
$ git am 0001-Git-2.6.patch
NOT
Applying: Git 2.6
# With git 2.5.3
TTY
Applying: Git 2.6
Thanks,
Chris
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html