https://github.com/purplebooth/mit-commit
(Mirror)
https://github.com/purplebooth/mit-commit
git hacktoberfest
Last synced: 9 months ago
JSON representation
(Mirror)
- Host: GitHub
- URL: https://github.com/purplebooth/mit-commit
- Owner: PurpleBooth
- License: cc0-1.0
- Created: 2020-06-28T09:27:06.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-08-20T00:10:38.000Z (10 months ago)
- Last Synced: 2025-08-20T02:26:24.841Z (10 months ago)
- Topics: git, hacktoberfest
- Language: Rust
- Homepage: https://codeberg.org/PurpleBooth/mit-commit/
- Size: 291 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# mit-commit
A library to parse commit messages in git hooks
``` rust
use indoc::indoc;
use mit_commit::{Bodies, CommitMessage, Subject};
let message = CommitMessage::from(indoc!(
"
Update bashrc to include kubernetes completions
This should make it easier to deploy things for the developers.
Benchmarked with Hyperfine, no noticable performance decrease.
; Bitte geben Sie eine Commit-Beschreibung f\u{00FC}r Ihre \u{00E4}nderungen ein. Zeilen,
; die mit ';' beginnen, werden ignoriert, und eine leere Beschreibung
; bricht den Commit ab.
;
; Datum: Sat Jun 27 21:40:14 2020 +0200
;
; Auf Branch master
;
; Initialer Commit
;
; Zum Commit vorgemerkte \u{00E4}nderungen:
; neue Datei: .bashrc
;"
));
assert_eq!(
message.get_subject(),
Subject::from("Update bashrc to include kubernetes completions")
)
```
Read more at [Docs.rs](https://docs.rs/mit-commit/) or visit the [Codeberg repository](https://codeberg.org/PurpleBooth/mit-commit)