-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adjust get_selected_contents behavior #62
base: main
Are you sure you want to change the base?
Conversation
- only return selected = 'Absent' if the file actually doesn't exist (return selected = 'Present' or 'Unchanged' if it's empty) - only return unselected = 'Absent' if there is a unselected file mode change, changing the file mode to 'Absent'
I agree that the file mode is treated weirdly and interacts poorly with the rest of the context/data model But rather than extend the logic, as done in this PR, I think we should remove it and simply report a file mode transition (selected
There are already some competing designs (such as how to handle partially-committed changes in conjunction with file mode changes), which indicates that scm-record might not be able to establish an authoritative design that works for all callers. Therefore, I think that scm-record should focus on rendering the UI and leave the semantic interpretation to the caller. (In accordance with that, we should also move |
Or we can keep |
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
This uses some code from jj-vcs#4078 but has a slightly different underlying approach based on arxanas/scm-record#62 (comment).
Draft PR to enable the fix for jj #3702 and jj #3846 in jj #4078.
The logic in
get_selected_contents
generally seems really confusing to me and these changes probably don't help mitigating that. From what I can tell, it doesn't break existing tests though, neither in this repo, nor injj
(in combination with jj #4078).The main problems seem to be:
get_selected_contents
Going through the sections one-by-one makes it hard to differentiate between
Absent
andUnchanged
SelectedContents
.scm-record
handles (doesn't handle) file mode changesI feel like the client shouldn't be responsible for manually adding FileMode sections at all. Ideally this part wouldn't be exposed at all, but just be handled by
scm-record
internally.