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

copies: determine copy/rename operation by CopiesTreeDiffStream #4316

Merged
merged 6 commits into from
Aug 23, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Aug 22, 2024

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

Copy link
Member

@martinvonz martinvonz left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@fowles fowles left a comment

Choose a reason for hiding this comment

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

This is a nice improvement!

yuja added 6 commits August 23, 2024 10:12
I'm going to add some methods, and I don't want to insert them in between
the stream type and impls.
It seems a slightly better, and aligns with the local variable name in
materialized_diff_stream().
This patch adds accessor methods as I'm going to change the underlying data
types. Since entry values are consumed separately, these methods are implemented
on CopiesTreeDiffEntryPath, not on *TreeDiffEntry.
Most diff entries should have no copy sources.
Not all callers need this information, but I assumed it's relatively cheap to
look up the source path in the target tree compared to diffing.

This could be represented as Regular(_)|Copied(_, _)|Renamed(_, _), but it's
a bit weird if Copied and Renamed were separate variants. Instead, I decided
to wrap copy metadata in Option.
@yuja yuja force-pushed the push-qpqzrnsprxmr branch from 88ce7b0 to d83dc93 Compare August 23, 2024 01:19
@yuja yuja enabled auto-merge (rebase) August 23, 2024 01:19
@yuja yuja merged commit 4ffd3a3 into jj-vcs:main Aug 23, 2024
18 checks passed
@yuja yuja deleted the push-qpqzrnsprxmr branch August 23, 2024 01:29
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.

3 participants