Skip to content

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).

11 Comments

  1. 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.

    Monday, July 24, 2017 at 10:10 pm | Permalink
  2. X wrote:

    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.

    Maybе you could space it out better?

    Wednesday, July 26, 2017 at 9:12 am | Permalink
  3. Manufacturers create this static imbalance of charges
    on the cell by doping each side of the silicon solar cell with different
    chemicals (e.g. phosphorous on one side and
    boron on the other).

    Tuesday, August 22, 2017 at 10:47 pm | Permalink
  4. What’s up colleagues, its enormous post regarding cultureand completely explained, keep it up
    all the time.

    Thursday, August 31, 2017 at 11:45 am | Permalink
  5. I pay a quick visit day-to-day a few web pages and websites to read
    posts, but this weblog gives quality based content.cheap nfl jerseys

    Thursday, August 31, 2017 at 10:11 pm | Permalink
  6. 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

    Saturday, September 2, 2017 at 4:15 am | Permalink
  7. Seo Madrid wrote:

    Estaba buscando esa informacion hace espacio, te lo
    agradezco, estoy de concierto con tu punto de vista y pasto igual.

    Despues de buscar mucho por Internet encontre lo que buscaba.
    Genial!!! muchas muchas gracias

    Wednesday, September 6, 2017 at 1:03 pm | Permalink
  8. 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.

    Friday, September 15, 2017 at 9:43 am | Permalink
  9. 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

    Friday, September 29, 2017 at 1:01 am | Permalink
  10. 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

    Tuesday, October 24, 2017 at 3:20 am | Permalink
  11. fuck women wrote:

    Very good post. I certainly love this website. Keep it up!

    Monday, November 13, 2017 at 9:37 pm | Permalink

3 Trackbacks/Pingbacks

  1. try here on Tuesday, July 25, 2017 at 11:34 pm

    try here

    confabulus › Bulk ammending commit messages in git

  2. this contact form on Wednesday, August 23, 2017 at 1:44 pm

    this contact form

    confabulus › Bulk ammending commit messages in git

  3. www.grumblr.me on Wednesday, August 23, 2017 at 7:29 pm

    http://www.grumblr.me

    confabulus › Bulk ammending commit messages in git

Post a Comment

Your email is never published nor shared.