{"thread":{"id":"24581","subject":"pre-commit hook and Aspell","startedAt":"2010-07-30T08:51:28Z","lastAt":"2010-07-30T18:21:16Z","messageCount":3,"participants":["Stefan Bienert","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"146768","messageId":"4C529290.7040509@zbh.uni-hamburg.de","threadId":"24581","inReplyTo":null,"subject":"pre-commit hook and Aspell","fromName":"Stefan Bienert","fromEmail":"bienert@zbh.uni-hamburg.de","sentAt":"2010-07-30T08:51:28Z","receivedAt":"2010-07-30T08:51:28Z","isPatch":false,"sender":{"key":"bienert@zbh.uni-hamburg.de","avatar":null},"body":"Hi gits,\n\nas instructed by the wiki, I just sent an request to the list without\nbeing subscribed...\n\nI'm trying to setup a hook for my project which forces me to check the\nspelling of text (here: TeX) files, whenever they change. As\nspellchecker I use Aspell, which is giving me a headache at the moment.\nThe problem is: Running the pre-commit script in the shell works,\nstarted as hook does not.\n\nHere is my script (cut down to a minimalist version resembling the problem):\n\n# SNIP\n#!/bin/sh\n\nfor my_p in $(git status --porcelain | awk '{ if ($0 ~ /\\.(tex|sty)$/) {\nprint $2 } }')\ndo\n    aspell -c -l en_GB -p $(pwd)/${my_cdup}share/dict/aspell.corb.pws\n$my_p || exit 1\ndone\n# SNAP\n\nregards,\n\nStefan\n\n-- \nStefan Bienert\nZentrum fuer Bioinformatik\nUniversitaet Hamburg\nBundesstrasse 43\n20146 Hamburg\nGermany\n\nEmail: bienert@zbh.uni-hamburg.de\nPhone:  +49 (40) 42838 7345\nFax:    +49 (40) 42838 7332\n"},{"id":"146784","messageId":"7vd3u5rme0.fsf@alter.siamese.dyndns.org","threadId":"24581","inReplyTo":"4C529290.7040509@zbh.uni-hamburg.de","subject":"Re: pre-commit hook and Aspell","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-30T15:59:35Z","receivedAt":"2010-07-30T15:59:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Bienert <bienert@zbh.uni-hamburg.de> writes:\n\n> Here is my script (cut down to a minimalist version resembling the problem):\n>\n> # SNIP\n> #!/bin/sh\n>\n> for my_p in $(git status --porcelain | awk '{ if ($0 ~ /\\.(tex|sty)$/) {\n> print $2 } }')\n\nA tangent; perhaps \"git status --porcelain '*.tex' '*.sty'\" would help you\nlose the pipe and awk.\n\n> do\n>     aspell -c -l en_GB -p $(pwd)/${my_cdup}share/dict/aspell.corb.pws\n> $my_p || exit 1\n\nNot quite sure what my-cdup is here, but probably you would want to have\nsomething like this at the top of the script?\n\n\t#!/bin/sh\n\t\"cd ..\"\n"},{"id":"146788","messageId":"20100730182116.GA18544@coredump.intra.peff.net","threadId":"24581","inReplyTo":"4C529290.7040509@zbh.uni-hamburg.de","subject":"Re: pre-commit hook and Aspell","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-07-30T18:21:16Z","receivedAt":"2010-07-30T18:21:16Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 30, 2010 at 10:51:28AM +0200, Stefan Bienert wrote:\n\n> I'm trying to setup a hook for my project which forces me to check the\n> spelling of text (here: TeX) files, whenever they change. As\n> spellchecker I use Aspell, which is giving me a headache at the moment.\n> The problem is: Running the pre-commit script in the shell works,\n> started as hook does not.\n\nHooks run without stdio connected to the tty. Have you tried doing\n\"aspell </dev/tty >/dev/tty\" in your hook?\n\n-Peff\n"}]}