Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sielay/git-sha1
Native implementation of git commit SHA1 generator
https://github.com/sielay/git-sha1
Last synced: 1 day ago
JSON representation
Native implementation of git commit SHA1 generator
- Host: GitHub
- URL: https://github.com/sielay/git-sha1
- Owner: sielay
- Created: 2015-09-15T20:49:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-18T06:52:43.000Z (over 9 years ago)
- Last Synced: 2024-12-06T18:35:16.603Z (17 days ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GIT-SHA1-COMMIT
Small snippet allowing to create valid git commit SHA1.
Inspired by `masak` [gist](https://gist.github.com/masak/2415865)
## Install
```
npm install --save git-sha1-commit
```## Test
```
mocha
```## Usage
```
var commit = GitSHA1.create({
tree: '9bedf67800b2923982bdf60c89c57ce6fd2d9a1c',
parent: 'de1eaf515ebea46dedea7b3ae0e5ebe3e1818971',
author: 'jnthn 1334500503 +0200',
committer: 'jnthn 1334500545 +0200',
message: 'When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++\'s program.'
});
commit.toString() -> 'd6cd1e2bd19e03a81132a23b2025920577f84e37'
commit.toString('short') -> 'd6cd1e2';
```## License
MIT