git.info¶
git.info describes the git repository that holds a folder. It answers the top folder of the repository, the current branch, the GitHub name of the origin remote and the default branch of origin. It also reports the state of the daemon's settings copy. The method changes nothing in the repository and fetches nothing.
An untagged rule on this page matches build 5fd08069 or an earlier build. The rules of Request, Response, What changes on disk, The branch, repoSlug and defaultBranch, and the Linux and macOS part of The root, are measured, but the system was not recorded. A linked Errors row carries the system marks of its section. The measured cells behind each rule are in the tests and in the reference build history.
Request¶
| Parameter | Required | Meaning |
|---|---|---|
path |
no | A folder of the repository. A subfolder gives the same root. Without path, the daemon answers for its own working directory. Path handling has the rules for a leading ~. |
shadowDirOff |
no | true turns off the daemon's own read of the repository's git config and its settings copy for this request. See Turning the read off. |
sessionFoldersOff |
no | true turns off the check of session folders while the request runs. |
Response¶
For a repository:
{"isRepo": true, "repo": "repo", "branch": "main", "root": "/repo", "repoSlug": "acme/gizmo", "defaultBranch": "main", "settingsControl": "shadow"}
| Member | Meaning |
|---|---|
isRepo |
true. |
repo |
The last name of root. If that name starts with - or +, the member is left out, and the other members keep their order (measured on Linux and macOS). |
branch |
The current branch. See The branch. The member can be absent. |
root |
The absolute top folder of the repository. See The root. |
repoSlug |
owner/repo of a GitHub origin, or "". See repoSlug. |
defaultBranch |
The branch that refs/remotes/origin/HEAD names, or "". See defaultBranch. |
settingsControl |
The state of the settings copy. See settingsControl. The member can be absent. |
The members always come in this order. repoSlug and defaultBranch are always present, also as empty strings.
If the daemon finds no repository, the response is not an error:
The daemon gives this response in these cases:
pathis in no git repository.pathdoes not exist. That is not an error.- The repository has no work tree. Examples are a bare repository and a
pathinside a.gitfolder (measured on Linux and macOS). - The request has no
"shadowDirOff":true, and the daemon finds nogiton itsPATHand none that it uses on the login shell's PATH (the git of the login shell's PATH). It then starts no test of the settings copy (measured on Linux). On Windows see the git in the working folder. - On Linux and macOS,
pathis a regular file. A file inside a repository goes through the checks and the settings copy of that repository. If those pass, the answer is the "no repository" body. - A
.gitfile names a gone git directory that is no registration (measured on Linux and macOS with an older git). git 2.56 gives the same, with and without"shadowDirOff":true(4c111e86, measured on Linux, macOS and Windows with git 2.56.1). - git itself does not accept the repository.
Errors¶
This method has no errorCode member. A failure is a JSON-RPC error. The texts are in the error-string catalog.
Shared refusals¶
| Code | Text | Cause |
|---|---|---|
-32602 |
Invalid params |
The request has no params member, or params or path has the wrong type. params rules. |
-32603 |
the repository's git directory could not be trusted; git not run: … |
The daemon does not trust the git directory. Git-directory trust check. |
-32603 |
config-defined hooks could not be pinned off; git not run: … |
A config listing failed or passed a limit of the hook pins, the daemon refuses its own git environment, or a daemon GIT_DIR names a gone worktree entry. A listing stopped at 30 seconds goes on with listing the configuration in force: git took too long: Claude stopped git config after 30 seconds; try again. Refusal texts and Own git environment. |
-32603 |
git cannot run on this host; git not run: … |
A config listing, a call of the start test or the call about the repository failed, and then git version failed too. A failed configuration listing, The start test and The call about the repository. |
-32603 |
this repository's git config cannot be used: … or a file in this repository's .git directory cannot be used: … |
The daemon read the git config of the repository, or a file of its git directory, and does not accept it. Repository config refusals. |
-32603 |
Claude could not test git on the remote machine (…). Check free disk space and quota there, then try again. |
The start test of the settings copy failed. The daemon keeps the failure for 10 seconds. The start test. |
-32603 |
git could not check this repository on the remote machine: … or git and Claude disagree about which repository holds this folder: … |
The call that asks git about the repository failed, did not end in 30 seconds, or named another repository. The call about the repository. |
-32603 |
Claude could not prepare its own files on the remote machine: … |
The daemon cannot prepare the folder of the settings copy, or .probe. The folders. |
Git failures¶
| Code | Text | Cause |
|---|---|---|
-32603 |
git took too long: Claude stopped git <subcommand> after 2 minutes; try again |
A git call ran 2 minutes, and the daemon stopped it. While a "shadowDirOff":true request runs, that one included, the limit is 30 minutes, and the text says so (claustrum's own, not measured). Time limits. |
A GIT_COMMON_DIR in the daemon's environment turns the git-directory trust check off for this method, except under the Windows rule.
The branch¶
- The daemon reads the branch name from git, so an unborn branch has its name. An empty repository gives the name of its initial branch, for example
master. - A detached HEAD gives
"branch":"detached:<short-sha>". - If git cannot name the branch, the member is absent. An example is a HEAD that git fails to resolve (measured on Linux). On a detached HEAD whose short name git cannot give, the member is absent too (measured on Windows). git's error text never appears in the member (measured on Linux and Windows).
The root¶
root is the folder that holds the .git folder or .git file of the repository. For a linked worktree it is the folder of the worktree.
On Linux and macOS:
rootispathwith its symbolic links resolved, then walked up to that folder.- A component that is not a symbolic link keeps its letter case and Unicode form as sent (measured on macOS).
- A symbolic link resolves before a later
..removes it. core.worktree, andGIT_DIRandGIT_WORK_TREEin the daemon's environment, do not moveroot.
On Windows:
- The daemon finds the folder the same way, and then asks git to confirm it (measured on Windows). If git names the same folder,
rootis the answer of git as printed (measured on Windows). Else it is the folder that the daemon found (measured on Windows). In both cases the separators are forward slashes (measured on Windows). - The walk starts at the real path of a path with a junction, and a
..is taken by text first (4c111e86, measured on Windows). When git confirms the folder,rootis git's spelling, which can name the target of a junction (measured on Windows). - The comparison of the two folders is by file identity (claustrum's own, not measured).
repoSlug¶
repoSlug is owner/repo from the URL of the origin remote, after any url.<base>.insteadOf rewrite of git. The daemon fills it only for a canonical github.com remote:
- The scheme must be
https,http,ssh,git, or absent. An absent scheme is the scp-like form[user@]host:owner/repo. An absent scheme also takeshost/owner/repo(claustrum's own, not measured).git+ssh://andfile://give"". - The host must equal
github.com, in any letter case.www.github.com,github.com., GitLab, Bitbucket and a self-hosted GitHub Enterprise give"". The daemon removes the user part. A port such asgithub.com:443lands in the path, sogithub.com:443/owner/repogives three segments and"". - After any trailing
/and one optional.git, the path must be exactly two segments that are not empty. More than one trailing/is claustrum's own (not measured). - The owner has letters and digits, with hyphens only inside.
ac-meandac--mepass.-acme,acme-,acme_corpandacme.codo not. - The repo has letters, digits,
.,_and-. It must not start with-, must not be.or.., and must not end in a lower-case.wiki. SoGIZMO.WIKIand a repo namedwikipass.
With no origin, repoSlug is "".
defaultBranch¶
defaultBranch is the branch that refs/remotes/origin/HEAD points to. The daemon tests the name:
- If
refs/remotes/origin/HEADis not set, the value is"". - A name that starts with
-gives"". - Else the name must name a commit at
refs/remotes/origin/<name>. A danglingorigin/HEAD, and one that names a blob, give""(measured on Linux and macOS).
The daemon fetches nothing for this member, also in a partial clone (measured on Linux).
settingsControl¶
settingsControl is always the last member. Its values are "shadow", "fallback-git" and "off-switch". No other method sends it.
- Before a start test of the daemon gave a state, the member is absent. So the first
git.infoof a daemon on a path that does not exist has no member (measured on Linux). - After a kept start test, the "no repository" body has the member too (measured on Linux).
- A request with
"shadowDirOff":truegets"off-switch", also as the first request of a daemon (measured on Linux). - After a plain request, a request with
"sessionFoldersOff":trueand no"shadowDirOff":truehas the member too (4c111e86, measured on Linux, macOS and Windows). - Before such a plain request, a request with
"sessionFoldersOff":trueand no"shadowDirOff":truehas no member. Its start test is not kept, also one that passed, and the next request tests again (4c111e86, measured on Linux). After such a test that gave"shadow", its git calls still use the settings copy (4c111e86, measured on Linux). On macOS and Windows the member of the first such request is measured too. The retest and the other orders are claustrum's own there. Before a kept state, such a request runs the test before each git call (rule). - An error reply has no member.
The section States and settingsControl has the effect of each state and the time of the next test.
What changes on disk¶
The settings copy can add files to the folder git-shadow beside the socket: the folder of the daemon, and a copy of the settings of the repository. The folders has the names.
Differences by system¶
| Linux and macOS | Windows | |
|---|---|---|
root |
The folder found by the walk, in the native form. | Confirmed by git, with forward slashes. The walk starts at the real path of a junction. |
path is a regular file |
The "no repository" body. | -32603 with config-defined hooks could not be pinned off; git not run: listing the configuration in force: fork/exec <git.exe path>: The directory name is invalid. |
| An alternates file with Windows line endings or too many object directories | git runs. | -32603, and only the excludes read runs git. Object sources. A daemon GIT_ALTERNATE_OBJECT_DIRECTORIES: Object sources. |
A path behind 32 or more links |
No link test (claustrum's own). | -32603 with the link-chain text (measured on Windows). |
A path through a link to a network or device path |
No link test (claustrum's own). | -32603, and no git call runs on it. Network links. |
A \\?\UNC\ or refused-share path |
Does not apply. | -32603. UNC refusals. |
A path below an IO_REPARSE_TAG_WIM folder |
Does not apply. | -32603 (4c111e86). Reparse tags. |
| A junction from repository P into repository R | Does not apply. | With no GIT_DIR or GIT_COMMON_DIR in the daemon's environment, the reply is that of R (4c111e86, measured on Windows). |
Differences from the reference¶
No entry of the divergence catalog applies to this method.