Skip to content
Snippets Groups Projects
Commit 00000000 authored by Recolic Keghart's avatar Recolic Keghart
Browse files

Update documents. 82

parent 00000000
No related branches found
No related tags found
No related merge requests found
CXX ?= g++
build:
g++ git-commit-hash-vanity.cc -lssl -lcrypto -lpthread -O3 -o git-commit-hash-vanity
$(CXX) git-commit-hash-vanity.cc -lssl -lcrypto -lpthread -O3 -o git-commit-hash-vanity
bench:
g++ sha1-benchmark.cc -lssl -lcrypto -O3 -o sha1-benchmark
$(CXX) sha1-benchmark.cc -lssl -lcrypto -O3 -o sha1-benchmark
time ./sha1-benchmark
install: build
cp git-commit-hash-vanity /usr/bin/
cp vgitcommit /usr/bin/
# Git commit-hash vanity
1. Run `git commit`
2. Run `git cat-file commit HEAD`
3. Run `git reset HEAD~1 --soft`.
4. Modify the `catfile_text` and `commit_msg` in `main()` , also modify the hash condition `if(unlikely(*(uint16_t *)hashbuf == 0))`. Also search for `+0800` if you need to modify timezone.
5. Commit the result. (You should commit exactly the same changes)
If you want your git-commit hash looks strange, use me!
## Installation
Download this project and `make install`.
## Usage
In your own git repo, you just run `vgitcommit 'Update documents. %s'` instead of running `git commit -m 'Update documents'`.
By default, this tool generates commit-hash with 8 leading-zero. If you want to change this behavior, just modify line 83 of `git-commit-hash-vanity.cc`.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment