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

Fwd: Bug report: Githook reference-transaction does not change working directory on git clone

From
Gabriel Nützi <gnuetzi@gmail.com>
Date
Sep 11, 2021, 06:57 UTC
Message-ID
<CAA9rTuf+AwPJYki6O_hEPAS=aZta3HuvQOWLHnRfv5FV0DfYSA@mail.gmail.com>
In-Reply-To
<CAA9rTucw0wzghy_onKgSWt=QmVoB1qsV108V7NYApJyV8FCpNw@mail.gmail.com>
Dear all,

With git 2.33.0, the "reference-transaction" hook does not change the working directory to the worktree (or GIT_DIR) when launched on `git clone`. It is just unchanged in this exact scenario.

MWE:

cd temp git init A mkdir -p templates/hooks && echo "CWD: pwd" > templates/hooks/reference-transaction git config --global init.templateDir templates git clone A test

Wrong Output:
CWD: temp
CWD: temp
CWD: temp
CWD: temp

I have seen this problems already on other occasion with other hooks. Probably the problem exists also there.

Thanks for fixing this if this is really a bug (??).
BR
Next: Gabriel Nützi
Message 1 of 2 in “Fwd: Bug report: Githook reference-transaction does not change working directory on git clone”
  1. Gabriel NütziSep 11, 2021
  2. Bug report: Githook reference-transaction does not change working directory on git cloneGabriel Nützi, Nov 12, 2021

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.