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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a git client #408

Merged
merged 16 commits into from
May 28, 2024
Merged

Add a git client #408

merged 16 commits into from
May 28, 2024

Conversation

AtkinsSJ
Copy link
Collaborator

@AtkinsSJ AtkinsSJ commented May 17, 2024

Builds on #413.

A git app, that can be run inside Puter's terminal.

This is limited to the following commands, which are all implemented to some extent:

  • git help
  • git version
  • git init
  • git status
  • git add
  • git commit
  • git log
  • git config
  • git show

It still lacks:

  • Branches
  • Tags
  • Anything that interacts with a remote server (eg cloning, pulling, or pushing)
  • Rebasing
  • Stashes
  • A lot of functionality with those implemented commands. To say that git is very configurable is an understatement. 馃槄

@lucasgames8957
Copy link

Cant wait... I want it, I want it, I want it, I want it, I want it, I want it, I want it, I want it, I want it, I want it, I want it, I want it, I want it, I want it,, I want it, I JUST WANT IT

@triptych
Copy link

Yes, this is by far my number 1 request for puter.

@AtkinsSJ AtkinsSJ force-pushed the git-client branch 2 times, most recently from 4ac9fe1 to 686eacd Compare May 21, 2024 15:51
The in-progress git client also needs to use this. puter-js-common uses
commonjs modules, so it had to be adjusted for that.
Specifically, this makes the Puter->PosixError conversion available to
the in-progress git client.
This matches the behaviour of Node.JS's errors, and some libraries
expect it.
It does nothing but output a message to the console.
@AtkinsSJ AtkinsSJ force-pushed the git-client branch 2 times, most recently from 90426ed to 28f72cd Compare May 22, 2024 12:12
Each subcommand is its own file, modeled after Phoenix's coreutils.
This is quite barebones for now.

Commit formatting is done in a separate file, as this is used by other
git commands, such as `show`.
This is also basic:

git config key             # To read a value
git config key value       # To set a value
git config --unset key     # To delete a value

As noted, --list is not possible to implement currently.
@AtkinsSJ AtkinsSJ mentioned this pull request May 22, 2024
8 tasks
@AtkinsSJ AtkinsSJ marked this pull request as ready for review May 22, 2024 15:06
@AtkinsSJ
Copy link
Collaborator Author

AtkinsSJ commented May 22, 2024

I think this is in a decent enough state to be worth reviewing.

A couple of things that have come up:

  • It'd be nice to have a better API for stdin/stdout/stderr, that just take strings, and all the encoding is kept internal
  • Passing an exit code to puter.exit() would be convenient - Add exit status codes to puter.exit(), and an exit builtin to Phoenix聽#421
  • Being able to launch a background app from the start menu is a bit odd. For git, I don't think you can usefully do anything, but for some console apps like a python interpreter, you'd want a way of forcing it to have a parent terminal and shell.

There's some further work in #418 but CORS is not my friend so that has not gone anywhere yet.

@KernelDeimos KernelDeimos merged commit c495ccf into HeyPuter:main May 28, 2024
6 checks passed
@AtkinsSJ AtkinsSJ deleted the git-client branch May 28, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants