language: perl
install: true

jobs:
        include:
                - script: make test
                - stage: maintain
                  before_install:
                          - git config user.name TravisCI
                          - git config user.email https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID
                  script:
                          - git checkout $TRAVIS_BRANCH
                          - make -B maint
                          - git status
                          - \[ -z "`git ls-files -dok`" \] \|| \{ echo "Untracked files present: Please commit this generation manually"; false \}
                          - |
                            set -ex
                            if \[ -n "`git ls-files -m`" \]; then
                                git commit -am "Generate maintainer files"
                                git push https://$github_token@github.com/$TRAVIS_REPO_SLUG HEAD:$TRAVIS_BRANCH
                            else
                                echo "Nothing changed"
                            fi

language: perl
install: true

jobs:
        include:
                - script: make test
                - stage: maintain
                  before_install:
                          - git config user.name TravisCI
                          - git config user.email https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID
                  script:
                          - git checkout $TRAVIS_BRANCH
                          - make -B maint
                          - git status
                          - \[ -z "`git ls-files -dok`" \] \|| \{ echo "Untracked files present: Please commit this generation manually"; false \}
                          - |
                            (
                                    set -e
                                    if \[ -n "`git ls-files -m`" \]; then
                                            git commit -am "Generate maintainer files"
                                            git push https://$github_token@github.com/$TRAVIS_REPO_SLUG HEAD:$TRAVIS_BRANCH
                                    else
                                            echo "Nothing changed"
                                    fi
                            )

Remove set -x; place set into subshell
Travis: Remove set -x; place set into subshell
