Discuss Scratch

dynamicsofscratch
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Mr_rudy wrote:

(#59)

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
that's be really coolzies
Mr_rudy
Scratcher
100+ posts

Integrating Git with the Scratch editor

dynamicsofscratch wrote:

Mr_rudy wrote:

(#59)

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
that's be really coolzies
hold on im trying to do it right now, ill update you when its done









won't be self hosted + will barely have any storage but will still be cool
Mr_rudy
Scratcher
100+ posts

Integrating Git with the Scratch editor

Mr_rudy wrote:

dynamicsofscratch wrote:

Mr_rudy wrote:

(#59)

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
that's be really coolzies
hold on im trying to do it right now, ill update you when its done









won't be self hosted + will barely have any storage but will still be cool
ok i did it https://scratchgit.glitch.me/ also i made forum post https://scratch.mit.edu/discuss/topic/756111/?page=1#post-7933628

Last edited by Mr_rudy (April 21, 2024 19:43:26)

Steve0Greatness
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Mr_rudy wrote:

won't be self hosted + will barely have any storage but will still be cool
So basically: don't use it for production.
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Thanks to Steve0Greatness for uncovering bugs on Windows which are now fixed:

- Popup windows not fully closing
- Windows paths not working when making a new Git project

Also, scripts that are changed are now highlighted on save. This should make it easier to identify what was changed:



(pretend you see me clicking the Save button in the top right corner)
davidtheplatform
Scratcher
500+ posts

Integrating Git with the Scratch editor

davidtheplatform wrote:

You could outline blocks in red/green if they are removed/added

ajskateboarder wrote:

Thanks to Steve0Greatness for uncovering bugs on Windows which are now fixed:

- Popup windows not fully closing
- Windows paths not working when making a new Git project

Also, scripts that are changed are now highlighted on save. This should make it easier to identify what was changed:



(pretend you see me clicking the Save button in the top right corner)
IMO this is still better than crossing out blocks (also it seems highlighting blocks is possible?)
dynamicsofscratch
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Steve0Greatness wrote:

(#64)

Mr_rudy wrote:

won't be self hosted + will barely have any storage but will still be cool
So basically: don't use it for production.
yeah… large scale projects, be aware lol.
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

The feature mentioned on post 65 is now, for the most part, functional (try it out on release 0.0.52). Additionally, a few things have changed:

- Ctrl+S is now the hotkey to display changes (Ctrl+Shift+S can be used to save without displaying, but the changes will be remembered the next time you use Ctrl+S). I'm not sure if MacOS lets you use Command+S though (if anyone could test… )

- JSX was removed entirely from the project since it made the build process much more annoying and it for some reason didn't let me apply inline styles (I didn't migrate everything to JSX anyways)

Last edited by ajskateboarder (April 22, 2024 23:35:02)

dynamicsofscratch
Scratcher
1000+ posts

Integrating Git with the Scratch editor

bump
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

v0.0.55

- Diffed scripts can now be jumped to in the editor (the editor will “teleport” to the script and flash it a few times, just like TurboWarp's find block feature)



- Scripts with empty if statements can now be viewed correctly without errors
- Block diffs now have expanded context, which also avoids cases where scratchblocks creates these “end” blocks (I have plans to make this configurable)
- Settings to configure highlights and plain text on diffs are now bound to localStorage (meaning your settings will be remembered)
- The “Don't show again” checkbox on the welcome dialog has been removed (it was useless)
- The close button for the diff dialog has been relocated to the the top of the modal
- The CSS for active tabs has been fixed

Last edited by ajskateboarder (April 28, 2024 23:11:22)

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Steve0Greatness is currently facing an issue with making commits. Is anyone else able to reproduce this?
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

ajskateboarder wrote:

Steve0Greatness is currently facing an issue with making commits. Is anyone else able to reproduce this?
Bump on this

- There is now a copy button for diffed scripts in both image and text form
- A tiny regression-caused bug that failed to display removed scripts in diffs is now fixed
- A bug that caused unnecessary commits to be made (eg. “Sprite: +4, -4 blocks” when said Sprite wasn't modified at all) is now fixed
- A logo has been made (inspired by TurboWarp)

I'm also working on localization
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

Pushing to any Git remote is almost done. Basically you enter settings here:



And hitting the Push button from the Git menu will send it off to the remote on the main branch. Authentication will likely be a simple process for remotes other than GitHub (like scratchgit.glitch.me) since they accept using a username and password to push to the repository, but GitHub requires either using a personal access token or authentication with an app.. the latter is probably the neater solution for GitHub tbh

edit: I figured out the pushing part, but I was reminded of pulling changes from upstream, so now I'm going to finish that Essentially, when you pull from upstream, it should update the repo JSON as well as the actual project you opened in the editor (done!!! –rebase is very cool)

note: GitHub authentication will require a small server rewrite since the server has been written to follow a request-response layout like HTTP, but GitHub auth would require sending two messages (one for device code and another for auth success)

Last edited by ajskateboarder (May 17, 2024 15:46:26)

ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

removed

Last edited by ajskateboarder (May 15, 2024 23:45:45)

dynamicsofscratch
Scratcher
1000+ posts

Integrating Git with the Scratch editor

bump
dynamicsofscratch
Scratcher
1000+ posts

Integrating Git with the Scratch editor

bump
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

- Pushing, pulling, and authentication for GitHub is supported. Make sure to install the GitHub app beforehand: https://github.com/apps/scratch-git-bot
- Localization is supported. Language PRs are welcome as of now, but note you'll have to send in PRs as more things are added. Thanks to mybearworld for German translations and josueart for Spanish translations!!
dynamicsofscratch
Scratcher
1000+ posts

Integrating Git with the Scratch editor

ajskateboarder wrote:

(#77)
- Pushing, pulling, and authentication for GitHub is supported. Make sure to install the GitHub app beforehand: https://github.com/apps/scratch-git-bot
- Localization is supported. Language PRs are welcome as of now, but note you'll have to send in PRs as more things are added. Thanks to mybearworld for German translations and josueart for Spanish translations!!
How to give translations?
ajskateboarder
Scratcher
1000+ posts

Integrating Git with the Scratch editor

dynamicsofscratch wrote:

ajskateboarder wrote:

(#77)
- Pushing, pulling, and authentication for GitHub is supported. Make sure to install the GitHub app beforehand: https://github.com/apps/scratch-git-bot
- Localization is supported. Language PRs are welcome as of now, but note you'll have to send in PRs as more things are added. Thanks to mybearworld for German translations and josueart for Spanish translations!!
How to give translations?
Fork the repo, copy the en.json, change the file name to be some other locale, and translate stuff to that locale

Last edited by ajskateboarder (May 20, 2024 10:19:50)

errplane
Scratcher
58 posts

Integrating Git with the Scratch editor

ajskateboarder wrote:

(#77)
- Pushing, pulling, and authentication for GitHub is supported. Make sure to install the GitHub app beforehand: https://github.com/apps/scratch-git-bot
- Localization is supported. Language PRs are welcome as of now, but note you'll have to send in PRs as more things are added. Thanks to mybearworld for German translations and josueart for Spanish translations!!
“scratch.git bot is a private GitHub App.”

Powered by DjangoBB