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
honor '~/.git-config' [commit] section #17175
Comments
Copied from #17179 The feature requestApparently, good git commit message style requires to separate subject from body with a blank line. IMO the GitHub Desktop App should provide an easy feature to accomplish this without editing the global Git config. Thus the apparent default behaviour of a "--cleanup=whitespace" could continue and as a new optional feature for a new commit just one empty line could be added to separate subject from body with a blank line. Proposed solutionAvoid complexity and do not honour the [commit] section nor edit the global Git config. The new optional feature should:
Example GUI given below: Additional contextref General Commit Message Guidelines ref MacPorts Commit Messages Guidelines ref #17175 |
To address the original issue. GitHub Desktop does trim the body input as a means to remove unintended introduction of whitespace (not through git, but programmatically as input validation). However, it automatically adds the expected newline between the summary and description. We do not apply You can find the logic here: The commit formatting:
The createCommit method. desktop/app/src/lib/git/commit.ts Line 15 in bc69ee8
Here is some images showing that it does: |
If you view your commits in the command line, are you not seeing the newlines? |
Oh silly me and this was a most embarrassingly misjudgement from my side. Obviously, I misinterpreted a reasonable complaint from a third party and totally overreacted. A basic However, I would like to thank for the able and kind advice of this great community. Please accept my sincere apologies for any inconvenience. 🌻 |
The problem
Apparently, good git commit message style requires to separate subject from body with a blank line.
Unfortunately, the GitHub Desktop deletes any leading empty line in a body of a new commit. At least this happens to me with GitHub 3.2.7 (and earlier) on macOS and I found no easy way to change this.
Please note a
git config --global commit.cleanup verbatim
did not help. Apparently, GitHub Desktop ignores the "[commit]" section of the '~/.git-config' and always enforces a "--cleanup=whitespace", if I am correct.Naturally, there would be CLI git but GitHub Desktop should honor more of '~/.git-config' thus IMO making this worth a bug report and not just a feature request.
Release version
3.2.7
Operating system
macOS 11.7.9
Steps to reproduce the behavior
git config --global commit.cleanup verbatim
via CLILog files
% cat ~/.gitconfig
Screenshots
Additional context
ref git-commit - cleanup
ref General Commit Message Guidelines
ref MacPorts Commit Messages Guidelines
The text was updated successfully, but these errors were encountered: