https://github.com/your-tools/lockdiff
Simplify looking at diffs for lock files, such as Cargo.lock or poetry.lock
https://github.com/your-tools/lockdiff
Last synced: 11 months ago
JSON representation
Simplify looking at diffs for lock files, such as Cargo.lock or poetry.lock
- Host: GitHub
- URL: https://github.com/your-tools/lockdiff
- Owner: your-tools
- License: mit
- Created: 2022-06-22T16:13:47.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-11T14:39:46.000Z (about 1 year ago)
- Last Synced: 2025-06-29T13:42:16.993Z (12 months ago)
- Language: Rust
- Size: 96.7 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Lockdiff
Convert a lock with lots of info to something more readable
For instance:
```toml
[[package]]
name = "foo"
version = "1.4"
```
becomes:
```
foo (1.4)
```
# Using lockdiff with git
The primary purpose of this tool is to hide "noise" related to package changes
in automatically generated files such as `Cargo.lock` when using with `git diff`
and related commands.
For this to work, you need to register the 'lockdiff' as a text converter
in your git config (usually `~/.config/git/config`)
```ini
[diff "lockdiff"]
textconv = lockdiff
```
and then tell `git` to use `lockdiff` when diffing files, in `~/.config/git/attributes`:
```
Cargo.lock diff=lockdiff
```
Note: in case of `requirements.txt`, you may want to put the config in `.git/info/attributes`
because sometimes the `requirements.txt` is maintained by hand and not generated by a tool like `pip-compile`.
# Supported locks
* `Cargo.lock`
* `Gemfile.lock`
* `composer.lock`
* `go.sum`
* `package-lock.json`
* `poetry.lock`
* `pubspec.lock`
* `shard.lock`
* `yarn.lock`
* `requirements.txt` and similar (the file name must contain `requirements` and end with `.txt`, like in `dev-requirements.txt`)