Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Commit Hash Prefixer

Give your commit hashes leading zeroes!

Inspired by Тsфdiиg's 𝕏 post

Usage

Requires gcc; ./hasher builds the local C helper hasher-helper when needed. The helper uses all available CPU cores by default. Set HASHER_THREADS to cap it.

By default the prefix searched for is at least three leading zeroes 000

./hasher

Giving a valid lowercase hex string as the first option searches for that prefix

./hasher bada55
HASHER_THREADS=4 ./hasher 0000000

Example

Updating hashes of every unpushed local commit

git rebase --exec './hasher 000' origin/master

TODO

  • arg to give desired prefix instead of just current hard coded 000
  • speed it up using git commit-tree instead of git commit --amend
  • speed it up by running spinner in parallel

About

Prefix your commit hashes 7b99745 => 0000065

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages