Crates.io | cargo-lockdiff |
lib.rs | cargo-lockdiff |
version | 0.4.0 |
source | src |
created_at | 2020-04-03 05:32:03.28477 |
updated_at | 2024-12-10 07:55:52.03706 |
description | See what crates have changed after you run `cargo update` by comparing Cargo.lock to the vcs ref or file of your choice. |
homepage | |
repository | https://github.com/davidrjonas/cargo-lockdiff |
max_upload_size | |
id | 225740 |
size | 53,053 |
See what crates have changed after you run cargo update
by comparing Cargo.lock to the vcs HEAD or file of your choice.
Supports git, mercurial, and plain files.
$ cargo lockdiff --from "HEAD@{2 months ago}"
| Package | From | To | Compare |
|------------------------------|---------|------------------------------|------------|
| [serde_json][C6] | 1.0.42 | 1.0.48 | [...][C7] |
| [sha2][C8] | 0.8.0 | 0.8.1 | [...][C9] |
| [sharded-slab][CA] | NEW | 0.0.8 | |
| signal-hook | 0.1.12 | REMOVED | |
| [smallvec][CB] | 1.0.0 | 1.2.0 | [...][CC] |
| spin | 0.5.2 | REMOVED | |
| string | 0.2.1 | REMOVED | |
| [strum][CD] | NEW | 0.18.0 | |
| [strum_macros][CE] | NEW | 0.18.0 | |
| [syn][CF] | 1.0.11 | 1.0.17 | [...][D0] |
| [thiserror][D2] | NEW | 1.0.13 | |
| [thiserror-impl][D3] | NEW | 1.0.13 | |
| [thread_local][D4] | NEW | 1.0.1 | |
| [tokio][D5] | NEW | 0.2.13 | |
| [tokio-codec][D6] | 0.1.1 | 0.1.2 | [...][D7] |
| tokio-signal | 0.2.7 | REMOVED | |
| [tracing][F1] | 0.1.10 | 0.1.13 | [...][F2] |
| [tracing-attributes][F3] | 0.1.5 | 0.1.7 | [...][F4] |
[C6]: https://crates.io/crates/serde_json
[C7]: https://diff.rs/serde%5Fjson/1%2E0%2E42/serde%5Fjson/1%2E0%2E48/Cargo.toml
[C8]: https://crates.io/crates/sha2
[C9]: https://diff.rs/sha2/0%2E8%2E0/sha2/0%2E8%2E1/Cargo.toml
[CA]: https://crates.io/crates/sharded-slab
[CB]: https://crates.io/crates/smallvec
[CC]: https://diff.rs/smallvec/1%2E0%2E0/smallvec/1%2E2%2E0/Cargo.toml
[CD]: https://crates.io/crates/strum
[CE]: https://crates.io/crates/strum_macros
[CF]: https://crates.io/crates/syn
[D0]: https://diff.rs/syn/1%2E0%2E11/syn/1%2E0%2E17/Cargo.toml
[D2]: https://crates.io/crates/thiserror
[D3]: https://crates.io/crates/thiserror-impl
[D4]: https://crates.io/crates/thread_local
[D5]: https://crates.io/crates/tokio
[D6]: https://crates.io/crates/tokio-codec
[D7]: https://diff.rs/tokio%2Dcodec/0%2E1%2E1/tokio%2Dcodec/0%2E1%2E2/Cargo.toml
[F1]: https://crates.io/crates/tracing
[F2]: https://diff.rs/tracing/0%2E1%2E10/tracing/0%2E1%2E13/Cargo.toml
[F3]: https://crates.io/crates/tracing-attributes
[F4]: https://diff.rs/tracing%2Dattributes/0%2E1%2E5/tracing%2Dattributes/0%2E1%2E7/Cargo.toml
Package | From | To | Compare |
---|---|---|---|
serde_json | 1.0.42 | 1.0.48 | ... |
sha2 | 0.8.0 | 0.8.1 | ... |
sharded-slab | NEW | 0.0.8 | |
signal-hook | 0.1.12 | REMOVED | |
smallvec | 1.0.0 | 1.2.0 | ... |
spin | 0.5.2 | REMOVED | |
string | 0.2.1 | REMOVED | |
strum | NEW | 0.18.0 | |
strum_macros | NEW | 0.18.0 | |
syn | 1.0.11 | 1.0.17 | ... |
thiserror | NEW | 1.0.13 | |
thiserror-impl | NEW | 1.0.13 | |
thread_local | NEW | 1.0.1 | |
tokio | NEW | 0.2.13 | |
tokio-codec | 0.1.1 | 0.1.2 | ... |
tokio-signal | 0.2.7 | REMOVED | |
tracing | 0.1.10 | 0.1.13 | ... |
tracing-attributes | 0.1.5 | 0.1.7 | ... |
cargo install cargo-lockdiff
# try it
cargo lockdiff --help
To use git
or hg
the respective binary must be found in PATH
. cargo metadata
is needed for links.
cargo update
# don't commit yet!
cargo lockdiff
Or from vim, to insert the output into the commit message, type :r!cargo lockdiff
.
To see what changed long ago (in git),
cargo lockdiff --from "HEAD@{2 months ago}"
Environment variables prefixed with CARGO_LOCKDIFF_
, such as CARGO_LOCKDIFF_NO_LINKS=true
, may also be used. Set these in your ~/.profile
(specific to your shell, of course) as defaults.
-p, --path <path>
: Base to with which to prefix paths. E.g. -p app
would look for HEAD:app/Cargo.lock and app/Cargo.lock. Env: CARGO_LOCKDIFF_PATH
--from <fileish>
: The file, vcs ref, or vcs ref with filename to compare from. To force the use of a particular vcs, prepend it with a colon. E.g. "hg:." Env: CARGO_LOCKDIFF_FROM
--to <fileish>
: The file, vcs ref, or vcs ref with filename to compare to. To force the use of a particular vcs, prepend it with a colon. E.g. "hg:." Env: CARGO_LOCKDIFF_TO
-n, --no-links
: Include links to where possible. Env: CARGO_LOCKDIFF_NO_LINKS
("true" or "false")
--help
: Display usage information
Compare urls are best effort. Unfortunately there is no strict mapping between crate version numbers and VCS tags so the URLs are just guesses. There doesn't seem to be much consistency. Many maintainers seem to prefix their version number tags with a "v" or, for larger projects, the names of individual crates. If anyone has ideas on how to solve improve it I'd love to try some out.
Currently only Github is supported. Others will be added.