Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running with --move-existing gives Undefined array key "post-commit" #200

Closed
Magentron opened this issue Mar 2, 2023 · 1 comment
Closed
Assignees
Labels

Comments

@Magentron
Copy link

$ composer show captainhook/captainhook | fgrep versions
versions : * 5.14.4
vendor/bin/captainhook install --force --move-existing-to=.git/hooks-old
  Moved existing commit-msg hook to .git/hooks-old/commit-msg
  Add '.git/hooks-old/commit-msg {$FILE}' to your commit-msg configuration to execute it.
  'commit-msg' hook installed successfully
  Moved existing pre-push hook to .git/hooks-old/pre-push
  Add '.git/hooks-old/pre-push {$TARGET} {$URL}' to your pre-push configuration to execute it.
  'pre-push' hook installed successfully
  Moved existing pre-commit hook to .git/hooks-old/pre-commit
  Add '.git/hooks-old/pre-commit' to your pre-commit configuration to execute it.
  'pre-commit' hook installed successfully
  Moved existing prepare-commit-msg hook to .git/hooks-old/prepare-commit-msg
  Add '.git/hooks-old/prepare-commit-msg {$FILE} {$MODE} {$HASH}' to your prepare-commit-msg configuration to execute it.
  'prepare-commit-msg' hook installed successfully

Warning: Undefined array key "post-commit" in /var/www/html/vendor/captainhook/captainhook/src/Hooks.php on line 136

Missing here is Hooks::POST_COMMIT, but do not know what the value should be, so cannot make a PR:
https://github.com/captainhookphp/captainhook/blob/main/src/Hooks.php#L126:

        static $arguments = [
            Hooks::COMMIT_MSG         => ' {$FILE}',
            Hooks::POST_MERGE         => ' {$SQUASH}',
            Hooks::PRE_COMMIT         => '',
            Hooks::PRE_PUSH           => ' {$TARGET} {$URL}',
            Hooks::PREPARE_COMMIT_MSG => ' {$FILE} {$MODE} {$HASH}',
            Hooks::POST_CHECKOUT      => ' {$PREVIOUSHEAD} {$NEWHEAD} {$MODE}',
            Hooks::POST_REWRITE       => ' {$GIT-COMMAND}',
        ];
@sebastianfeldmann
Copy link
Collaborator

Should be fixed with 5.15.1 :)

Thanks for reporting the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants