Skip to content
/ vein Public

vanity git SHA checksums - probably terrible

Notifications You must be signed in to change notification settings

22a/vein

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vein

Creates vanity git commit hashes by adjusting commit timestamps

⚠️ Warning

This tool modifies git commits. While it preserves the commit content, if successful, it will change the commit hash immediately without a confirmation step.

DO NOT USE THIS, if you do not completely understand:

  • why it is an actively terrible idea to do this, and why this entire project should not exist
    • particulatly, why you should never use this on a shared remote
  • how git SHAs are generated, how you would achieve this functionality manually
  • the below-porcelain tools git gives you to undo anything this program does

I apologise in advance if this breaks anything on you but accept strictly zero responsibility - you run this at your own risk - good luck, sailor.

Description

vein allows you to modify your latest Git commit to have a specific SHA-1 prefix without changing the commit's content, tree, or parent relationships. It works by searching through different committer timestamps until it finds one that produces a hash with your desired prefix. It may fail to find, in which case it'll do nothing to the tree and print an error, but i'm pretty sure it'll still exit 1.

Building from Source

  1. Ensure you have Rust and Cargo installed (https://rustup.rs/)

  2. Clone and build:

git clone <repository-url>
cd vein
cargo build --release

The compiled binary live be at target/release/vein

Usage

Run vein in a Git repository to modify the latest commit's hash:

# Use default prefix (22aa)
vein

# Specify a custom prefix
vein abcd

# Get help
vein --help

The program will search through different timestamps until it finds one that produces a commit hash starting with your specified prefix.

Installation on PATH

what I did to make vein available on my PATH

  • clone & build as above
  • added $HOME/.cargo/bin to my PATH
  • cargo install
    cargo install --path . # at the root of the repo

About

vanity git SHA checksums - probably terrible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages