PuzzleScriptPlus icon indicating copy to clipboard operation
PuzzleScriptPlus copied to clipboard

Get latest changes from Increpare

Open Auroriax opened this issue 2 years ago • 24 comments

https://groups.google.com/g/puzzlescript/c/pLY3PXjA9Gw

No big major changes but mostly just Quality of Life stuff. There's some fun stuff like the double ellipses though! Probably still a lot of work to merge it all, sadly...

Auroriax avatar Apr 17 '22 22:04 Auroriax

Will probably start to slowly start chipping away on this. At moment of writing, the latest increpare commit merged into PS+ is f3655f2 - Merge branch 'master' of https://github.com/increpare/PuzzleScript.

Also clean Git history while I'm at it, because that thing is getting very very messy with all these incremental merges.

Auroriax avatar Sep 28 '22 20:09 Auroriax

Probably a good idea to target a08d7b4 - new unit test, censored another to make it SFW first, since the date of that commit corresponds to the date the changelog was posted

Auroriax avatar Sep 28 '22 20:09 Auroriax

I took a look at imerge. The idea is great, but it looks a bit clunky now compared to some of the other tools, including VS Code. Have you tried anything others?

david-pfx avatar Feb 23 '23 02:02 david-pfx

I tried to find something more efficient from imerge, but I got the feeling that git is not really intended to resolve merges that are as divergent as this, so I assumed there was no easier way. (Might be that a new tool for this has popped up in the last year or two, though!)

As for merges, generally I want PS+ to be a subset of PS where-ever possible, which means that everything from PS should be kept as far as is reasonably possible.

  • Documentation: Merge, keep both the PS and PS+ bits.
  • Demos: Merge, keep both the PS and PS+ bits.
  • Gallery: I've overwritten the games_dat file for a PS+ specific gallery. So you should use the games_dat file from PS+. I'm still keeping the images from the old gallery, so you can just leave them (or move them to the correct folder).
  • You should be able to use testdata.js from vanilla PS. Some tests will break because of capitalization changes, you should be able to identify these easily and fix the capitalization in the test data (see #31 for more info on this). Any PS+ tests are in a different file and should not be affected.
  • Some files will pop up as added/removed because all folders used to be in the top level folder, before all being moved to the src/ folder in PS v1.7. It's annoying but I haven't found a way to fix it.
  • JS and CSS will be tricky because sometimes Stephen and I make different decisions. For now refrain from changing anything that isn't a pure merge. If this is not possible, please note which decision and changes you made.

I'd recommend to use imerge and then merge not the entire branch at once, but pick a commit like around ten commits upstream (ideally one you know that's stable, such as a bugfix or vanilla PS release), then test it in the browser once the imerge is completed. This should help you safely merge the thing while still being able to test it regularly.

Please work towards merging the vanilla PS releases and make PRs for each of those once you reach them. Or if you get stumped somewhere, submit your progress up to that point as a PR. This will also help me validate if the merge was performed correctly. See #23 for a good first release to merge towards.

There are instructions in the readme for how to contribute to PS+ if you already have a fork of vanilla PS. 😄

Auroriax avatar Feb 24 '23 10:02 Auroriax

Surely PS+ should be a superset: all of PS plus extras? Did you mean downstream? Latest increpare merge is 28/9/21; 8 checkins downstream from there is all of Jan 21, then there's like 20+ checkins a month ending up on 17/3, then a gap and only a few more to the present time. There are heaps of changes to games_dat.js. You want to just ignore those? Really? Demos: there are no 'PS+ bits' that I can find, just lots of incoming changes and random white space differences. Trivial merge. Perhaps the PR notes should be in 'develop', I didn't notice them in readme. Will do.

david-pfx avatar Feb 24 '23 12:02 david-pfx

Can someone please tell me what goes with strict mode? Compiler.js is strict mode and parser.js is (mostly) not. Why?

david-pfx avatar Feb 25 '23 05:02 david-pfx

