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

Don't count newline against commit subject length #310

Closed
wants to merge 2 commits into from
Closed

Don't count newline against commit subject length #310

wants to merge 2 commits into from

Conversation

jdewyea
Copy link
Contributor

@jdewyea jdewyea commented Dec 19, 2015

These changes apply to the Overcommit::Hooks::CommitMsg::TextWidth hook.

When specifying a max_subject_width, I expect to be able to type out a commit subject as long as the specified max width. However, because the hook counts the newline character, the hook fails.

This pull request takes the behavior used for the commit body -- i.e., not counting a trailing newline against the total width -- and applies that to the commit subject as well.

Add example verifying that lines in the commit message are allowed
to be the length of the limit plus a trailing newline character.
When comparing the commit subject against the specified limit, trailing
newlines should not be considered part of a subject's character count.
@sds sds added the bug label Dec 23, 2015
@sds
Copy link
Owner

sds commented Dec 23, 2015

Thanks!

Merged in 44fc645 with a fix for Ruby 1.9.3 in ef693fb.

@sds sds closed this Dec 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants