diff.rs icon indicating copy to clipboard operation
diff.rs copied to clipboard

Support diffing across crates

Open epage opened this issue 2 years ago • 2 comments

Someone pointed out a fork of clap called palc and I wanted to diff it against clap to see if anything changed, whether for good or ill intent.

I could do this myself but I thought it might be useful to support this more generally in diff.rs

epage avatar Mar 22 '23 22:03 epage

Hey Ed,

that's a really interesting idea, I had not thought of that usecase before. I think that makes a lot of sense actually, I've come across a lot of forks of crates on crates.io. Sometimes they are just patching something or adding new functionality, but they could also be malicious or namesquatting.

I think this would be very trivial to implement per se, although the UI would possibly have to change a bit. From the diffing perspective, we could add a route such as:

/crate_a/version_a/crate_b/version_b/filename

From the diffing logic's perspective, it doesn't really care if the CrateSources come from the same crate, so this would be fine.

We would however need to tweak the UI so that you can enter multiple crate names. Should not be too hard.

I could probably draft something up on the weekend and create a pull request with a screenshot.

Thank you for coming up with this idea!

xfbs avatar Mar 22 '23 22:03 xfbs

I'm going to work on this today. My idea is to change the routing so that you can do:

diff.rs/crate_a/0.1.0/crate_b/0.1.0

I'm not sure I'll get around to putting in a proper UI for this (although it should not be too hard).

xfbs avatar Mar 31 '24 13:03 xfbs