Discuss Scratch

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

I'm will migrate server from Python to Rust. Not exactly going to be a high-priority goal as of now, because I have other things to do, but I do intend to do this

Moving to diff_match_patch has been pretty smooth so far - it mostly works a whole lot better than the hodge-podge of diff logic I built myself. It is Google code after all

Last edited by ajskateboarder (Feb. 7, 2024 17:04:14)

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

The scratch-git server has been rewritten in Rust! Turns out I placed higher priority over it than anything else

Test it out over in the releases - available for Windows, Mac, and Linux

Last edited by ajskateboarder (March 14, 2024 01:42:05)

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

ajskateboarder wrote:

Moving to diff_match_patch has been pretty smooth so far - it mostly works a whole lot better than the hodge-podge of diff logic I built myself. It is Google code after all
Turns out it wasn't smooth whatsoever. I decided to craft a more elegant solution using `git diff`. Now it accounts for all edge-cases





As mentioned earlier, this is also taking advantage of scratchblocks' diff syntax to cross out/highlight blocks. I will make a more familiar mode of highlighting blocks in colors available soon (and maybe a setting to customize the color for accessibility)

Last edited by ajskateboarder (Feb. 20, 2024 21:27:55)

davidtheplatform
Scratcher
500+ posts

Integrating Git with the Scratch editor

You could outline blocks in red/green if they are removed/added
Steve0Greatness
Scratcher
1000+ posts

Integrating Git with the Scratch editor

davidtheplatform wrote:

You could outline blocks in red/green if they are removed/added
Problem: Removed blocks don't have outlines, they're crossed out.
davidtheplatform
Scratcher
500+ posts

Integrating Git with the Scratch editor

Steve0Greatness wrote:

davidtheplatform wrote:

You could outline blocks in red/green if they are removed/added
Problem: Removed blocks don't have outlines, they're crossed out.
This would be instead of crossing out the block
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Version 0.0.40 has been released - feel free to test the new UI things and report issues here or on GitHub

With this release, diffs will be shown per sprite by clicking on a button, not in a giant window as seen before. Note that the commit functionality is temporarily missing
Steve0Greatness
Scratcher
1000+ posts

Integrating Git with the Scratch editor

davidtheplatform wrote:

This would be instead of crossing out the block
This cannot be done with a simple style: the cross out is done using SVG, not CSS.

Although, it would be possible to edit the contents of the block's SVG, to use the same path as the outline.

Last edited by Steve0Greatness (March 20, 2024 03:24:31)

aspizu
Scratcher
47 posts

Integrating Git with the Scratch editor

This is really cool, I had someone use goboscript's decompiler to integrate with their git workflow, interesting.
Mr_rudy
Scratcher
100+ posts

Integrating Git with the Scratch editor

windows won't let me use it, even running as an administrator, the windows anti-virus is getting mad, normally i can tell it to allow it but it just won't let me for this, looks like a cool project though
Steve0Greatness
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Mr_rudy wrote:

windows won't let me use it, even running as an administrator, the windows anti-virus is getting mad, normally i can tell it to allow it but it just won't let me for this, looks like a cool project though
Weird. I'm able to use it. Are you using an extra anti-virus other than Windows Defender? For most use-cases defender really is enough(you probably don't need 24/7 post-military grade system scanning, unless you're working for a secret spy organization or something like that).
Even then, you should be able to add an exception to your anti-virus.
Mr_rudy
Scratcher
100+ posts

Integrating Git with the Scratch editor

Steve0Greatness wrote:

Mr_rudy wrote:

windows won't let me use it, even running as an administrator, the windows anti-virus is getting mad, normally i can tell it to allow it but it just won't let me for this, looks like a cool project though
Weird. I'm able to use it. Are you using an extra anti-virus other than Windows Defender? For most use-cases defender really is enough(you probably don't need 24/7 post-military grade system scanning, unless you're working for a secret spy organization or something like that).
Even then, you should be able to add an exception to your anti-virus.
i found out why, once while i was making a website with node.js on i had to turn on a certain setting, windows defender was messing up because of it, so i turned it off and it let me run it
(it was some weird npm thing, i don't even use npm anymore i use pnpm so it being off won't do anything)
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Mr_rudy wrote:

windows won't let me use it, even running as an administrator, the windows anti-virus is getting mad, normally i can tell it to allow it but it just won't let me for this, looks like a cool project though
I'll look into signing Windows executables when releases become more stable. Thanks!

Last edited by ajskateboarder (March 21, 2024 10:53:04)

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

The UI for diffing is basically complete (I may add line numbers lol)



In the process of making diffing more accurate (scripts will be considered different if blocks are just moved around). edit: this was fixed

There's also this weird error thrown by TurboWarp that occurs when you change the color theme - which seems to be caused by modifications on my part.. oops

https://u.cubeupload.com/ajskateboarder/sdfsdfdf.png

Last edited by ajskateboarder (March 26, 2024 23:54:28)

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Many updates
  • Commit functionality is now back, use the “Commit” button in the Git menu
  • Block modification statistics in commits are more accurate (I basically implemented a tiny project.json formatter that iterates through block stacks and creates line-based code for diffing purposes)
  • The UI now uses Van.js components instead of HTML string templates
  • TypeScript
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Here's a demo of stuff that has changed since the last one:

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Errors with empty if statements are now correctly handled. If you know of a fix for parse-sb3-blocks so blocks with empty if statements can be built/displayed right, please let me know!



Time to implement setting repo remotes so you can push your stuff online!!! (I'm not hosting a Scratch-friendly Git platform ) Once I get this done, I have practically nothing else to do with this project and it's stable yayy let's hope it doesn't die in the meantime

(I lied )

Last edited by ajskateboarder (May 11, 2024 13:41:59)

dynamicsofscratch
Scratcher
1000+ posts

Integrating Git with the Scratch editor

This needs to be integrated into Scratch as some major update to Scratch with user-friendly and kid-friendly stuff or something (because the only way to get the ST to do something is to prove it's kid-worthiness.).

Petition for ajskateboarder to make this or get people to help him on this to complete this faster and get it in Scratch
quote this with smile for yes and sad for no

Last edited by dynamicsofscratch (April 20, 2024 07:21:19)

Mr_rudy
Scratcher
100+ posts

Integrating Git with the Scratch editor

ajskateboarder wrote:

Time to implement setting repo remotes so you can push your stuff online!!! (I'm not hosting a Scratch-friendly Git platform
someone should host a gitea for this and then @ajskateboarder could intergrate it
Steve0Greatness
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Mr_rudy wrote:

someone should host a gitea for this and then @ajskateboarder could intergrate it
That'd be cool; but you should have the option to make the remote something like Codeberg or GitHub instead of that.

Powered by DjangoBB