git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Wyss <awyss@lastline.com>
To: git@vger.kernel.org
Subject: GIT bug: "amend param is not available to pre-commit hook"
Date: Wed, 18 Mar 2020 07:42:55 -0700	[thread overview]
Message-ID: <CAB8VZwTXVXHOf_WuU9goDaJRCdTnKeeQfL4hYn2PNQjhbYR9=Q@mail.gmail.com> (raw)

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

                 reply	other threads:[~2020-03-18 14:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB8VZwTXVXHOf_WuU9goDaJRCdTnKeeQfL4hYn2PNQjhbYR9=Q@mail.gmail.com' \
    --to=awyss@lastline.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).