From 000000007aa5f9437310c0b32f8ff2e5d0cb8af7 Mon Sep 17 00:00:00 2001 From: Recolic Keghart <root@recolic.net> Date: Sun, 13 Feb 2022 17:49:55 +0800 Subject: [PATCH] Update documents. 82 --- Makefile | 8 ++++++-- README.md | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 50bff0c..638848a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,13 @@ +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/ diff --git a/README.md b/README.md index 460e129..3c1d9a6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,15 @@ +# 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`. -- GitLab