I have a git repo called bwatout which contains the configuration of the command-line tools I use daily plus a bunch of utilities written in Python or Rust.
If you've ever seen a
dotfiles repo, it's like that, plus a few utilities.
All of the repo is mostly not designed to be used by someone else, but there's a bit of functionality that I think may prove useful in a broader context: lock-diff.rs
If you've ever run
git log -p on a Rust project, you may have been annoyed with the large output as soon as the
Cargo.lock - which is usually under version control - changes.
Well, git has a solution for that, which is called a
diff filter. Basically, under the correct configuration,
git diff can call a command on both versions on a given file, then print the diff between the two outputs.
So, the idea is simple: write a bit of rust that would parse the
Cargo.lock and instead of printing the whole file, just print
<name>@<version> for each dependency:
--- a/Cargo.lock +++ b/Cargo.lock @@ -230,9 +230,9 @@ checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "libsqlite3-sys" -version = "0.22.2" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d" +checksum = "d2cafc7c74096c336d9d27145f7ebd4f4b6f95ba16aa5a282387267e6925cb58" dependencies = [ "pkg-config", "vcpkg", ..
--- a/Cargo.lock +++ b/Cargo.lock ... -email@example.com +firstname.lastname@example.org ...
So, here's the deal: I've already have lots of open-source project to maintain and I don't really feel like going through all the work of extracting the code in a separate repository, add some documentation, publish a crate on crates.io and so on ...
So if you want, you may become the next maintainer of lock-diff !
I think it's a cool project to get started as a maintainer, so feel free to let me know below if you'd be interested and I would gladly help you get started.
PS: the tool also works on
poetry.lock files, used by poetry and it should not be too hard to make it work for other languages.
PPS: Feel free to find a cooler name