rstudio-education / stat545

A :book: on data wrangling, exploration, & analysis with R - created by Jenny Bryan, made with bookdown
https://stat545.com
Other
150 stars 90 forks source link

Reconsider DEPLOY_MSG #53

Open jennybc opened 5 years ago

jennybc commented 5 years ago

My approach to making the DEPLOY_MSG in .travis.yml is not robust to quotes inside the commit message.

https://github.com/rstudio-education/stat545/blob/master/.travis.yml#L19

If the truncation to first n characters happens to catch, say, an opening " but not the closing, it can cause problems:

Happened with 46a81ad1e0de845883a52cc0a63df168b34e1186

Notice the cryptic error in the deploy stage:

https://travis-ci.org/rstudio-education/stat545/builds/589671690#L900-L903

Deploying application
sh: 1: Syntax error: Unterminated quoted string
Script failed with status 2

Caused by unfortunate truncating of this commit message:

Link to the ellipsis package and "Data, dots, details"
jennybc commented 5 years ago

Suggestion from @jimhester: Try git log --pretty='%h %s' HEAD | cut -c-60. If you never use bash string interpolation you don't need to worry about quoting.