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

kart diff between commits without working copy errors #666

Closed
rcoup opened this issue Jul 6, 2022 · 1 comment · Fixed by #669
Closed

kart diff between commits without working copy errors #666

rcoup opened this issue Jul 6, 2022 · 1 comment · Fixed by #669
Labels
bug Something isn't working

Comments

@rcoup
Copy link
Member

rcoup commented Jul 6, 2022

Describe the bug

kart diff errors in some situations without a working copy, even when the diff doesn't involve one.

To Reproduce

$ kart clone --no-checkout me@example.com/repo
$ kart diff -o json HEAD^1 HEAD
Error: Cannot generate working copy diff:
Repository has no working copy.
  (use "kart create-workingcopy")

Same occurs between any two commits/refs/trees, it's not related to HEAD specifically. Using A...B/A..B works fine, though produces different results (and .. doesn't work for trees)

Expected behaviour

Show the diff between two arbitrary commits/trees, which shouldn't relate to the working-copy.

Version Info

  • OS: macOS 12.2.1
  • Version: v0.11.4.dev0 @ 97ef458
@rcoup rcoup added the bug Something isn't working label Jul 6, 2022
@olsen232
Copy link
Collaborator

olsen232 commented Jul 7, 2022

I think we only support COMMIT..COMMIT and COMMIT...COMMIT for specifying a commit range.
If you supply them as two args I think it parses it as COMMIT PATHSPEC.

But yeah we should support both for consistency with git - although git always supports so many weird things

olsen232 added a commit that referenced this issue Jul 7, 2022
olsen232 added a commit that referenced this issue Jul 7, 2022
Support `kart diff COMMIT1 COMMIT2` [#666]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants