Cyril Brulebois <[email protected]> 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 'add-tag.sh "Reviewed-by: Peter Hutterer 
> <[email protected]>" "Reviewed-by: Daniel Stone 
> <[email protected]>"' 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'".

Soren


[ssp@l3000 xserver]$ cat add-line.sh 
#!/bin/sh

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

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

script='
/'$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'" $@
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to