On Travis: fatal: Invalid symmetric difference expression master...
Some Travis runs use an invalid diff range during travis.install.sh which results in the following error:
$ source "$DEV_LIB_PATH/travis.install.sh"
git diff master...2abbda3a1c6b90a0173e832e250ce2007e3fd074
fatal: Invalid symmetric difference expression master...2abbda3a1c6b90a0173e832e250ce2007e3fd074
See this sample CI run while the previous without the error and could resolve the diff:
4.63s$ source "$DEV_LIB_PATH/travis.install.sh"
git diff master...a6bb9a704a687f08b748c47975cdc753331a7683
Downloading PHPUnit 7 phar
Cloning into '/tmp/wpcs'...
remote: Enumerating objects: 16677, done.
remote: Total 16677 (delta 0), reused 0 (delta 0), pack-reused 16677
Receiving objects: 100% (16677/16677), 3.98 MiB | 17.65 MiB/s, done.
Resolving deltas: 100% (11626/11626), done.
Note that both are valid ranges:
- https://github.com/WordPress/application-passwords/compare/master..2abbda3a1c6b90a0173e832e250ce2007e3fd074
- https://github.com/WordPress/application-passwords/compare/master..a6bb9a704a687f08b748c47975cdc753331a7683
This could be a Travis issue, too. I'm not sure.
OK, so this happens only for merge commits like https://github.com/WordPress/application-passwords/commit/2abbda3a1c6b90a0173e832e250ce2007e3fd074 (here is the Travis CI run for that commit).
Per https://help.github.com/en/github/committing-changes-to-your-project/commit-exists-on-github-but-not-in-my-local-clone
The branch that contains the commit was deleted, so the commit is no longer referenced.
Re-opening since we should probably return a non-zero exit code when this happens. Otherwise the builds appear to pass.
I'm also getting this error on Travis builds triggered by GitHub pull requests using the travis.install.sh script. Sometimes the error shows up and sometimes it doesn't. I have not been able to reliably reproduce or avoid the conditions that cause the error to present itself.
git diff master...b5420ec79e7ad76b5fb9d1b743ae35c01c5f82b0
fatal: Invalid symmetric difference expression master...b5420ec79e7ad76b5fb9d1b743ae35c01c5f82b0
This has actually been a problem for a few years now, but I just found this GitHub issue. @kasparsd, were you ever able to determine whether this was a user-related configuration problem, a Travis problem, or a problem with the check-diff.sh script?
@kasparsd, you might want to check out the following Travis bug:
https://github.com/travis-ci/travis-ci/issues/2666
I've been digging into this with @irmalcol, and it seems like this bug is still an issue, despite the Travis team closing the bug. We're trying a workaround along the lines of what's mentioned in the bug:
before_install:
- export TRAVIS_COMMIT=$(git rev-parse FETCH_HEAD)
Preliminary results look promising, but the issue was intermittent, so need to keep an eye on it.