Re: [PATCH v2 6/7] tests: Add tests for automatic use of pager
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Feb 22, 2010, 08:19 UTC
- Message-ID
- <4B823E21.1060707@viscovery.net>
- In-Reply-To
- <20100221020317.GA7651@progeny.tock>
Don't the following pager settings suffer from a race condition?
> + cat > $less <<-EOF && > + #!$SHELL_PATH > + : > default_pager_used > + EOF
> + PAGER=": > PAGER_used" &&
> + PAGER=: &&
> + git config core.pager ": > core.pager_used" &&
> + git config core.pager : && > + GIT_PAGER=": > GIT_PAGER_used" &&
They depend on that the subsequent 'git log' writes to the pipe (and does not fill it) before the pager can run. If the pager runs first and completes, and then 'git log' writes to the pipe, it will die from SIGPIPE, won't it?
I suggest to rewrite all ':' to something that processes stdin, eg. 'wc' (not 'cat', because this is a magic token).
-- Hannes