Crates.io | dirsh |
lib.rs | dirsh |
version | 0.2.0 |
source | src |
created_at | 2020-05-04 20:34:07.153092 |
updated_at | 2020-07-02 22:09:37.019026 |
description | Ignore-file-respecting consistent hasher of directory contents |
homepage | |
repository | https://github.com/christian-blades-cb/dirsh |
max_upload_size | |
id | 237539 |
size | 19,023 |
Dirsh hashes the contents of a directory, but respects your .gitignore
file and its own .hashignore
.
Hashing the inputs of a build is a convenient way to avoid rebuilding. Current solutions to this problem are either domain-specific, or lack a convenient way to configure which files should be included in the hash.
By default, dirsh hashes the current directory. .gitignore
and .hashignore
are parsed in the gitignore spec and used for filtering.
Dirsh calculates the md5 for the directory contents and returns the hash in base32 without padding.
$ dirsh -h
dirsh 0.2.0
Ignore-file-respecting consistent hasher of directory contents
USAGE:
dirsh [FLAGS] [paths]...
FLAGS:
-h, --help Prints help information
--no-gitignore don't parse gitignore (including global gitignore and local git excludes)
-V, --version Prints version information
ARGS:
<paths>... [default: ./]
Paths are recursively walked in alphabetical order.
File contents are fed to the digest, followed by 64 bits of modification time, and 32 bits of mode.
The md5 hash is then computed and base32 encoded without padding (for ease of url encoding, and compatibility with filesystems which ignore capitalization).
This project is built with nix, and the development environment is available with nix-shell
, or even better, lorri.
You can build the release binary with nix-build
.
This is a standard rust project. You'll need the rust toolchain to build this project.
cargo build