Git inside the sandbox
In a sandboxed chat Haruno can look at your repository and make local commits with a short list of git commands. Anything that needs the network is refused.
- Mac appAvailableThe Mac's isolated space has the full git program.
- Windows appAvailable
Git is a tool that keeps the history of a folder of files. People who work with code use it all the time. In a sandboxed chat, Haruno can use git on your repository, with a short list of allowed commands.
When it works
Git works when the chat's folder is the top level of a repository: the folder that holds the repository's own .git folder.
It does not work, and Haruno says so, in these cases:
- the chat is opened on a sub-folder of a repository;
- the chat is opened on a folder that contains one or more repositories;
- the chat has no folder of its own.
Then every git command is refused with fatal: this chat's folder is not the top level of a git repository, and git in this chat cannot create or open another one. The fix is to open the chat on the repository's top folder.
What Haruno can do
| Kind of task | Commands |
|---|---|
| Look at the history and the changes | status, log, show, diff, blame, grep, describe, shortlog, ls-files, ls-tree, cat-file, rev-parse, rev-list |
| Branches and tags | branch, tag, switch, checkout, merge, revert, cherry-pick |
| Make local changes | add, restore, commit, reset, stash, mv, rm, clean, apply |
| Read settings | config (reading a value only), remote (reading remotes only), worktree list, version |
A few are limited. stash show is not available, and Haruno uses git diff stash@{0} instead.
A commit uses the name and email already set for that repository, or on your PC. Haruno reads them when the chat starts. Changing them during the chat does not change who the commits belong to.
What it cannot do
- Anything that needs a network.
fetch,pull,push,cloneandsubmoduleare refused with fatal: this chat has no network, so git cannot reach a remote. Sending commits to a remote is something you do yourself. - Start a new repository.
git initis refused. Haruno also cannot point git at another repository. - Interactive commands, such as
rebaseandbisect. There is nobody at a keyboard to answer them. - Things that run other programs. Repository hooks, aliases, editors, signing programs and external diff tools do not run. A command that depends on one behaves differently from your terminal.
If git is missing for a chat, the chat starts without it. A git command then answers git: this chat runs in an isolated session and git is not available here.
Looking up an issue or a review on GitHub does not go through git. See Reading GitHub.
For everyday work, such as checking what changed and committing, git works in the chat. For anything that talks to a server, such as pushing, the customer does it themselves outside the chat.