Bulk ammending commit messages in git

At my job I’m using git-p4 to work locally with some rails code in git and push to perforce. It’s working okay but one issue for me is that we require every commit to perforce to have a code review by someone, and we put the reviewer’s name at the bottom of each commit. For example:
Live changes to histograms
-commonized the histograms views & logic

CR: JamesM

Well when I’m working in the git repo, I don’t know who is going to code review it, so I end up having to add CR: JamesM to several commits. It can be done with rebase -i, but it is several steps per commit. I could use git-notes, but that doesn’t follow the format that we like (it puts Notes: in). Because this is a local repo only, changing the commit history is not a big deal. After some searching I found the way:
git filter-branch --msg-filter 'cat && echo "CR: REVIEWER"' p4/master~1..HEAD

This little beauty will append CR: REVIEWER to all of the commits from the master to the current head (all of the local commits).

16 Comments

We could be just a few years from Tricorder-like diagnosis devices.
It sells for $249 with a two year contract at Verizon, although you can get it through
Wirefly. Certainly, the benefit of access these buttons provide to various features is worth a bit of self-training, I
believe.

I was cᥙrious if you ever considered changing the layout of your
blog? Its very well written; I love what youve got to say.
But maybe you could a little more in thе way of content so
people could connect with it better. Youve
got an awful lot of text for only having 1 or two pictures.

hi!,I really like your writing very much! share we be in contact more
approximately your article on AOL? I need an expert on this house to resolve my problem.
May be that is you! Taking a look ahead to see you. cheap
nfl jerseys

With havin so much content do you ever run into any issues of plagorism or copyright violation?
My blog has a lot of completely unique content I’ve either written myself or outsourced but it
looks like a lot of it is popping it up all over the web without
my permission. Do you know any techniques to help protect against content from being
ripped off? I’d really appreciate it.

I’m impressed, I must say. Seldom do I come across
a blog that’s both equally educative and interesting, and let
me tell you, you have hit the nail on the head. The issue is an issue
that not enough people are speaking intelligently about.
I’m very happy that I stumbled across this during my hunt for something concerning this.cheap ncaa jerseys

An impressive share! I have just forwarded this onto a co-worker who had been doing a little
research on this. And he in fact ordered me dinner due to the fact that I found it for him…
lol. So let me reword this…. Thanks for the meal!! But yeah, thanks for spending time
to talk about this topic here on your web site.cheap nfl jerseys

Simply wish to say your article is as astounding. The clarity on your post is simply spectacular and that i could suppose you are an expert on this
subject. Well with your permission allow me to take hold of your RSS feed to keep up
to date with drawing close post. Thanks one million and please carry on the enjoyable work.

Hi there, just was aware of your blog through Google, and found that it’s really informative.
I am going to watch out for brussels. I will appreciate for
those who continue this in future. Numerous folks might be benefited out of your writing.
Cheers!