Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> --- dim | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dim b/dim index 67671de198a0..65985bc4909a 100755 --- a/dim +++ b/dim @@ -690,19 +690,23 @@ function checkpatch_commit fi } -dim_alias_check_patch=checkpatch -dim_alias_cp=checkpatch -function dim_checkpatch +# turn $1 in to a git commit range +function rangeish() { - local range - if [ -z "$1" ]; then - range="HEAD^..HEAD" + echo "HEAD^..HEAD" elif [ -n "`echo $1 | grep '\.\.'`" ]; then - range="$1" + echo "$1" else - range="$1..HEAD" + echo "$1..HEAD" fi +} + +dim_alias_check_patch=checkpatch +dim_alias_cp=checkpatch +function dim_checkpatch +{ + local range=$(rangeish "$1") for commit in $(git rev-list --reverse $range); do checkpatch_commit $commit || true -- 2.1.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx