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

GIT bug: "amend param is not available to pre-commit hook"

From
AWAndrea Wyss <awyss@lastline.com>
Date
Mar 18, 2020, 14:42 UTC
Message-ID
<CAB8VZwTXVXHOf_WuU9goDaJRCdTnKeeQfL4hYn2PNQjhbYR9=Q@mail.gmail.com>

Issue amend param is not available to pre-commit hook.

Problem Cannot write a pre-commit hook that stops amending a commit that is present in other branches.

Steps to Reproduce (git version 2.21.1 on macOS 10.15.3)
1. In the pre-commit hook:
   echo "DEBUG 0='$0' 1='$1'"
2. run:
   git commit --amend
Result
   DEBUG 0='.git/hooks/pre-commit' 1=''
Expected Result
   DEBUG 0='.git/hooks/pre-commit' 1='--amend'

Please, let me know if you need other information. I'm looking forward for a fix or workaround.

Thank you,

Andrea Wyss Sr Frontend Architect www.lastline.com

Message 1 of 1 in “GIT bug: "amend param is not available to pre-commit hook"”
  1. Andrea WyssMar 18, 2020

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.