travis-apidoc: fix old/new revisions in PR comments

This commit is contained in:
Daniel Hahler 2016-04-04 23:35:40 +02:00
parent 742717ec22
commit 755088e87a
1 changed files with 4 additions and 2 deletions

View File

@ -66,7 +66,6 @@ if git diff --cached --exit-code --quiet; then
fi
# Commit the relevant changes.
OLD_REV="$(git rev-parse --short HEAD)"
COMMIT_MSG="Update docs for $AWESOME_VERSION via Travis
Last commit message:
@ -74,7 +73,6 @@ $(cd $REPO_DIR && git log -1 --pretty=format:%s)
Build URL: https://travis-ci.org/awesomeWM/awesome/builds/${TRAVIS_BUILD_ID}"
git commit -m "[relevant] $COMMIT_MSG"
NEW_REV="$(git rev-parse --short HEAD)"
# Commit the irrelevant changes.
mv .git ../doc
@ -87,15 +85,19 @@ git commit -m "[boilerplate] $COMMIT_MSG"
git tag _old
git reset --hard HEAD~2
git cherry-pick _old _old~1
RELEVANT_REV="$(git rev-parse --short HEAD)"
git tag -d _old
git checkout "$BRANCH"
OLD_REV="$(git rev-parse --short HEAD)"
git merge --no-ff -m "$COMMIT_MSG" merged-update
NEW_REV="$(git rev-parse --short HEAD)"
git push --quiet origin "$BRANCH"
# Generate compare view links.
COMPARE_LINKS="Compare view: https://github.com/awesomeWM/apidoc/compare/${OLD_REV}...${NEW_REV}"
COMPARE_LINKS="$COMPARE_LINKS\nRelevant changes: https://github.com/awesomeWM/apidoc/commit/${RELEVANT_REV}"
if [ "$BRANCH" != "gh-pages" ]; then
COMPARE_LINKS="$COMPARE_LINKS\nComparison against master (gh-pages): https://github.com/awesomeWM/apidoc/compare/gh-pages...${NEW_REV}"
fi