From: Ping Yin Date: Mon, 05 May 2008 00:52:38 GMT Subject: Re: git and peer review Message-ID: <46dff0320805041752t1190534dy3740c88f5380098f@mail.gmail.com> In-Reply-To: <87k5i9u8f1.fsf@nav-akl-pcn-343.mitacad.com> On Mon, May 5, 2008 at 4:21 AM, Toby Allsopp wrote: > On Sat, May 03 2008, Ping Yin wrote: > > > Case 1 > > I ask someone to review my patches at my machine. If the review > > passes, i have to add Reviewed-by line to each commit and then merge > > it to the master branch. However, i find no easy way to add > > reviewed-by line. Maybe adding --reviewed-by option to cherry-pick or > > rebase or merge? > > > > Case 2 > > The reviewer is the maintainer, so i ask him to pull and review. So > > now it is his turn to add review-by line. But still, how? > > I do something similar using git filter-branch --msg-filter. I have a > little shell script call git-add-checked (our convention is to have a > "checked: " line in the commit message): > > --8<---------------cut here---------------start------------->8--- > #!/bin/sh > > usage() { > cat < Usage: git-add-checked [] > EOF > } > > checker="$1" > [ -n "$checker" ] || { usage >&2; exit 2; } > shift > > set -x > git filter-branch --msg-filter "sed '\$a\\ > \\ > checked: $checker'" "$@" > --8<---------------cut here---------------end--------------->8--- > > Then, after getting my changes reviewed, I just do: > > $ git-add-checked joe.bloggs trunk.. > > This adds a "checked: joe.bloggs" line at the end of the commit message > for all of the commits on the current branch since trunk (which is a > remote branch maintained by git-svn). > Great, very useful for me. THX. -- Ping Yin