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.

Category: Enquiry · Compare: git status / Git Source Control panel

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

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

ArgumentTypeRequiredWhat it is
includeIgnoredbooleanInclude .gitignore-matched files. Default false.
includeUntrackedbooleanInclude untracked files. Default true.
pathstringWorkspace-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.