git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: rebase -i reword runs pre-commit hook with curious results

From
AWAndrew Wong <andrew.w@sohovfx.com>
Date
Feb 2, 2012, 05:43 UTC
Message-ID
<4F2A2286.3090808@sohovfx.com>
In-Reply-To
<jgcc3q$mvl$1@dough.gmane.org>
On 12-02-01 4:50 PM, Neal Kreitzinger wrote:
> I'm confused on why and/or how interactive rebase runs the pre-commit hook
> when doing the reword command for commit (a).

When you do a "reword" in "rebase -i", it basically does a "cherry-pick" of that commit first, then it does a "commit --amend". And your pre-commit hook should've been run during the amend.

> IOW, the pre-commit hook does not get the same results as if I were doing a
> commandline git-commit of a modified index.

Does your pre-commit hook work when doing a "commit --amend"? I'm not sure if you can actually modify the author (or committer) date from inside a pre-commit hook.

Previous: Neal KreitzingerNext: Neal Kreitzinger
Message 2 of 3 in “rebase -i reword runs pre-commit hook with curious results”
  1. Neal KreitzingerFeb 1, 2012
  2. Andrew WongFeb 2, 2012
  3. Neal KreitzingerFeb 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.