Crates.io | special-git-commit |
lib.rs | special-git-commit |
version | 0.1.2 |
source | src |
created_at | 2024-03-26 04:57:23.162667 |
updated_at | 2024-03-26 08:45:55.477133 |
description | A command line tool for generating commit hashes with specified prefixes. |
homepage | |
repository | https://github.com/OmmyZhang/special-git-commit-hash |
max_upload_size | |
id | 1185973 |
size | 16,499 |
A command line tool for generating commit hashes with specified prefixes.
git xxx
commandscargo install special-git-commit
git clone https://github.com/OmmyZhang/special-git-commit-hash.git
cd special-git-commit-hash
cargo build --release
Executable files for Linux, Mac and Windows.
special-git-commit <target-prefix>
or
special-git-commit
It will amend the HEAD commit with the target prefix. If no prefix is provided, the default prefix 0000000
will be used.
Let the result of git cat-file commit HEAD
be contents
.
$ git cat-file commit HEAD master
tree 66b5178f6feba85812818aeaca5a86b07cdd106f
parent 0000004a2eddb98c4b005362dd4fe37636633b3f
author Tdxdxoz <tdxdxoz@gmail.com> 1711436406 +0800
committer Tdxdxoz <tdxdxoz@gmail.com> 1711436919 +0800
update README
The hash of this commit (HEAD) is sha128("commit {contents.len()}\0{content}")
.
commit 216\0tree 66b5178f6feba85812818aeaca5a86b07cdd106f
parent 0000004a2eddb98c4b005362dd4fe37636633b3f
author Tdxdxoz <tdxdxoz@gmail.com> 1711436406 +0800
committer Tdxdxoz <tdxdxoz@gmail.com> 1711436919 +0800
update README
A prefix will be added to the committer's name, and checked if the new sha128 result matches.
in production