OK, I have a working merge up to 23/2/22. Apart from a couple of minor issues there are two big problems: the gallery won't merge and the test cases won't merge. It's likely possible to force fit them but the exact same problem will arise on the next merge. That looks like an ongoing wasted of time, to no good purpose. My proposal is to use the PS gallery and PS test cases and get it all working. Then add back the PS+ gallery and PS+ specific test cases but keep them separate, in their own files/folders. There will be pain around case-insensitive, but I can fix that too. The end result will function as now, maintain a near-perfect level of superset compatibility with PS, but merge more easily in future.

david-pfx avatar Feb 26 '23 01:02 david-pfx

It now seems that the legend and sounds sections in parser.js will not merge. Did someone rewrite them? The PS versions look like they've had a lot of work.

Is there any reason not to just use the PS version? Does PS+ need anything special in those sections?

david-pfx avatar Feb 26 '23 07:02 david-pfx

Before you continue, could you submit what you have as a (draft) PR? I want to take a look at the issues and questions you're having. In hindsight I kinda feel like I threw you into the deep end, it would probably be better if I took over the merge from this point as you seem to be running into a lot of difficult issues.

What kind of approach to merging are you using? imerge or something else?

I don't know the answers your other questions, sadly. Sorry!

Auroriax avatar Feb 26 '23 21:02 Auroriax

I'm happy playing in the deep end a bit longer before you send in the lifeguards. It's where I mostly hang out.😁 I'm doing a partial merge up to 23 Feb. From what I read of imerge it somewhat automates the easy bits and won't help with the hard bits. In any case I need to improve my skills on Git merges. FYI my main tools are VS Code, TortoiseGit and BeyondCompare. As I said, I don't think it's feasible (or desirable) to merge the gallery or test cases. The PS+ ones need to be kept somewhat separate and I would like to discuss how to do that. It seems Stephen made bigger and deeper changes to the parser than we realised, and that has a big effect on tests that target error messages. I can do the parser merge and get all the PS tests passing, but I badly need PS+ specific tests for each of the features listed in the readme (not the ones created by contamination with case insensitive).

david-pfx avatar Feb 26 '23 23:02 david-pfx

I have a working merge of Increpare 4d9d5 23-feb-22, which passes all PS tests. I do not currently have any PS+ tests. The code still has some place markers, to be resolved during the next merge(s).

The code is in https://github.com/david-pfx/PuzzleScriptNext on branch master. I have not been able to create a PR, using the instructions in the README. Please advise.

david-pfx avatar Mar 01 '23 04:03 david-pfx

Your repo doesn't seem to be a fork of anything at the moment (as it's not displaying the forked from increpare/PuzzleScript text in the top), so likely you don't get an option to make a PR. If you do that you should be able to make PRs to there and here. (I'm not sure you can do this if the repository already exists?) Then you should be able to pull a branch from this fork locally, work there, and make a PR here. I can try to give a more detailed explanation if you need it.

I believe there's a hacky way to get around it and create an organization, and fork from there. Which might be easier in your situation.

I'll pick up the extra tests as part of #31, see my last comment there for more info

Auroriax avatar Mar 01 '23 18:03 Auroriax

My local repo is a clone of PS+, with an imported branch for PS, from which I merge onto a tomerge branch and then onto master. I now have 3 working merges, covering most of the older PS stuff. But the problem is how to turn that into a PR.

I can't do a fork of PS+ on GitHub because I already have a fork of PS (which I plan to keep). I thought the instructions in the README were supposed to deal with this but (a) I don't find them very clear and (b) everything I tried doesn't work. I can't push directly to PS+, and although GitHub seems to support doing PRs from one user to another I can't get it to work. Maybe this is something GitHub cannot do?

It should be possible to create a PR locally using TortoiseGit, but I'm having trouble with that too. It just hangs.

Any suggestions welcome.

david-pfx avatar Mar 02 '23 00:03 david-pfx

I have now merged changes up to and including 7-mar-22. I have pushed the merge to my repo commit a62511640b9a87dc91ba0509e1b2688c08dbe583. It passes all PS tests. I expect it to fail some PS+ tests, particularly those related to case sensitive, but I have none. When they are available, I'll fix those too.

