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

Get diff / patch list from commit #1838

Open
Pandapip1 opened this issue Oct 30, 2023 · 6 comments
Open

Get diff / patch list from commit #1838

Pandapip1 opened this issue Oct 30, 2023 · 6 comments

Comments

@Pandapip1
Copy link

Pretty simple: a command that generates a list of diffs and/or patches, a la nodegit's commit.getDiff() or diff.patches().

@Pandapip1
Copy link
Author

FYI - I've seen #1754. This is different, since it also contains data on which files were moved to where, deleted, etc...

@jcubic
Copy link
Contributor

jcubic commented Oct 30, 2023

diff is out of scope for this library. But if you want you can implement something like this and share it with others.

@Pandapip1
Copy link
Author

diff is out of scope for this library. But if you want you can implement something like this and share it with others.

What is the scope of this library, exactly? To me, this seems like the closest thing to a scope this project has:

isomorphic-git is a pure JavaScript reimplementation of git that works in both Node.js and browser JavaScript environments. It can read and write to git repositories, fetch from and push to git remotes (such as GitHub), all without any native C++ module dependencies.

As this project currently stands, it is not a suitable replacement for a library like nodegit because there's simply data that's not exposed by the current API.

@jcubic
Copy link
Contributor

jcubic commented Nov 8, 2023

There are whole libraries whose only purpose is to create diff between files. So I don't see a reason to add diff to this library. You can use jsDiff to implement the patches, you don't even need to do anything in isomorphic-git itself. You can just write the code in user space.

@Pandapip1
Copy link
Author

See my follow-up comment:

FYI - I've seen #1754. This is different, since it also contains data on which files were moved to where, deleted, etc...

I'm asking for the data that git itself provides about things like "which files were created, modified, or deleted" in any given commit!

@jcubic
Copy link
Contributor

jcubic commented Nov 10, 2023

Oh, you have statusMatrix that does this.

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