Skip to content

Conversation

@pared
Copy link
Contributor

@pared pared commented Mar 25, 2020

  • ❗ I have followed the Contributing to DVC checklist.

  • πŸ“– If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here. If the CLI API is changed, I have updated tab completion scripts.

  • ❌ I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Fixes #3386

@pared pared force-pushed the 3386_diff_dirty branch from b8f8f1a to ee92e5c Compare March 25, 2020 13:09
Comment on lines -171 to +175
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in this test is in order to actually test diff when there is no dir cache, and not intermix it with dirty repo diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a problem with deleted, because user will not be able to commit stage file when there is no output. But I presumed that its better to just log deleted instead some ambiguous warning saying "Output is deleted but stage file still exists, so you will not be able to commit current state of file".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted seems ok to me, since it's consistent with what dvc status reports for this case

file.dvc:
        changed outs:
                deleted:            file

@pared pared changed the title [WIP] diff: analyse working tree when dirty diff: analyse working tree when dirty Mar 25, 2020
@pared pared marked this pull request as ready for review March 25, 2020 13:25
@pared pared requested review from efiop and skshetry March 25, 2020 13:25
@pared pared force-pushed the 3386_diff_dirty branch from ee92e5c to 2659809 Compare March 25, 2020 13:30
@pared pared force-pushed the 3386_diff_dirty branch from 2659809 to c95432b Compare March 25, 2020 13:32
@pared pared requested a review from pmrowla March 26, 2020 15:46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted seems ok to me, since it's consistent with what dvc status reports for this case

file.dvc:
        changed outs:
                deleted:            file

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@efiop efiop merged commit eee3d76 into treeverse:master Mar 27, 2020
@jorgeorpinel
Copy link
Contributor

Hi! I don't completely understand this change but I'm pretty sure it requires some changes to the docs, right?

@efiop
Copy link
Contributor

efiop commented Mar 27, 2020

@jorgeorpinel

It defaults to comparing the current workspace and the last commit (HEAD), if arguments a_rev and b_rev are not specified.
is still relevant, we're just using actual workspace state here and not only what is recorded in the dvc-file.

This is an interesting topic whether or not we should stick to what is recorded in the dvc files or what is actually lying there (e.g. for cached files for any commit those would match, as cached files are determined by their hash in respective dvc-file, but for non-cached or git files/dirs it might be different), but in this case with dirty workspace we now clearly do the right thing.

@pared pared deleted the 3386_diff_dirty branch January 4, 2022 10:12
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

Successfully merging this pull request may close these issues.

diff: compare dirty vs committed workspace by default

4 participants