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

Postscript not persisted across commits #269

Closed
tom95 opened this issue Jun 7, 2020 · 10 comments
Closed

Postscript not persisted across commits #269

tom95 opened this issue Jun 7, 2020 · 10 comments

Comments

@tom95
Copy link
Collaborator

tom95 commented Jun 7, 2020

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: #268

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

@j4yk
Copy link
Collaborator

j4yk commented Jun 7, 2020

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
Copy link
Collaborator Author

tom95 commented Jun 8, 2020

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
Copy link
Collaborator Author

tom95 commented Jun 8, 2020

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

@j4yk
Copy link
Collaborator

j4yk commented Jun 8, 2020

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
Copy link
Collaborator Author

tom95 commented Jun 8, 2020

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
Copy link
Collaborator

j4yk commented Jun 8, 2020

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
Copy link
Collaborator

j4yk commented Jun 8, 2020

@tom95 What is your Monticello version?

@j4yk
Copy link
Collaborator

j4yk commented Jun 8, 2020

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
Copy link
Collaborator Author

tom95 commented Jun 8, 2020

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
Copy link
Collaborator Author

tom95 commented Jun 14, 2020

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

@tom95 tom95 closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants