-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
porcelain diff does not support uncommitted changes #1153
Comments
ISn't this a dupe of #1147? |
the page you linked says 404 for me |
On Tue, Mar 07, 2023 at 01:47:41PM -0800, Steven Penny wrote:
the page you linked says 404 for me
Ah, I've got an email that says you created a similar bug (with id
#1147) in February. Did you delete that by any chance?
|
If you look at how Dulwich's diff works, you can see that unlike Git's diff it can only compare commits, not uncommitted changes. Since the repo in your example doesn't contain any commit, Dulwich throws an error. Lines 172 to 184 in 06337ba
|
FWIW dulwich.cli is by no means compatible with C Git at the moment. Very happy to merge PRs that address this sort of issue and make it behave more like C Git. |
Hey there, trying to catch up here...I got some questions. (btw, thanks for the this library it's pure 🔥)
|
I don't believe anybody has worked on this recently; I definitely haven't. PRs very welcome :)
There's lots of ways of interacting with git; personally I don't have a use for diffs, for example.
It's probably quite a different codepath from what exists in the diff implementation today. Today, everything is based on existing Git objects and walking merkle trees. For diffing an an uncommitted tree, you'd probably want to either create those objects on the fly or (more efficient) compare them directly against what's in the repository. It might make most sense to just create a separate porcelain_diff_worktree or something like that, rather than adding support to the existing code. Let me know if I can provide more pointers. |
I can create a new repo with Git,
git add
a change, then add another change, andgit diff
the index with worktree:but Dulwich fails on the diff:
The text was updated successfully, but these errors were encountered: