git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Lars SchneiderNext: SZEDER Gábor
Message 13 of 22 in “Travis CI: skip commits with successfully built and tested trees”
  1. 0/2 Travis CI: skip commits with successfully built and tested treesSZEDER Gábor, Dec 27, 2017
  2. 2/2 travis-ci: record and skip successfully built treesSZEDER Gábor, Dec 27, 2017
  3. Lars SchneiderDec 27, 2017
  4. SZEDER GáborDec 27, 2017
  5. SZEDER GáborDec 27, 2017
  6. Lars SchneiderDec 28, 2017
  7. SZEDER GáborDec 29, 2017
  8. SZEDER GáborDec 29, 2017
  9. Lars SchneiderDec 30, 2017
  10. Lars SchneiderDec 27, 2017
  11. SZEDER GáborDec 28, 2017
  12. Lars SchneiderDec 28, 2017
  13. Junio C HamanoDec 28, 2017
  14. 1/2 travis-ci: don't try to create the cache directory unnecessarilySZEDER Gábor, Dec 27, 2017
  15. Jonathan NiederDec 27, 2017
  16. SZEDER GáborDec 28, 2017
  17. Jonathan NiederDec 28, 2017
  18. 0/3 Travis CI: skip commits with successfully built and tested treesSZEDER Gábor, Dec 31, 2017
  19. 1/3 travis-ci: print the "tip of branch is exactly at tag" message in colorSZEDER Gábor, Dec 31, 2017
  20. 2/3 travis-ci: create the cache directory early in the build processSZEDER Gábor, Dec 31, 2017
  21. 3/3 travis-ci: record and skip successfully built treesSZEDER Gábor, Dec 31, 2017
  22. Lars SchneiderDec 31, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.