git_diff_parser
Version, currently master branch1 version
- master branchlatestMar 16, 2020
github.com/microgit-com/git_diff_parser
Git Diff Parser in Crystal
Installation
# Add this to your shard.yml
dependencies:
git_diff_parser:
github: microgit-com/git_diff_parser
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.33.0- License
- MIT
- Author
- Håkan Nylén
Dependencies
This version declares no dependencies.
README
git_diff_parser
A git diff parser but in Crystal - Ported from https://github.com/packsaddle/ruby-git_diff_parser
Installation
-
Add the dependency to your
shard.yml:dependencies: git_diff_parser: github: microgit-com/git_diff_parser -
Run
shards install
Usage
require "git_diff_parser"
Entirely Git Diff
Then use the patches parse:
patches = GitDiffParser::Patches.parse(diff)
I added paddlesaddle's GitDiffParser.parse method, even if it was deprecated.
So you can use it as well if you want.
A small diff (commit diff, file diff)
Then use the patch new:
patch = GitDiffParser::Patch.new(diff)
Development
I copy more or less everything from paddlesaddle and ported it to crystal. Even the specs. So Run crystal spec if you add or change anything to make sure it works :)
Contributing
- Fork it (https://github.com/microgit-com/git_diff_parser/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Håkan Nylén - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Mar 16, 2020
- Crystal
0.33.0- Indexed
- yes
Dependents
Repository
github.com/microgit-com/git_diff_parser
Metadata
- Created
- Aug 16, 2026
- Updated
- Oct 19, 2026
- Synced
- Oct 19, 2026
- Versions
- 1