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.
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`.
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.
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.
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.
I prefer the other names, but being able to type `{ dir, gitdir }` is
shorter and a lot less error-prone than `{ dir: repository_dir, gitdir:
git_dir }`.
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.