-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Git client part 2: HTTP #418
Conversation
f991278
to
c8c9901
Compare
|
29845e2
to
b48f3ca
Compare
f64f482
to
6abae0a
Compare
6abae0a
to
4961b4c
Compare
Marking this as ready, so people have a chance to ask for changes! 😅 There's more I'd like to do, particularly making commit references like
|
Can't wait to merge this 💙 |
Parsing |
Create, delete, copy, rename, and list branches.
Sporadically we hang while trying to fetch. I haven't been able to identify why but it seems like a race condition in isomorphic-git somewhere.
This is functionally the same, but removes one place where we unnecessarily relied on Puter code.
We'll likely want to host our own proxy. Self-hosters likewise may have their own, but it's convenient to use isomorphic-git's for development.
For now, the authentication is by --username and --password options, which obviously is not good because the password is visible. But doing it in a nicer way requires features that Phoenix or Puter are currently missing.
These allow the user to force color on or off. The chalk library is used for the output, because it's already used elsewhere in Puter and seems like a good choice. Ideally, the default will be based on whether stdout is a tty, but Puter doesn't yet have that concept, so we just default to color.
Previously, this: ```sh > rm deleted.txt > git add deleted.txt ``` ...would unhelpfully complain that deleted.txt cannot be found. Now, it records the deleted file to the index, just as canonical git does.
Make some parts colored or bold, and indent commit messages.
Specifically, we previously didn't resolve short commit hashes into the full ones. These functions provide a single place to later add more ways of selection a commit, such as `HEAD~1`.
I tried implementing --source=foo too, but was bumping into weird behaviour with isomorphic-git, so I've removed that for now. Eventually we'll want it, but it seems fairly niche.
Matching canonical git, staged changes are green and unstaged/untracked are red.
This is quite manual, and only handles the simple cases where no merge conflicts occur. Should be useful for basing a `rebase` command off of though.
I ended up removing the debugging code that used this, but it seems useful anyway for future debug logs.
Until now we just relied on it being very unlikely that there would be a collision. This new method ensures that the returned hash is unique.
Parsely was missed by fa7bec3 because it got merged afterwards.
There are a lot of ways of specifying a revision, but these are a couple of common ones.
0e83d97
to
cbbb988
Compare
cbbb988
to
1673ad7
Compare
Initially this was just about HTTP but it's ended up being many things. Enjoy!
New commands:
git clone
git remote
git branch
git fetch
git pull
git push
git checkout
git diff
git restore
git cherry-pick
Other noteworthy features: