{"thread":{"id":"57791","subject":"No MERGE_HEAD available in pre-merge-commit hook","startedAt":"2022-04-25T13:51:22Z","lastAt":"2022-04-25T13:51:22Z","messageCount":1,"participants":["Wannes Sels"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"454384","messageId":"CAK7pLR1Se_woAr6ntUvka1Qfb_WBen5tXw7=Ybx0cPQrHM-X8w@mail.gmail.com","threadId":"57791","inReplyTo":null,"subject":"No MERGE_HEAD available in pre-merge-commit hook","fromName":"Wannes Sels","fromEmail":"wannes.sels@gmail.com","sentAt":"2022-04-25T13:50:59Z","receivedAt":"2022-04-25T13:51:22Z","isPatch":false,"sender":{"key":"wannes.sels@gmail.com","avatar":null},"body":"The MERGE_HEAD ref is not available in the pre-merge-commit hook, but\nit is available in subsequent hooks prepare-commit-msg and commit-msg\n\nFrom https://github.com/git/git/blob/master/builtin/merge.c#L843 :\nin prepare_to_commit() the call to write_merge_heads() is after\nrun_commit_hook(\"pre-merge-commit\")\n\nCan the write_merge_heads() call be moved up? At first glance it\ndoesn't look like it would break anything.\n"}]}