How do do bulk reviews?

Martin Schwenke martin at meltin.net
Sat Jan 25 20:10:11 MST 2014


On Sun, 26 Jan 2014 14:31:45 +1300, Andrew Bartlett
<abartlet at samba.org> wrote:

> But one question I had:  How do folks do the marking of bulk reviews
> like this?  For small series, I just git rebase -i, and then reword the
> commit message manually (or copy/paste), or when I'm doing it for
> others, I git rebase -i and REVIEW=1 git commit --amend && git rebase
> --continue using obnox's scripts.

Save this in your PATH as git-review:

#!/bin/sh

name=$(git config user.name)
email=$(git config user.email)

tag="${name} <${email}>"

cd "$(git rev-parse --show-toplevel)"

git filter-branch  -f \
    --msg-filter "git_review.msg-filter.awk -v tag='${tag}'" \
    origin/master..

Save this in PATH as git_review.msg-filter.awk:

#!/usr/bin/awk -f

BEGIN { have_attributions = 0 ; IGNORECASE = 1  }

{
    if ($0 ~ /^[[:space:]]*(Signed-off|Reviewed)-by:/) {
	have_attributions = 1
    } else {
	if (have_attributions) {
	    printf "Reviewed-by: %s\n", tag
	    have_attributions = 0
	}
    }
    print
}

END {
    if (have_attributions) {
	printf "Reviewed-by: %s\n", tag
    }
}

Assuming the branch you're sitting on is rebased on origin/master then
just run git-review.  :-)

Amitay and I whipped this up a couple of weeks ago with Stephen
Rothwell's help.  Either of them might prefer a version with more
options/flexibility, but this is good enough for me.  :-)

peace & happiness,
martin


More information about the samba-technical mailing list