Re: [PATCH 2/2] travis-ci: record and skip successfully built trees
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 28, 2017, 19:01 UTC
- Message-ID
- <xmqqlghmllrq.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAM0VKjmCodQgmTa8bjEc02N99cPjrFdp4rFGF3yQOA-VMer4hw@mail.gmail.com>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 12 quoted lines
> I was aware that things like 'cmd file >file' don't work, because the > shell opens and truncates 'file' before executing the command, so 'cmd' > will open the already empty file, but I didn't know that 'echo "$(cmd > file)" >file' works. Thanks for letting me know. > > However, this is subject to the portability issues of the shell's > 'echo', i.e. try > > echo "$(cat git.c)" >git.c > > with Bash and Dash. Bash produces the exact same contents, but Dash > turns all '\n' in help and error strings to real newline characters.
Besides, that is a bad practice in general if you do not have a guarantee that 'git.c' (or whatever file in question) is small enough not to bust any platform's argv[] length limit.
> ... Still, I think it'd be better > to stick to using a good old temporary file:
Yes.