Adding Reviewed-by (and the like) tags

Soeren Sandmann sandmann at
Fri May 6 04:45:30 PDT 2011

Cyril Brulebois <kibi at> writes:

> Hi,
> I guess it might be worth mentioning somewhere in the wiki how to
> easily (in an automated fashion) add r-b tags to a range of
> commits. Following Jon's suggestion on IRC, I've opted for:
> git filter-branch --msg-filter ' "Reviewed-by: Peter Hutterer <peter.hutterer at>" "Reviewed-by: Daniel Stone <daniel at>"' origin/master..
> (You may want to pass -f if you play with it several times in a row.)

FWIW, I wrote a similar script (below). Among its features is that it
will not add the line if it already exists.

However, in my opinion, this feature really belongs in git itself, for
example as a "git rebase --reviewed-by='blah'".


[ssp at l3000 xserver]$ cat 

usage() {
    cat <<EOF
Usage: add-line <line> [<filter-branch options>] <rev-list options>

[ -n "$line" ] || { usage >&2; exit 2; }

/'$line'/          { next; }
/^[a-zA-Z-]+: .*$/ { hyphenated_line = 1; print; next }
//                    { hyphenated_line = 0; print; next }
END { if (!hyphenated_line) { print "" } print "'$line'"; }'

#set -x
git filter-branch -f --msg-filter "awk '$script'" $@

More information about the xorg-devel mailing list