close
Skip to content

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

Merged
joaomoreno merged 1 commit into
microsoft:masterfrom
gnijuohz:master
Jun 4, 2018
Merged

Show warning when git commit input box only contains whitespaces#45254
joaomoreno merged 1 commit into
microsoft:masterfrom
gnijuohz:master

Conversation

@gnijuohz

@gnijuohz gnijuohz commented Mar 8, 2018

Copy link
Copy Markdown
Contributor

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

gnijuohz commented Mar 12, 2018

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Contributor

@gnijuohz Yeah I think whitespace makes more sense.

@gnijuohz

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

PR updated :)

@joaomoreno

Copy link
Copy Markdown
Contributor

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