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

Track files outside the image #228

Open
wants to merge 179 commits into
base: develop
Choose a base branch
from
Open

Conversation

LeonBein
Copy link
Contributor

@LeonBein LeonBein commented Apr 11, 2019

This squot extension allows to track changes in files outside the squot images.
This addresses the issue that file changes got lost when merging and that there was no way to select their changes.
The original code and issues can be found here, but there have already been changes made in this fork. 9ea7978 is the first commit that has been made after merging the code from my repo into the fork.

This extension is not yet ready for merging and need to be reviewed, especially to make it comply to the recent changes in squot trunk

LeonBein and others added 24 commits April 28, 2019 12:18
They would only cause confusion with the new classes for tracking files.
That test for the image store might be misleading. It actually tests
that things that are not #isLoadable are not added to the store.
.squot Outdated
@@ -1,7 +1,6 @@
OrderedDictionary {
'src\/VersionControl.package' : #SquotCypressCodeSerializer,
'src\/Pharo-compatibility.package' : #SquotCypressCodeSerializer,
'src\/FS-Core.package' : #SquotCypressCodeSerializer,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What? There seems to be something fishy here. I have yet to determine the cause.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume pulling the changes from your repository got me a somehow inconsistent image store. It also did not contain the file object at first, as I already commented. Upon committing edb0cf4 I excluded the deletion of the "tracked files" and some other stuff. But I'm not sure if that is related to the problem.

includeBlock: [each includeIn: self];
excludeBlock: [each excludeIn: self];
resetBlock: [each resetIn: self];
Copy link
Collaborator

@j4yk j4yk May 5, 2019

Choose a reason for hiding this comment

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

resetBlock: can only be sent to merge nodes currently, so you need to check whether the node actually has conflicts.

@j4yk
Copy link
Collaborator

j4yk commented May 5, 2019

Branch switching is currently broken:

  • In my image it says that I had modified the README.md etc. (which is not true btw, but maybe you do not consider the line ending normalization?).
  • When I switch to another branch, it removes the README.md from the disk working copy.
  • Later during the switch SquotFileListDiff>>createFile: fails because the README.md is missing.

image

  • It failed while assembling the snapshot of the unsaved changes:

image

  • The SquotFileListDiff looks ok (except for the wrongly detected changes):

image

This does not seem to work:

updateFile: aPath

	self 
		deleteFile: aPath;
		createFile: aPath.

Source and target seem to be the same in this case. It tries to apply the file modifications on the "modified" files themselves.

When that temporary snapshot is created, the image store must not be modified. So, the Git working copy must not be modified either, in theory.

@j4yk
Copy link
Collaborator

j4yk commented Nov 18, 2020

I was thinking about this again in the context of #130. My main issue with this contribution was that it makes the image store track files, which are obviously outside of the image. In light of #130 and with the insight that objects need not only be checked out and materialized, but also put up somewhere (in a class variable, in the Smalltalk Environment as a binding or as organization members, or in a directory...) it could make sense to refactor working copies such that each artifact can be put in a different store.

  • For unspecialized objects, the image store would still be used as before (one per working copy).
  • Unloaded artifacts could use a special "snapshot store" (one per working copy). It would simply not materialize the objects, but keep their snapshots/shadows around, like the unloaded artifacts are implemented in Support "partial checkout" in the image, without removing not-loaded objects on commit #130.
  • Packages could go into a Smalltalk Environment store (one per Environment). That would also pull dealing with Environments out of the image store.
  • And finally, some artifacts could be put into a file store. Technically it would happen like in the Git backend, but this time targeted at a local disk directory. That could be the file working copy of the git repository, if desired.

Details would need to be though about like how to determine and persist the store to be used for a particular artifact. The information would probably go into the artifact metadata (storeInfo) and the choice to not load something would be a transient property (not stored in Git). But we would need data structures and names, as well as algorithms to arrive at the correct store objects given the metadata structure.

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