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

Re: [PATCH v1] travis-ci: build documentation

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 25, 2016, 19:32 UTC
Message-ID
<vpqwpnlpjrf.fsf@anie.imag.fr>
In-Reply-To
<xmqq37q9ldd9.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Lars Schneider <larsxschneider@gmail.com> writes:
>>
>>>> There also are existing instances of "useless ;" that would want to
>>>> be cleaned up regardless of portability issues.
>>> Unfortunately it seems to be required. Travis CI generates a shell script
>>> out of the yml file and I think they don't respect newlines or something...
>>
>> If they squash all the lines into a single long line before
>> executing, these semicolons do indeed become necessary (we have to
>> write a logical single line shell script in our Makefiles with ';',
>> and I'd imagine Travis's scriptlets are done similarly).
Actually, it's not Travis, but just the Yaml syntax:
  http://docs.ansible.com/ansible/YAMLSyntax.html
  
  Values can span multiple lines using | or >. Spanning multiple lines
  using a | will include the newlines. Using a > will ignore newlines;
  it’s used to make what would otherwise be a very long line easier to
  read and edit
So, a simpler solution would be to apply something like this:
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,7 +33,7 @@ env:
     - GIT_SKIP_TESTS="t9810 t9816"
 
 before_install:
-  - >
+  - |
     case "${TRAVIS_OS_NAME:-linux}" in
     linux)
       mkdir --parents custom/p4
@@ -81,7 +81,7 @@ before_script: make --jobs=2
 script: make --quiet test
 
 after_failure:
-  - >
+  - |
     : '<-- Click here to see detailed test output!                                          
            ';                                                                              
     for TEST_EXIT in t/test-results/*.exit;
     do

(untested)

Actually, this may also be a motivation to move anything non-trivial out
of .travic.yml and to start using separate scripts (to avoid writting
shell within a Yaml syntax).

> ... but the above does not quite explain it.  The newlines are
> mostly honoured as logical end-of-line in existing .travis.yml e.g.
> we do not see a semicolon before "pushd".
>
>             case "${TRAVIS_OS_NAME:-linux}" in
>             linux)
>               mkdir --parents custom/p4
>               pushd custom/p4

I'm tempted to think that these lines create directories pushd/ and
custom/p4/, but that doesn't quite explain it either. There's more magic
somewhere ...

> Puzzled...

Likewise.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 16 in “travis-ci: build documentation”
  1. travis-ci: build documentationlarsxschneider@gmail.com, Apr 22, 2016
  2. Matthieu MoyApr 22, 2016
  3. Junio C HamanoApr 22, 2016
  4. Lars SchneiderApr 25, 2016
  5. Junio C HamanoApr 25, 2016
  6. Junio C HamanoApr 25, 2016
  7. Matthieu MoyApr 25, 2016
  8. Junio C HamanoApr 25, 2016
  9. Matthieu MoyApr 25, 2016
  10. Lars SchneiderApr 25, 2016
  11. Matthieu MoyApr 25, 2016
  12. stefan.naewe@atlas-elektronik.comApr 22, 2016
  13. Lars SchneiderApr 25, 2016
  14. Jeff KingApr 23, 2016
  15. Lars SchneiderApr 25, 2016
  16. Jeff KingApr 25, 2016

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.