Re: GIT+CYGWIN annoying test failure
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:54
SungHyun Nam [off-list ref] writes:
quoted
On Thu, 15 Feb 2007, SungHyun Nam wrote:quoted
check_result () { + [ -r current ] && rm -f current git-ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current && diff -u expected current }
I would have written:
check_result () {
rm -f current &&
git-ls-files --stage | ... &&
diff -u expected current
}
If the above still makes the tests pass for your environment,
that would be good. I am not very happy about the lack of "&&"
after "rm -f current" in your patch.
It seems as if 'current' is sometimes writable and sometimes not,
and when the shell couldn't open it to redirect sed output the
whole test fails for you. That does not sound like a sane,
reliable filesystem at all, and even if you worked around the
problem in that single shell function, we tend to use shell
redirection to create or overwrite files everywhere (both in
tests and in the real Porcelain scripts) so that means git is a
disaster waiting to happen on your system, which is not good.
What I am trying to get at is to find out what is causing the
problem first, before working it around. Then, if we are lucky,
we may be able to add a notice in the INSTALL file that says "It
was reported that Filfre virus scanner makes shell redirect in
Cygwin occasionally fail, and both git itself and its testsuite
may not work as expected --- please do not use it", or something
like that.
"Filfre virus scanner" is totally made up, but I think you get
the point.