Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Make git commit-msg hook configurable. #454

Closed
wants to merge 2 commits into from

Conversation

jrbeeman
Copy link
Contributor

As a developer, I would like to make the commit-msg git hook configurable so that I don't have to provide my own git hook setup process that is specific to my project. In particular, I want to configure the regex used to check the commit message format, and provide an alternative instructional response upon failure.

I think this will require some discussion and work to get a solution that doesn't break current installations.

@jrbeeman
Copy link
Contributor Author

It looks like the regex introduces test failures, but I'm unable to reproduce this issue locally within a project at the moment.

@grasmash
Copy link
Contributor

Looks like it's having some issues parsing project.yml:

Previous IOException: Unable to parse contents of /home/travis/build/acquia/blt-project/project.yml: Unable to parse at line 7 (near "{  }")

@grasmash grasmash added the Enhancement A feature or feature request label Sep 26, 2016
@grasmash
Copy link
Contributor

I suspect that after running blt update the regex may be reformatted in a way that renders it unparsable.

@@ -20,6 +20,16 @@ git:
# Defining git remotes allows builds deployed via CI.
- [email protected]:bolt8.git
# - [email protected]:radass4.git
commit_message:
regex: "^$BLT-[0-9]+(: )[^ ].{15,}\."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe using single quotes will address the syntax issue.

@jrbeeman
Copy link
Contributor Author

Still failing after changing to single quote. Perhaps we should tackle the larger discussion about approach from @pinterest-subsites-travis-ci: Is this an appropriate solution to the problem?

@steveworley
Copy link
Contributor

I agree that BLT should provide some default functionality for git-hooks but ultimately should allow projects to configure targets to run during each hooks.

I've started a branch to extend the pre-commit task in #474. At this stage, it only allows you to define custom phing targets to run during the pre-commit stage. I think this is okay, projects can defined custom include files which can open up all sorts of Phing magic which can be included in project.yml, but definitely interested in the conversation around this.

@grasmash grasmash mentioned this pull request Nov 4, 2016
@jrbeeman
Copy link
Contributor Author

I think we should close this PR in favor of the discussion happening in #628.

@grasmash
Copy link
Contributor

Alright then. #628 was closed with the merging of #692.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants