spacedentist / spr

Submit pull requests for individual, amendable, rebaseable commits to GitHub
https://getcord.github.io/spr/
MIT License
391 stars 41 forks source link

Remove the "Summary:" label from commit messages #4

Closed sven-of-cord closed 2 years ago

sven-of-cord commented 2 years ago

It's kind of pointless to have. The commit message begins with a title (first line), and what follows summarises what's done in the commit. We don't need a "Summary:" label for that. This diff makes it so that when we construct messages (either commit messages or the bodies of Pull Requests), we omit labels until we get to the first section that's neither Summary or Title. So internally we keep the separate Summary section, we just don't label it. Which makes this backwards-compatible: messages which have the "Summary:" label get parsed correctly.

Test Plan: build, and use this version to do the "spr diff" and "spr land" of this commit. Check that the Pull Request body is constructed correctly, and that it gets converted to the final commit message correctly. Also, try "spr format" with commit messages with and without "Summary:" label.

sven-of-cord commented 2 years ago

I don't remember enough Rust details to check your ampersands, but I trust the compiler does.

It most certainly does! (Also VSCode is amazing for Rust!)