git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Gabriel Nützi" <gnuetzi@gmail.com>
To: Git List <git@vger.kernel.org>
Subject: Bug: Git invokes hooks from wrong directory.
Date: Tue, 27 Apr 2021 09:23:33 +0200	[thread overview]
Message-ID: <e173a3c0-5ca9-4c0e-9a1b-ef5f6aa72340@gmail.com> (raw)
In-Reply-To: <03b67357-4d9a-ea66-ad72-f01bb25aa54c@gmail.com>

Dear Community

The following MWE in
https://stackoverflow.com/questions/67273420/why-does-git-execute-hooks-from-an-other-repository/67276138#67276138

shows a bug that Git executes the hooks in `/tmp/A` instead of 
`/tmp/Githooks`.

# ----------
|# Make simple repo git init "/tmp/A" && cd "/tmp/A" || exit 1
|
|
|
|# Make hook to demonstrate the problem
   mkdir -p ".git/hooks" &&
|
|echo "echo 'EXECUTED!!!'" >.git/hooks/reference-transaction &&
|
|  chmod +x ".git/hooks/reference-transaction" &&
|
|  git clone -c core.hooksPath=".git/hooks" --template= 
"https://github.com/gabyx/Githooks.git" /tmp/Githooks|
# ----------

Would be nice to know, if this is indeed a bug and should be fixed?

If somebody points me to the corresponding source code, I could dive in.
Thanks a lot.

BR Gabriel Nützi



           reply	other threads:[~2021-04-27  7:23 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <03b67357-4d9a-ea66-ad72-f01bb25aa54c@gmail.com>]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=e173a3c0-5ca9-4c0e-9a1b-ef5f6aa72340@gmail.com \
    --to=gnuetzi@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).