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

Add separate stream item type with copy info #4300

Merged
merged 7 commits into from
Aug 19, 2024
Merged

Conversation

martinvonz
Copy link
Member

@fowles, I think this is a step on the way to making the behavior around deleted rename sources more consistent.

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

cli/src/diff_util.rs Outdated Show resolved Hide resolved
lib/src/local_working_copy.rs Show resolved Hide resolved
lib/src/local_working_copy.rs Show resolved Hide resolved
Copy/rename handling is complicated. It seems worth having a module
for it. I'm going to add more content to it next.
The support for copy tracing is already simply added to the stream
just before yielding the item, so we can easily implement it as a
stream adapter. That ensures that we use the same logic for the
iterator- and stream-based versions. More importantly, it enables
further cleanups and a simpler interface.
We now have only one caller, and it's in a different module, so it
makes more sense to move it there.
I plan to provide a richer version of `TreeDiffEntry` with copy info
(and to make `TreeDiffEntry` itself "poorer"). Most callers want to
know about copies/renames, but at least working copy implementations
probably don't. This patch adds separate `diff_stream()` and
`diff_stream_with_copies()` so we can provide the simpler interface
for callers that don't need copy info.
The goal is to have the new item type know if it represent a copy, a
rename, a deleted rename source, or a regular copy-unrelated item.
@martinvonz martinvonz enabled auto-merge (rebase) August 19, 2024 05:07
@martinvonz martinvonz merged commit 3acb89e into main Aug 19, 2024
31 checks passed
@martinvonz martinvonz deleted the push-kprmmrplmxwn branch August 19, 2024 05:16
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.

2 participants