Magit does not filter comment lines when committing #361

Closed
DarwinAwardWinner opened this Issue Jan 25, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@DarwinAwardWinner
Contributor

DarwinAwardWinner commented Jan 25, 2012

Since adding a preference to put the standard git status comments in the magit-log-edit buffer, I've realized that magit uses the contents of the log-edit buffer literally, with no regard for comments. Yet, blank lines before the first nonblank line are indeed filtered out, and multiple consecutive blank lines in the body are collapsed into a single blank line. Is this intentional? Since git comments are simply lines that start with "#", filtering them out would be trivial. I'll submit a pull request to do so shortly.

@dudebout

This comment has been minimized.

Show comment Hide comment
@dudebout

dudebout Jan 25, 2012

Member

This is the expected behavior of git.
The git comments are only stripped if git put them in your editor for you by doing git commit without the -m option.
If you put them by hand, git does not strip.
The behavior is controlled by git commit --cleanup=<mode>.

You might want to put the result of git-status before the magit-log-header-end separation.
Then you can filter up to that separation.
This allows for commit messages with lines starting with the # symbol.

Member

dudebout commented Jan 25, 2012

This is the expected behavior of git.
The git comments are only stripped if git put them in your editor for you by doing git commit without the -m option.
If you put them by hand, git does not strip.
The behavior is controlled by git commit --cleanup=<mode>.

You might want to put the result of git-status before the magit-log-header-end separation.
Then you can filter up to that separation.
This allows for commit messages with lines starting with the # symbol.

@DarwinAwardWinner

This comment has been minimized.

Show comment Hide comment
@DarwinAwardWinner

DarwinAwardWinner Jan 25, 2012

Contributor

Thanks for the pointer to the --cleanup option. I've used it to implement this preference and integrate it with my previous code, so that status comments should no longer be allowed to slip into commit messages: #363

Contributor

DarwinAwardWinner commented Jan 25, 2012

Thanks for the pointer to the --cleanup option. I've used it to implement this preference and integrate it with my previous code, so that status comments should no longer be allowed to slip into commit messages: #363

@tarsius

This comment has been minimized.

Show comment Hide comment
@tarsius

tarsius Apr 20, 2013

Member

Merged in #363

Member

tarsius commented Apr 20, 2013

Merged in #363

@tarsius tarsius closed this Apr 20, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment