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

Show warning when git commit input box only contains whitespaces #45254

Merged
merged 1 commit into from
Jun 4, 2018

Conversation

gnijuohz
Copy link
Contributor

@gnijuohz gnijuohz commented Mar 8, 2018

fixes #45031.
A warning message 'Current commit message only contains line breaks' will be shown when git.inputValidation is not set to 'off' and all the user has entered in the commit message box are line breaks.

@kieferrm kieferrm requested a review from joaomoreno March 8, 2018 15:46
@joaomoreno joaomoreno added this to the Backlog milestone Mar 8, 2018
@joaomoreno joaomoreno added the git GIT issues label Mar 8, 2018
@gnijuohz
Copy link
Contributor Author

gnijuohz commented Mar 12, 2018

@joaomoreno after submitting this PR, I realized even though the issue was about line breaks but other white space characters may apply here too. For example, a mix of line breaks and empty spaces...

My current approach is to see if the commit message is all line breaks (using \r?\n), do you think matching whitespaces (\s) instead is a better approach?

@joaomoreno
Copy link
Member

@gnijuohz Yeah I think whitespace makes more sense.

@gnijuohz
Copy link
Contributor Author

@joaomoreno thanks! I'll update my PR.

@gnijuohz gnijuohz changed the title Show warning when git commit input box only contains linebreaks Show warning when git commit input box only contains whitespaces Mar 15, 2018
@gnijuohz
Copy link
Contributor Author

PR updated :)

@joaomoreno
Copy link
Member

Thanks! 🍻

@joaomoreno joaomoreno merged commit 231ce0c into microsoft:master Jun 4, 2018
@joaomoreno joaomoreno modified the milestones: Backlog, June 2018 Jun 4, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
git GIT issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent the possibility of committing "a line break as a message" to git
2 participants