GitoxideLabs / gitoxide

An idiomatic, lean, fast & safe pure Rust implementation of Git
Apache License 2.0
8.91k stars 303 forks source link

Add `gix diff` to CLI #1625

Open cruessler opened 18 hours ago

cruessler commented 18 hours ago

Summary 💡

I found that there is no gix diff yet, but I think it would be very useful in the context of developing gix blame. I searched the issue list, but as far as I could tell, there was no issue related to gix diff yet. I’d like to start working on adding gix diff if it isn’t on anyone’s todo list yet.

Motivation 🔦

No response

Byron commented 18 hours ago

That's a great idea and I welcome you to implement it in a first version, suitable to help with gix blame.

I may add that we should probably follow the command-hierarchy laid out by gix merge, so what you probably want to implement is gix diff tree. It can be passed two trees as rev-spec and will produce some sort of visual diff.

And indeed, the reason it's not implemented yet was that it's purely in gitoxide-core with some work needed to get the visualization nice enough to be useful.

Since it's directly motivated to help with gix blame, I think it's fair to make it so - or in other words, there is no need to try to adhere to what Git does when diffing trees.