Expand description
The hooks directory of one transaction: its plan and one entry per preparation event.
What:
The hooks directory of one commit transaction:
its plan.json and one entry per preparation event.
Why:
Git starts a hook through core.hooksPath by the entry’s path, so the entry’s name is the event
and the executable it starts is the native wrapper.
On Windows Git looks for <event>.exe, so entries are hard links or copies with that name.
In TS you’d write (pseudocode):
await writeHookShim({ hooksDirectory, plan, nodePath: process.execPath });Structs§
- Hook
Entry Error - What: Why writing a hooks directory failed, naming the path. Why: The caller stops the transaction; a partial hooks directory is never reused.
Functions§
- hook_
entry_ name - What:
The file name of one preparation event’s entry.
Why:
Unix names the entry after the event; Windows adds
.exe, which Git appends when it looks up a hook. - write_
hook_ dispatch - What:
Create a new hooks directory holding the plan and one entry per preparation event.
Why:
The incumbent’s
writeHookShim, with native entries instead of a Node program:post-commithas no entry, so it never runs during preparation. The directory must not exist, so nothing half-written is reused.