xfbs / diff.rs

Web application to render a diff between Rust crate versions. Implemented in Yew, runs fully in the browser as WebAssembly.
https://diff.rs
MIT License
86 stars 6 forks source link

Support diffing against the original repo #18

Open epage opened 5 months ago

epage commented 5 months ago

The information is usually present.

For context for the use case, see https://rust-lang.zulipchat.com/#narrow/stream/318791-t-crates-io/topic/Link.20to.20where.20the.20sources.20of.20a.20crate.20are.20located.20in.20git/near/429819690

xfbs commented 5 months ago

I can look into this, it sounds like something that could be useful.

Just for my understanding: do you mean that diff.rs should diff a released version of a crate with the commit in git?

One idea I had was to be able to diff a released version of a crate vs a specific branch. As in: compare v0.3.1 vs master. But that sounds like a slightly different use-case to the one that you are describing.

epage commented 5 months ago

Just for my understanding: do you mean that diff.rs should diff a released version of a crate with the commit in git?

Yes, particularly the commit used when publishing. On publish, cargo records

So long as the user set their repo in the metadata, we can diff against that commit. Diffing against tags and branches could also be nice; I just don't have as concrete of use cases for doing so.

xfbs commented 5 months ago

So, one way to get this done is:

epage commented 5 months ago

Yes and for

when doing the diff, have to account for the fact that the crate might live in a subfolder in the repo (in case of a cargo workspace)

the vcs info contains that path