Skip to content

Conversation

@jethrodaniel
Copy link
Contributor

@jethrodaniel jethrodaniel commented Aug 8, 2020

  • changes default to not run on --amend
  • changes the default pattern
  • improves the documentation for this hook
  • refactors this hook's specs to reduce mocking and increase coverage

This changes the default branch pattern to a simpler pattern.

This is added to make understanding the hook and it's usage a bit
easier.
This changes the spec to test against the same default branch
replacement pattern specified in the default config.

This is just to make things more consistent.
This makes the usage of this (hopefully) obvious to anyone reading it.
This makes the default behavior of this hook skip commits that explicitly
give the SHA, i.e, `--amend`, `-c`, or `-C`.

This is added because most people (I'd argue) don't want to run this
hook on `amend`s.
This removes a trailing space after the repacement text, as well as
`#strip`ing the replacement text.
@jethrodaniel jethrodaniel changed the title Update ReplaceBranch hook to avoid running on --amend by default, change default pattern, improve docs Update ReplaceBranch hook to avoid running on --amend by default Aug 8, 2020
This changes the specs for the ReplaceBranch hook to

- test the contents of the file that `git` writes it's commit message to
- explicitly set config variables instead of mocking them
@jethrodaniel
Copy link
Contributor Author

Annoyingly, CI is complaining about a rubocop violation that doesn't exist. likely due to my force-pushes on this branch.

@sds
Copy link
Owner

sds commented Aug 12, 2020

Overall looks great. Once we get that one RuboCop line fixed we'll be good to merge. Thank you!

@jethrodaniel jethrodaniel marked this pull request as draft August 12, 2020 01:53
@jethrodaniel
Copy link
Contributor Author

Thanks - seems I was using rubocop with my global config, instead of this project's config.

@jethrodaniel jethrodaniel marked this pull request as ready for review August 12, 2020 02:29
@sds sds merged commit 603aa1b into sds:master Aug 13, 2020
@sds
Copy link
Owner

sds commented Aug 13, 2020

Thank you!

@jethrodaniel jethrodaniel deleted the prepare-commit-msg branch August 13, 2020 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants