Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8230487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:09:14+00:00 2026-06-07T17:09:14+00:00

I have a commit-msg hook that I run for all of my local commits

  • 0

I have a commit-msg hook that I run for all of my local commits and, for a certain project, I require to have been run. Problem is, when I pull in from other forks some of my compatriots have not run this commit-msg hook. To date I’ve been doing

$ git rebase --interactive $commit_parent

as outlined very similarly here. Pick the commits that haven’t been done properly, re-edit and so on. All very workable, but also tedious as I’m doing it by hand.

How can I automate this? The hook requires no oversight.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:09:16+00:00Added an answer on June 7, 2026 at 5:09 pm

    This can be achieved in automatic fashion using custom editor:

    #!/bin/bash
    # Save to rebase_editor.sh, chmod +x it
    file="$1"
    if head -n1 "$file" | egrep -q '^pick' "$file" ; then
      perl -pi -e 's/^pick/r/' "$file"
    fi
    

    and then running:

    GIT_EDITOR=./rebase_editor.sh git rebase -i <some-rev>
    

    On the first invocation, our “editor” will get a list of commits from rebase -i, where it will change every pick to r (which is reword). In this mode git will start immediately calling our “editor” with a message of every rebased commit (and without any pauses that it usually makes in pick mode where you can change your commit itself).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In git, i have 2 commit and a branch merge that have been rebased
I have a post-commit hook in svn that runs fine from the command line
I have been using Aptana to commit all my changes and hadn't open SmartGit
I have commit rights to a sourceforge project that is owned by the other,
We have a nice pre-commit hook for GIT, as well as a nice commit-msg.
I have a commit xyz in my local branch that I want to check
If I have a commit hash that has not yet been pushed to origin,
In our project we have to commit all changes to the clients svn repository.
I'd like to have a commit message cleanup that will not necessarily remove lines
Problem background I have a post-commit script for my SVN repository which archives &

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.