---
title: "git.commit@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/git.commit"
updated: null
---

# git.commit@1 · OpenVibe.Services

HTML: [git.commit@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/git.commit)

# GitCommit `git.commit@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: git
- Visibility: public
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/git/commit.v1.json`](/docs/contracts/git.commit.json)

One commit on OpenVibe.Git: its sha, message, author and committer, parents, tree, and — for the commit page or a contents write — its diff and per-file counts. api/view/commit.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `sha` | string | yes | The commit id: 40 hex characters (SHA-1) or 64 (SHA-256). | - `pattern ^[0-9a-f]{40}([0-9a-f]{24})?$` |
| `repo` | string | yes |  | - `pattern ^[a-z0-9-]+/[a-z0-9][a-z0-9._-]{0,99}$` |
| `message` | string | yes |  | - `maxLength 100000` |
| `subject` | string |  | The first line of the message. | - `maxLength 500` |
| `author` | object | yes |  | - `no other fields` |
| `author.name` | string | yes |  |  |
| `author.email` | string | yes |  |  |
| `author.username` | string \| null |  | The OpenVibe username when the email is a verified one. |  |
| `author.date` | string | yes |  | - `format date-time` |
| `committer` | object | yes |  | - `no other fields` |
| `committer.name` | string | yes |  |  |
| `committer.email` | string | yes |  |  |
| `committer.date` | string | yes |  | - `format date-time` |
| `parents` | array of string | yes |  | - `maxItems 2`<br>- `items: pattern ^[0-9a-f]{40}([0-9a-f]{24})?$` |
| `tree_sha` | string | yes |  | - `pattern ^[0-9a-f]{40}([0-9a-f]{24})?$` |
| `date` | string | yes |  | - `format date-time` |
| `stats` | object \| null |  |  |  |
| `files` | array of object |  | The changed files, when the caller asked for the diff. | - `items: no other fields` |
| `files[].path` | string | yes |  |  |
| `files[].previous_path` | string \| null |  |  |  |
| `files[].status` | enum | yes |  | - `one of "added", "modified", "deleted", "renamed", "copied"` |
| `files[].additions` | integer | yes |  | - `minimum 0` |
| `files[].deletions` | integer | yes |  | - `minimum 0` |
| `files[].patch` | string \| null |  |  |  |
| `diff` | string \| null |  | The unified diff, when the caller asked for it. |  |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: with-diff

~~~~
{
  "sha": "4f0c2d9a1e8b7c6d5a4f3e2d1c0b9a8f7e6d5c4b",
  "repo": "openvibers/openvibe.codes",
  "message": "Open the desk from a phone\n\nA narrow layout and a bigger tap target.",
  "subject": "Open the desk from a phone",
  "author": {
    "name": "Sam",
    "email": "sam@example.com",
    "username": "sam",
    "date": "2026-11-09T08:40:00Z"
  },
  "committer": {
    "name": "Sam",
    "email": "sam@example.com",
    "date": "2026-11-09T08:40:00Z"
  },
  "parents": [
    "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678"
  ],
  "tree_sha": "b2c3d4e5f60718293a4b5c6d7e8f901234567890",
  "date": "2026-11-09T08:40:00Z",
  "stats": {
    "files": 2,
    "additions": 34,
    "deletions": 6
  },
  "files": [
    {
      "path": "public/css/codes.css",
      "previous_path": null,
      "status": "modified",
      "additions": 30,
      "deletions": 6,
      "patch": "@@ -12,3 +12,27 @@\n .desk { display: grid; }\n"
    },
    {
      "path": "test/phone.test.js",
      "previous_path": null,
      "status": "added",
      "additions": 4,
      "deletions": 0,
      "patch": null
    }
  ],
  "diff": "diff --git a/public/css/codes.css b/public/css/codes.css\n"
}
~~~~

Rejected: bad-sha-and-repo

~~~~
{
  "sha": "4f0c2d9a1e8b7c6d5a4f3e2d1c0b9a8f7e6d5c4b",
  "repo": "openviber",
  "message": "not a repo name",
  "author": {
    "name": "",
    "email": "sam@example.com",
    "date": "yesterday"
  },
  "committer": {
    "name": "Sam",
    "email": "sam@example.com",
    "date": "2026-11-09T08:40:00Z"
  },
  "parents": [],
  "tree_sha": "xyz",
  "date": "2026-11-09T08:40:00Z"
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('git.commit@1', value);   // { valid, errors: [{ path, message }] }
~~~~
