When rebasing a patch, style check the whole patch instead of just
the part that has changed. Otherwise, if the patch was previously
developed on a system without the prepare-commit-msg hook it will
not be properly checked before submission, possibly incurring the
ire of HPDD Checkpatch.
Test-Parameters: trivial
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I603577450d3524ab7bb3d4a4d0bdf8ce463ebbe5
Reviewed-on: http://review.whamcloud.com/8644
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
if [ -x "$CHECKPATCH" ]; then
echo "" >> "$1"
echo "#" >> "$1"
- git diff --cached | $CHECKPATCH $CHECKPATCH_OPTS - | sed -e 's/^/# /' >> "$1"
+ [ -d ".git/rebase-apply" -o -d ".git/rebase-merge" ] &&
+ DIFFOPT="HEAD" || DIFFOPT="--cached"
+ git diff $DIFFOPT | $CHECKPATCH $CHECKPATCH_OPTS - |
+ sed -e 's/^/# /' >> "$1"
fi
# Cause Vim to wrap text at 70 columns to match commit message style.