Skip to content

Instantly share code, notes, and snippets.

@cddr
Created February 12, 2013 23:03
Show Gist options
  • Save cddr/4774314 to your computer and use it in GitHub Desktop.
Save cddr/4774314 to your computer and use it in GitHub Desktop.
# Script to review code in the order specified by Dougo on where_web. If you
# prefer a different order just rearrange the order of "git diffs", and maybe
# alter the definition of "ordered_files" if you actually add or remove a step
#
# It assumes you've checked out a local copy of the pull request and are
# comparing that with develop.
#
BASE=develop
HEAD=HEAD
ordered_files () {
git ls-files doc/ config/ db/migrate/ app/models/ test/unit \
app/controllers test/functional/ app/views/
}
other_files () {
comm -23 <(git ls-files |sort) <(ordered_files |sort)
}
ordered_commits () {
( git diff --color=always $BASE..$HEAD doc/
git diff --color=always $BASE..$HEAD config/
git diff --color=always $BASE..$HEAD db/migrate/
git diff --color=always $BASE..$HEAD app/models/
git diff --color=always $BASE..$HEAD test/unit/
git diff --color=always $BASE..$HEAD app/controllers/
git diff --color=always $BASE..$HEAD test/functional/
git diff --color=always $BASE..$HEAD app/views/
git diff --color=always $BASE..$HEAD $(other_files) ) |less -r
}
ordered_commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment