1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 17:36:08 +02:00
git/templates
Alex Vandiver 2a387b17c5 fsmonitor: read entirety of watchman output
In Perl, setting $/ sets the string that is used as the "record
separator," which sets the boundary that the `<>` construct reads to.
Setting `local $/ = 0666;` evaluates the octal, getting 438, and
stringifies it.  Thus, the later read from `<CHLD_OUT>` stops as soon
as it encounters the string "438" in the watchman output, yielding
invalid JSON; repositories containing filenames with SHA1 hashes are
able to trip this easily.

Set `$/` to undefined, thus slurping all output from watchman.  Also
close STDIN which is provided to watchman, to better guarantee that we
cannot deadlock with watchman while both attempting to read.

Signed-off-by: Alex Vandiver <alexmv@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-04 18:58:53 +09:00
..
.gitignore
Makefile Make templates honour SHELL_PATH and PERL_PATH 2010-03-20 09:03:52 -07:00
branches-- Revert "Don't create the $GIT_DIR/branches directory on init" 2009-10-31 11:16:50 -07:00
hooks--applypatch-msg.sample *.sh: avoid hardcoding $GIT_DIR/hooks/... 2014-12-01 11:00:13 -08:00
hooks--commit-msg.sample Modernize git calling conventions in hook templates 2010-03-20 09:04:38 -07:00
hooks--fsmonitor-watchman.sample fsmonitor: read entirety of watchman output 2017-10-04 18:58:53 +09:00
hooks--post-update.sample Modernize git calling conventions in hook templates 2010-03-20 09:04:38 -07:00
hooks--pre-applypatch.sample *.sh: avoid hardcoding $GIT_DIR/hooks/... 2014-12-01 11:00:13 -08:00
hooks--pre-commit.sample sample pre-commit hook: use --bool when retrieving config var 2013-09-24 12:26:49 -07:00
hooks--pre-push.sample pre-push.sample: remove unnecessary and misleading IFS=' ' 2014-12-22 10:27:42 -08:00
hooks--pre-rebase.sample treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
hooks--pre-receive.sample pre-receive.sample: mark it executable 2016-10-28 14:21:11 -07:00
hooks--prepare-commit-msg.sample hook: use correct logical variable 2017-08-14 11:19:50 -07:00
hooks--update.sample templates/hooks: fix minor typo in the sample update-hook 2016-02-25 09:32:20 -08:00
info--exclude Modernize git calling conventions in hook templates 2010-03-20 09:04:38 -07:00
this--description