← All procedures

git.log

Show commit log

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

Use it

In TypeScript

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

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

From the command line

$ mark git log

As data, in a program

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

Input

FieldTypeRequiredDefaultDescription
countnumberno10Number of commits to show (default: 10)
onelinebooleannofalseOne line per commit (default: false)
refstringnoBranch/tag/commit to start from (default: HEAD)
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
commitsobject[]yesThe commits, newest first
linesstring[]noWith oneline: true, the short hash and the subject of each commit
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "count": {
        "default": 10,
        "description": "Number of commits to show (default: 10)",
        "type": "number"
      },
      "oneline": {
        "default": false,
        "description": "One line per commit (default: false)",
        "type": "boolean"
      },
      "ref": {
        "description": "Branch/tag/commit to start from (default: HEAD)",
        "type": "string"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "commits": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "hash": {
              "type": "string",
              "description": "The commit hash"
            },
            "shortHash": {
              "type": "string",
              "description": "The short hash"
            },
            "author": {
              "type": "string",
              "description": "The author name"
            },
            "email": {
              "type": "string",
              "description": "The author email"
            },
            "date": {
              "type": "string",
              "description": "The author date"
            },
            "message": {
              "type": "string",
              "description": "The commit message"
            }
          },
          "required": [
            "hash",
            "shortHash",
            "author",
            "email",
            "date",
            "message"
          ],
          "additionalProperties": {}
        },
        "description": "The commits, newest first"
      },
      "lines": {
        "description": "With oneline: true, the short hash and the subject of each commit",
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "commits"
    ],
    "additionalProperties": {}
  }
}