I don't think it's possible for me to create a PR on GitHub. In principle I should be able to create one locally but so far it doesn't work. I can fix the code, but mastery of Git is another thing entirely.😁

david-pfx avatar Mar 04 '23 09:03 david-pfx

Progress report: all Increpare changes merged. All new PS+ tests merged. All the tests pass and everything is working except:

  1. Case insensitive is broken by the new changes, so Kye fails. Badly, because the code is really fragile. Working on it.
  2. The Node compile is still outstanding.

david-pfx avatar Mar 05 '23 06:03 david-pfx

Actually that's not quite right: Sorting of Sorts fails too. I missed it because it was dying quietly (problem with the test harness). Can you please provide source code for these two games, that you turned into test cases? They're hard to debug without.

david-pfx avatar Mar 05 '23 08:03 david-pfx

Right, so regarding the fork, you have two options.

Note that you can't turn a repo into a fork after creating it (Source: https://stackoverflow.com/a/56086243 ). If you still want this, you might be able to migrate the git history or something. If you want to create a PR then both repos need to be connected to the same project (e.g. the lack of the "forked from increpare/PuzzleScript" text on the project you linked is likely what is preventing you from creating a PR).

New branch in existing fork

In your existing repository for PuzzleScript, add PS+ as an origin and then pull a PS+ branch.

  1. On your local copy of vanilla PS, add PS+ as an origin. (In the screenshot I'm using your repo as example. Screenshot was made with Fork, but other GUIs should be similar) afbeelding
  2. Fetch, then pull a PS+ branch.
  3. Start working on the branch (or create a new branch first). Once you make a commit and push the branch, you should have the option to create a PR on GitHub.

Create an organization and fork there

If you don't want to add a branch in your existing repository, you can also create an organization and set up a fork there. https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations. Then you should be able to press the Fork button and create the fork in the organization.

You should be able to find hack links for all games in the test cases via either the examples, the PS+ gallery, and my itch.io pages (see e.g. https://itch.io/c/1609485/made-with-puzzlescript-plus)

Auroriax avatar Mar 05 '23 20:03 Auroriax

Thank you, that worked. I pulled your develop branch, merged my changes onto it, pushed it to GitHub and created a PR on that (which I hope meets your needs). Please note:

  • this set of changes has a small number of comments and debugging code that may need further attention.
  • the build is yet to be done, due to issues with the Node setup. Working on it.

david-pfx avatar Mar 06 '23 02:03 david-pfx

I don't see any PRs coming in yet. Have you made sure to target Auroriax:develop?

Auroriax avatar Mar 09 '23 21:03 Auroriax

I guess that would explain why I haven't heard from you.😀 This is the PR: https://github.com/david-pfx/PuzzleScriptNext/pull/1. If I've missed a step in getting it to you, please tell me what that is.

david-pfx avatar Mar 09 '23 23:03 david-pfx

I'm still not seeing it come in here. Please consider reading up on PR documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request, "Further Reading" links on that page, other PRs on this repo, etc.

Auroriax avatar Mar 14 '23 20:03 Auroriax

This is getting frustrating. I've already done everything on that page (that I am allowed to do). I have created the PR. I have posted the link in this issue. I do not have the rights to link the PR to the issue, if that's what's needed. So please explain: what does it mean to "come in here"? Where is "here"? Which specific part of the voluminous GitHub help tells me how to find the missing step between creating the PR and putting it in the right place for you to see it?

david-pfx avatar Mar 14 '23 23:03 david-pfx

Sorry it's taken so long, but I finally figured out the rules. With a little help from my son.😁

pr-plus-#23 submitted.

david-pfx avatar Mar 18 '23 05:03 david-pfx

PR submitted but not yet acted on. Not much more I can do.

Meanwhile see https://github.com/david-pfx/PuzzleScriptNext and https://david-pfx.github.io/PuzzleScriptNext/src/editor.html for a working version with all changes merge.

david-pfx avatar Apr 25 '23 03:04 david-pfx