ek9_git_status
Answers first: summary, branch, ahead/behind, isClean, then stagedFiles / modifiedFiles / untrackedFiles / deletedFiles / conflictFiles names and changedFileCount, then the per-file records with change words.
When to use it
'What have I changed, what is staged, what branch am I on?' - one call, no arguments; path narrows to a subtree. The pre-commit and pre-push check, and the first call when picking up a workspace.
When not to use it
- the content of the changes - use
ek9_git_diff. - commit history - use
ek9_git_log. - per-line authorship of a file - use
ek9_git_blame. - compiler errors and warnings - use
ek9_query_diagnostics.
Details
Headline first: summary, branch (null on a detached HEAD, with detachedAt), upstream with ahead/behind, isClean, changedFileCount and the name arrays stagedFiles / modifiedFiles / untrackedFiles / deletedFiles / conflictFiles. Then the records: staged / modified / deleted / conflicts entries are {file, change} with change one of modified / added / deleted / typechange / conflict; renamed / copied entries are {oldPath, newPath, change, similarity}. verbosity:'summary' keeps the names and drops the records.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
includeIgnored | boolean | Include .gitignore-matched files. Default false. | |
includeUntracked | boolean | Include untracked files. Default true. | |
path | string | Workspace-relative file or directory to scope the status to. Default: the whole workspace. |
It also takes the arguments every tool takes.
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
Dirty tree
Request
{ }
Response
{
"branch" : "main",
"changedFileCount" : 2,
"conflictFiles" : [ ],
"conflicts" : [ ],
"copied" : [ ],
"deleted" : [ ],
"deletedFiles" : [ ],
"isClean" : false,
"meta" : {
"serverMs" : "<timing>"
},
"modified" : [ {
"change" : "modified",
"file" : "tracked.txt",
"status" : "M"
} ],
"modifiedFiles" : [ "tracked.txt" ],
"renamed" : [ ],
"staged" : [ ],
"stagedFiles" : [ ],
"status" : "ok",
"summary" : "main; 1 modified, 1 untracked",
"untracked" : [ {
...
Cut short here: 5 more lines. The whole recorded call.