Open samdeane opened 1 year ago
Indeed, the way Fork uses the prepare-commit-hook
is currently incompatible with CLI Git:
The second argument contains the source of commit, either message
, template
, merge
, squash
or commit
(which requires a third argument). IMO, only the first and the last of these are relevant for Fork.
Furtunately, it's not very difficult to make things compatible. Fork would have to...
prepare-commit-hook
then edits this file and exits, at which point Fork reads the temporary file and prefills the input with this content.message
and not set any third argument.commit
and the third argument to the SHA of the commit to be amended./cc @DanPristupov
When the git command line runs
prepare-commit-hook
, it is passed up to three parameters (see https://git-scm.com/docs/githooks#_prepare_commit_msg).It looks like that's currently not happening when Fork runs it. It would be helpful if it did happen, so that existing hook scripts worked as expected.
Extra information, such as the existing "subject" and "description" field values, could also be passed as environment variables, eg: FORK_SUBJECT, and FORK_DESCRIPTION.
This would be helpful as it would allow the script to know that it was running from Fork.app, and modify its behaviour accordingly (if required).