hpi-swa / Squot

Squeak Object Tracker - Version control for arbitrary objects, currently with Git storage
Other
61 stars 29 forks source link

Postscript not persisted across commits #269

Closed tom95 closed 4 years ago

tom95 commented 4 years ago

I am on the current develop branch (a9a83be). A new commit on Squot did not keep the existing postscript. Browsing the package via "Browse edition in selected version" in my commit and its parent shows that the preamble still exists in both version. However, the postscript is only found in the parent.

The relevant branch/PR for this observation: https://github.com/hpi-swa/Squot/pull/268

Can I provide any other info or click through some debug trace while committing and watching out for something specific for example?

j4yk commented 4 years ago

First, you need to kind of know in advance that the bug will trigger... then you could put a breakpoint in PackageInfo>>captureWithSquot and step to see whether the postscript is correctly picked up and put into the SquotPackageShadow.

For the record, while I stumbled into the problem once myself, presumably caused by a regression in Monticello-ct.715, when I commit, the postscripts do not get deleted every time. So this might be another rare bug.

How fresh is your working copy of Squot? Maybe it happens shortly after initializing the working copy...

tom95 commented 4 years ago

Still a bit fuzzy on what I exactly need to do, but the following caused (PackageInfo named: 'Squot') postscript contents to be nil:

  1. Ensure that it is not nil by checking out the most recent commit on any branch
  2. Cause any change to the current branch (e.g. just update a timestamp)
  3. Switch to a different branch
  4. Switch back to the first branch

The postscript is now nil for me. I tried it with the develop branch and a branch I created from its current tip.

tom95 commented 4 years ago

So to be clear, capturing the snapshot worked correctly (for the commit at least), the postscript was indeed nil

j4yk commented 4 years ago

Ah I forgot to mention, after putting the breakpoint, you need to commit of course. ;-)

I'll look into the branch switching. Does the target branch have no, any, or the same postscript?

tom95 commented 4 years ago

The target branch points to the same commit in my test scenario, so it has an identical postscript. So it seems that switching branches with autostashing can lead to the postscript that is checked out being set to nil. It can always be fixed by first doing a new checkout on the commit that should be checked out anyways.

j4yk commented 4 years ago

Hmm I cannot reproduce this in a simple test repository/project.

I have an odd bug in my own Squot working copy that it shows most scripts as changed, pretending that I had removed double newlines in my image. I wonder if this is related.

image

But I did not manage to trigger the bug deliberately in my test repository.

j4yk commented 4 years ago

@tom95 What is your Monticello version?

j4yk commented 4 years ago

My strange diff in the Squot repository is probably because the postscript in the image has CR line endings and in the repository it has LF line endings because of the line ending normalization.

tom95 commented 4 years ago

Ah I haven't updated from trunk in about a month I believe. I will report the current version, run updates and retry tomorrow.

tom95 commented 4 years ago

Just retested on an up-to-date trunk image (Monticello.mt.723) and the current develop branch of Squot and everything looked great! So I'll close this issue now. :)

In the faulty image, I was running Monticello.eem.717