Message ID | 1496925567-11752-2-git-send-email-majopela@redhat.com |
---|---|
State | Superseded |
Headers | show |
On Thu, Jun 08, 2017 at 12:39:27PM +0000, majopela@redhat.com wrote: > From: Miguel Angel Ajo <majopela@redhat.com> > > This utility script exports the on the tail of your current branch, > and runs utilities/checkpatch.py on each of them. > > Signed-off-by: Miguel Angel Ajo <majopela@redhat.com> I'm not a big fan of the name because it makes it sound like a general-purpose tool for Git repositories. We can pretty easily integrate this into checkpatch itself: https://patchwork.ozlabs.org/patch/775978/
Wow Ben, I hadn't seen your "updated patch". Sounds great, checkpatch integration is even better :) Best regards, and thanks, Migue Ángel On Wed, Jun 14, 2017 at 10:43 PM, Ben Pfaff <blp@ovn.org> wrote: > On Thu, Jun 08, 2017 at 12:39:27PM +0000, majopela@redhat.com wrote: > > From: Miguel Angel Ajo <majopela@redhat.com> > > > > This utility script exports the on the tail of your current branch, > > and runs utilities/checkpatch.py on each of them. > > > > Signed-off-by: Miguel Angel Ajo <majopela@redhat.com> > > I'm not a big fan of the name because it makes it sound like a > general-purpose tool for Git repositories. > > We can pretty easily integrate this into checkpatch itself: > https://patchwork.ozlabs.org/patch/775978/ >
diff --git a/utilities/git-checkpatches b/utilities/git-checkpatches new file mode 100755 index 0000000..d25f41f --- /dev/null +++ b/utilities/git-checkpatches @@ -0,0 +1,26 @@ +#!/bin/sh + +# usage: git-checkpatches [number of patches] +# +# this script can be used to pass checkpatch on a set of patches +# of your git history +# + +# just one patch by default +PATCHES=${1:-1} + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +TMPDIR=$(mktemp -d) + +git_span="HEAD~$PATCHES..HEAD" + +echo "Checking patches $git_span" + +git format-patch -n $git_span -o $TMPDIR +for patch in $TMPDIR/*.patch; do + echo "Checking patch $patch ========================" + $DIR/checkpatch.py $patch + echo "" +done + +rm -rf $TMPDIR