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 8266715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:15:38+00:00 2026-06-08T05:15:38+00:00

With git on the command line, you see the result of your pre-commit hooks

  • 0

With git on the command line, you see the result of your pre-commit hooks before entering the commit’s log message. If your pre-commit hook makes the commit fail, you are warnt and don’t write anything.

But with magit, you are asked to enter your log comment and then it evaluates your hook, and if it fails you don’t see why. You just read :

git exited abnormally with code 1.
I understand this is normal because it is when you are finished editing the log message that magit runs the git command.

So, how would you make magit to evaluate your hook before asking for the log ?
How can you make magit display the result of the hook ?

And a related question would be, how do you give arguments to you pre-commit hook in order to run it for the stashed files only, instead of all the files in the repository ?

I use pre-commit hooks mainly to check if I didn’t forget debugging stuff, like a remaining ‘ipdb’, and some personal traces.

Thanks !

  • 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-08T05:15:40+00:00Added an answer on June 8, 2026 at 5:15 am

    I’ve wrote code for running the hook before opening the log-message buffer:

    https://github.com/vanicat/magit/commit/87ec17c46b156c8508a47aa6c9ba982ef8a61b4c

    You could test it, it miss the possibility to ignore the hook, and don’t run others hook than pre-commit for now.

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

Sidebar

Related Questions

When I am in the git command line, it’s rather difficult to commit some
I can see the text based graph running the command : git log --graph
After i commit and push to the remote repository from the command line: git
I recently switched to command-line git for my personal projects. I have used 3-way
With hg, how I can see in command line the branches graphs? Similar to
Is there a Python module for doing gem/git-style command line arguments? What I mean
I am using the command line version of Git and gitk. I want to
One irritating thing I find about using command line Git is having to manually
Is there a Git command equivalent to: git branch | awk '/\*/ { print
Is there a simple Git command to determine the creation date of a file

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.