1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| | #/bin/sh
# Usage: check-series [upstream-commit]
# Checks each commit in a patch series (topic branch) by running the
# script devel/check-commit. If check-commit fails (exits with
# non-zero status), the user is left in the middle of a git rebase, and
# can fix the commit, e.g. using git commit --amend, followed by
# "git rebase --continue". If all else fails, "git rebase --abort" should
# get you back to where you started.
#
# NOTE: this runs "make test" many times, so it can take a while.
#
trap cleanup EXIT
cleanup () {
if [ -n "$tmpdir" ]; then
rm -rf $tmpdir
fi
}
upstream=master
if [ -n "$1" ]; then
upstream="$1"
fi
# make sure we always run the most recent version of check-commit
# in particular cope with it going away.
tmpdir=$(mktemp -d)
cp devel/check-commit $tmpdir
GIT_SEQUENCE_EDITOR="perl -pi -e 's,^\s*([^#\s].*)$,\1\nexec $tmpdir/check-commit,'" git rebase -i $upstream
|