$TRAVIS_COMMIT_RANGE does not contain all changed files


Hi, if I commit these two files .travis.yml & samtools/Dockerfile:

$ git diff --name-only

Then within the travis build only the .travis.yml is detected from the $TRAVIS_COMMIT_RANGE

$ CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))
The command "CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))" exited with 0.


I think this is something to do with the $TRAVIS_COMMIT_RANGE variable.
Does anyone know what may be causing this and how to solve it?
Any help would be much appreciated, many thanks in advance.

Here is my full .travis.yml file for reference:

sudo: required
language: python
jdk: openjdk8
services: docker
python: "3.6"
cache: pip
  fast_finish: true

  # get list of changed files
  - CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))
  # save names of any changed folders (docker containers) to file folders.txt
  - for file in $CHANGED_FILES; do
    echo $file;
    dir=$(dirname $file);
    echo $dir;
    [[ "${dir}" != "." ]] && dirname $file >> folders.txt;
  # for all changed folders (docker containers) in folders.txt pull containers
  - "[ ! -f folders.txt ] || while read folder; do
    echo $folder;
    docker pull lifebitai/${folder};
    done <folders.txt"


Please point to the build log, so we can take a look. Thanks.


Hi BanzaiMan,

Unfortunately, the repository & therefore I guess the build log is private. Do you have any idea what might be causing the issue?


Without access to the code, it is very hard to understand the problem, I’m afraid. There are a few open issues with $TRAVIS_COMMIT_RANGE, which may or may not be related. https://github.com/travis-ci/travis-ci/issues?q=is%3Aissue+travis_commit_range+is%3Aopen (These will eventually be migrated here.)