← All procedures

git.show

Show a commit (its fields, files and diff), or a file at a commit

CLI
Package
@procedures/git · README
Path
["git","show"]
CLI
mark git show
As data
{"$proc":["git","show"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/git/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["git","show"], {});
console.log(JSON.stringify(result));

From the command line

$ mark git show

As data, in a program

{ "$proc": ["git", "show"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
refstringnoThe commit, branch or tag (default: HEAD)
pathstringnoA file, relative to the root of the repository: the call gives its content at the commit
statbooleannoGive the counts of the files, without the text of the diff (default: false)
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
refstringyesThe ref of the input
hashstringyesThe hash of the commit
shortHashstringnoThe short hash
authorstringnoThe author name
emailstringnoThe author email
datestringnoThe author date
messagestringnoThe subject of the commit message
bodystringnoThe commit message after the subject
filesobject[]noThe changed files, against the first parent
additionsnumbernoThe added lines of all files
deletionsnumbernoThe deleted lines of all files
diffstringnoThe text of the diff
pathstringnoWith path: the file
contentstringnoWith path: the content of the file at the commit
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "ref": {
        "description": "The commit, branch or tag (default: HEAD)",
        "type": "string"
      },
      "path": {
        "description": "A file, relative to the root of the repository: the call gives its content at the commit",
        "type": "string"
      },
      "stat": {
        "description": "Give the counts of the files, without the text of the diff (default: false)",
        "type": "boolean"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "ref": {
        "type": "string",
        "description": "The ref of the input"
      },
      "hash": {
        "type": "string",
        "description": "The hash of the commit"
      },
      "shortHash": {
        "description": "The short hash",
        "type": "string"
      },
      "author": {
        "description": "The author name",
        "type": "string"
      },
      "email": {
        "description": "The author email",
        "type": "string"
      },
      "date": {
        "description": "The author date",
        "type": "string"
      },
      "message": {
        "description": "The subject of the commit message",
        "type": "string"
      },
      "body": {
        "description": "The commit message after the subject",
        "type": "string"
      },
      "files": {
        "description": "The changed files, against the first parent",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "description": "The path of the file (for a rename, the new path)"
            },
            "from": {
              "description": "For a rename, the old path",
              "type": "string"
            },
            "additions": {
              "type": "number",
              "description": "The added lines (0 for a binary file)"
            },
            "deletions": {
              "type": "number",
              "description": "The deleted lines (0 for a binary file)"
            }
          },
          "required": [
            "path",
            "additions",
            "deletions"
          ],
          "additionalProperties": {}
        }
      },
      "additions": {
        "description": "The added lines of all files",
        "type": "number"
      },
      "deletions": {
        "description": "The deleted lines of all files",
        "type": "number"
      },
      "diff": {
        "description": "The text of the diff",
        "type": "string"
      },
      "path": {
        "description": "With path: the file",
        "type": "string"
      },
      "content": {
        "description": "With path: the content of the file at the commit",
        "type": "string"
      }
    },
    "required": [
      "ref",
      "hash"
    ],
    "additionalProperties": {}
  }
}