Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radicle-surf: support options in diff function #40

Closed
keepsimple1 opened this issue Oct 26, 2022 · 4 comments
Closed

radicle-surf: support options in diff function #40

keepsimple1 opened this issue Oct 26, 2022 · 4 comments
Assignees

Comments

@keepsimple1
Copy link
Contributor

keepsimple1 commented Oct 26, 2022

  • Support diff between two revisions for a given file. One way to do it is to support different options in our diff function(s), in addition to from and to revisions.

  • Can we support binary flag check that is currently disabled?

@FintanH
Copy link
Collaborator

FintanH commented Oct 26, 2022

I'm not entirely sure if we want to support it. A diff between binary files is not really meaningful to a human 😄

@keepsimple1
Copy link
Contributor Author

  • Support diff between two revisions for a given file. One way to do it is to support different options in our diff function(s), in addition to from and to revisions.

Is there a real use case for getting a diff between two revisions for a given file? If yes, I think one option is to support filtering a Diff by a path. Does that make sense?

@FintanH
Copy link
Collaborator

FintanH commented Jan 17, 2023

  • Support diff between two revisions for a given file. One way to do it is to support different options in our diff function(s), in addition to from and to revisions.

Is there a real use case for getting a diff between two revisions for a given file? If yes, I think one option is to support filtering a Diff by a path. Does that make sense?

I dunno if there's any existing use case but I would say that it could be deemed useful. I, personally, like checking the diff between two revisions on a single file from time to time.

If yes, I think one option is to support filtering a Diff by a path. Does that make sense?

I think that could work, something like Diff::find(&self, path: &Path) -> [FileDiff](https://github.com/radicle-dev/radicle-git/blob/main/radicle-surf/src/diff.rs#L150-L163). I'd be interested in seeing how it looks defined on Repository as well, something like diff_file(&self, to: &R, from: &R, path: &Path) -> FileDiff. It might be more performant using the underlying git2 functionality.

FileDiff won't quite work though, because of not knowing what kind of changes were made, i.e. was it added, deleted, modified, copied, or moved?

This is also making me wonder if instead of Vecs should we use BTreeMap<PathBuf, _> instead. That would make lookups pretty easy :)

Some food for thought!

@keepsimple1
Copy link
Contributor Author

this is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants