-
Notifications
You must be signed in to change notification settings - Fork 346
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
bluesky: copy tracing API #3510
Conversation
lib/src/backend.rs
Outdated
/// | ||
/// This can be set on write to explicitly record copies in the backend. The | ||
/// backend may discard these silently if it does not support explicit copy | ||
/// tracking (e.g. git). Backends which do support explicit copy tracking may |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place you use "copy tracking". Everywhere else is "copy trace" or "copy tracing".
You could make the purpose clearer by using "file rename", if that's what it's for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the distinction here is somewhat intentional. I rephrased it a bit to make it clearer.
In my mind, 'copy tracing' is answering the question "where was this file copied from?" which git does support in a limited capacity by inferring copies of similar content between two tree states. Copy tracking is the explicit record of "Hey vcs, remember that I copied foo.cc -> bar.cc here" which git does not support.
4acd905
to
f8a40a3
Compare
f8a40a3
to
ed4a515
Compare
Curious, what is the "bluesky" for? Seems unrelated to the rest of the PR? |
I think it's the "visionary" meaning (https://www.merriam-webster.com/dictionary/blue-sky), probably not related to https://bsky.app/ :) |
I think copy tracing is going to be complicated enough that a design doc would be useful to have. It would help figure out what design we need. It would also be good to have a document to be able to point back to when people ask about the reasoning later (or when we forget). You may have considered all of the below and incorporated it in the design already but I would still prefer to have a record of the thought process to point back to. I think we'll need to read and write copy information in at least these cases:
There might be other cases I'm forgetting. Can we handle the case where you squash a rename into some old commit and descendant commits that modify the old file get update to update the new file? Mercurial doesn't handle this case. How do we handle renamed directories? Do we support recording a directory rename (probably not)? We can probably check if all files in directory were renamed and treat that as a directory rename. When merging, that would mean that any new files in the old directory get moved to the new directory. I think that's what Mercurial does. Do we want to have flags to disable copy tracing? |
Do the other VCSs have docs for how they do it? |
I'm closing this PR in favor of #3574 instead |
Checklist
If applicable:
CHANGELOG.md