Skip to content

Commits


Description of the JSON object structure describing a commit

Field Type Description
hash String Commit hash
message String Commit message
shortMessage String Short commit message
createdAt ZonedDateTime Commit creation date
committerIdent Object Last committer data
authorIdent Object Commit author data
user Object User data
verificationResult Object Object describing commit verification
parentCommitIds Set (String) Array containing parent commit hashes
parentCommitBranches Set (String) Array containing parent commit branches

Description of the JSON object structure describing commit verification

Field Type Description
verified Boolean Verification status. true - commit is verified, false - verification failed
comment String Signature comment
keyId String Key ID used to sign the commit

Description of the JSON object structure describing a file

Field Type Description
id String File ID
newMode String New file access mode
oldMode String Old file access mode
newPath String New file path
oldPath String Old file path
lastCommit* Object Last commit with which the file was added
addedLinesCount Integer Number of lines added to the file
removedLinesCount Integer Number of lines removed from the file
fileName String File name
filePath String File path
fileExtension String File extension
isImg Boolean Whether the file is an image
isCollapsed Boolean Whether file changes are collapsed and require manual loading on the page
isLarge Boolean Whether file changes are collapsed and require navigating to the file for viewing
isBinary Boolean Whether the file is binary
changeType String File change type
headers Array String File headers
lines Array Object File lines. See the array description here
links Deprecated Deprecated parameter. Returns an empty array by default

Description of the JSON object structure describing lines

Field Type Description
id String Line ID
body String Line content
highLightBody String Line content without code highlighting processing
addLineNumber Integer Added line number
removeLineNumber Integer Removed line number
op String Line change type. Possible values: none - no changes, add - line added, remove - line removed
type String Line type. Possible values: line - code line, separator - line containing additional information
links Depricated Deprecated parameter. Returns an empty array by default

You can find the structure of the JSON object describing a user here


Method for getting commit information

GET /project/{ownerAlias}/{projectAlias}/commit/{commitId}

The request returns information about the commit

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
commitId String Commit ID

Responses

STATUS 200 - JSON example:

Example response
    
{
    "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
    "message": "Commit\n",
    "shortMessage": "Commit",
    "createdAt": "2022-04-26T13:38:14Z",
    "committerIdent": {
        "name": "User",
        "avatar": "/static/image/avatar.jpg",
        "emailAddress": "user@gmail.com",
        "when": "2022-04-26T13:38:14Z"
    },
    "authorIdent": {
        "name": "User",
        "avatar": "/static/image/avatar.jpg",
        "emailAddress": "user@gmail.com",
        "when": "2022-04-26T13:38:14Z"
    },
    "user": {
        "id": "a10b86a3-aaaa-aaaa-aaaa-cea3dd8b6073",
        "username": "user",
        "name": name,
        "surname": subname,
        "fullName": "name subname",
        "avatar": "https://gitflic.ru/upload/img/d67527fd-aaaa-aaaa-aaaa-6269d204abe6.jpg"
    },
    "verificationResult": {
        "verified": true,
        "comment": null,
        "keyId": "aabbccdd11223344"
    },
    "parentCommitIds": [
        "25752fe5b62327aaaaaaaaaaaa641fb124dd94b7"
    ],
    "parentCommitBranches": [
        "master"
    ]
}
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method for getting the list of affected files in a commit

GET /project/{ownerAlias}/{projectAlias}/commit/{commitId}/file The request returns an array of files affected by the commit

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
commitId String Commit ID

Responses

STATUS 200 - JSON example:

Example response
    
[
    {
        "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0",
        "newMode": "100644",
        "oldMode": "100644",
        "newPath": "file1.txt",
        "oldPath": "file1.txt",
        "lastCommit": null,
        "addedLinesCount": 0,
        "removedLinesCount": 0,
        "fileName": "file1.txt",
        "filePath": "file1.txt",
        "fileExtension": "txt",
        "isImg": false,
        "isCollapsed": false,
        "isLarge": false,
        "isBinary": false,
        "changeType": "MODIFY",
        "headers": [],
        "lines": [],
        "links": []
    },
    {
        "id": "13e29841e34bc141f8f31eead2aaaaaaaaaaaa9dcf406776d844f6e65b80527c",
        "newMode": "100644",
        "oldMode": "0",
        "newPath": "test2.txt",
        "oldPath": "/dev/null",
        "lastCommit": null,
        "addedLinesCount": 0,
        "removedLinesCount": 0,
        "fileName": "test2.txt",
        "filePath": "test2.txt",
        "fileExtension": "txt",
        "isImg": false,
        "isCollapsed": false,
        "isLarge": false,
        "isBinary": false,
        "changeType": "ADD",
        "headers": [],
        "lines": [],
        "links": []
    },
    {
        "id": "36e6fe047847ce478368a46cc1aaaaaaaaaaaafddd68e2c2bb0250c499be3e97",
        "newMode": "100644",
        "oldMode": "0",
        "newPath": "test3.txt",
        "oldPath": "/dev/null",
        "lastCommit": null,
        "addedLinesCount": 0,
        "removedLinesCount": 0,
        "fileName": "test3.txt",
        "filePath": "test3.txt",
        "fileExtension": "txt",
        "isImg": false,
        "isCollapsed": false,
        "isLarge": false,
        "isBinary": false,
        "changeType": "ADD",
        "headers": [],
        "lines": [],
        "links": []
    }
]
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method for viewing file changes by specific commit

GET /project/{ownerAlias}/{projectAlias}/commit/{commitId}/diff?filePath={filePath}

The request returns information about changes in a file

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
commitId String Commit ID
filePath String File path

Responses

STATUS 200 - JSON example:

Example response
    
{
    "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0",
    "newMode": "100644",
    "oldMode": "100644",
    "newPath": "file1.txt",
    "oldPath": "file1.txt",
    "lastCommit": null,
    "addedLinesCount": 3,
    "removedLinesCount": 1,
    "fileName": "file1.txt",
    "filePath": "file1.txt",
    "fileExtension": "txt",
    "isImg": false,
    "isCollapsed": false,
    "isLarge": false,
    "isBinary": false,
    "changeType": null,
    "headers": [
        "diff --git a/file1.txt b/file1.txt",
        "index 4961484..3b66f31 100644",
        "--- a/file1.txt",
        "+++ b/file1.txt"
    ],
    "lines": [
        {
            "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0-1-1-separator",
            "body": "@@ -1 +1,3 @@",
            "highLightBody": "@ -1 +1,3 @@",
            "addLineNumber": null,
            "removeLineNumber": null,
            "op": "none",
            "type": "separator"
        },
        {
            "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0-1-1",
            "body": "-test",
            "highLightBody": "test",
            "addLineNumber": null,
            "removeLineNumber": 1,
            "op": "remove",
            "type": "line"
        },
        {
            "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0-2-1",
            "body": "\\ No newline at end of file",
            "highLightBody": " No newline at end of file",
            "addLineNumber": 1,
            "removeLineNumber": 2,
            "op": "none",
            "type": "line"
        },
        {
            "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0-3-2",
            "body": "+test",
            "highLightBody": "test",
            "addLineNumber": 2,
            "removeLineNumber": null,
            "op": "add",
            "type": "line"
        },
        {
            "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0-3-3",
            "body": "+",
            "highLightBody": "",
            "addLineNumber": 3,
            "removeLineNumber": null,
            "op": "add",
            "type": "line"
        },
        {
            "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0-3-4",
            "body": "+Modified file",
            "highLightBody": "Modified file",
            "addLineNumber": 4,
            "removeLineNumber": null,
            "op": "add",
            "type": "line"
        },
        {
            "id": "e64e5f3228f83d28daaccef563aaaaaaaaaaaa15f39518f863deee8ebacd1bf0-3-5",
            "body": "\\ No newline at end of file",
            "highLightBody": " No newline at end of file",
            "addLineNumber": 5,
            "removeLineNumber": 3,
            "op": "none",
            "type": "line"
        }
    ]
}
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method for getting commit information by file

GET /project/{ownerAlias}/{projectAlias}/commit/{commitId}/for-file?filePath={filePath}

The request returns information about the commit which is the last for the file

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
commitId String Commit ID
filePath String File path

Responses

STATUS 200 - JSON example:

Example response
    
{
    "hash": "01baf9f63e0060aaaaaaaaaaaab8b1cb3afa683c",
    "message": "Commit\n",
    "shortMessage": "Commit",
    "createdAt": "2022-04-26T13:38:14Z",
    "committerIdent": {
        "name": "User",
        "avatar": "/static/image/avatar.jpg",
        "emailAddress": "user@gmail.com",
        "when": "2022-04-26T13:38:14Z"
    },
    "authorIdent": {
        "name": "User",
        "avatar": "/static/image/avatar.jpg",
        "emailAddress": "user@gmail.com",
        "when": "2022-04-26T13:38:14Z"
    },
    "user": {
        "id": "a10b86a3-aaaa-aaaa-aaaa-cea3dd8b6073",
        "username": "user",
        "name": name,
        "surname": subname,
        "fullName": "name subname",
        "avatar": "https://gitflic.ru/upload/img/d67527fd-aaaa-aaaa-aaaa-6269d204abe6.jpg"
    },
    "verificationResult": {
        "verified": true,
        "comment": null,
        "keyId": "aabbccdd11223344"
    },
    "parentCommitIds": [
        "25752fe5b62327aaaaaaaaaaaa641fb124dd94b7"
    ],
    "parentCommitBranches": [
        "master"
    ]
}
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method for getting information about commits of the default branch

GET /project/{ownerAlias}/{projectAlias}/commits

The request returns commits of the project's default branch

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias

Responses

STATUS 200 - JSON example:

Example response
    
{
    "_embedded": {
        "commitList": [
            {
                "hash": "f24075cb2c2dedaaaaaaaaaaaa9133d1d8109930",
                "message": "example-commit",
                "shortMessage": "example-commit",
                "createdAt": "2023-03-14T10:40:09Z",
                "committerIdent": {
                    "name": "Vasiliy",
                    "avatar": "/static/image/avatar.jpg",
                    "emailAddress": "example@gmail.com",
                    "when": "2023-03-14T10:40:09Z"
                },
                "authorIdent": {
                    "name": "artem",
                    "avatar": "/static/image/avatar.jpg",
                    "emailAddress": "example@gmail.com",
                    "when": "2023-03-14T10:40:09Z"
                },
                "user": {
                    "id": "67248766-aaaa-aaaa-aaaa-624a59869252",
                    "username": "ExampleUser",
                    "name": "ExampleName",
                    "surname": "ExampleSurname",
                    "fullName": "ExampleName ExampleSurname",
                    "avatar": "https://gitflic.ru/upload/img/6ce797dd-aaaa-aaaa-aaaa-37a55d6c8057.jpg"
                },
                "verificationResult": {
                    "verified": true,
                    "comment": null,
                    "keyId": "aabbccdd11223344"
                },
                "parentCommitIds": [
                    "25752fe5b62327aaaaaaaaaaaa641fb124dd94b7"
                ],
                "parentCommitBranches": [
                    "master"
                ]
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 1,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method for getting information about branch commits

GET /project/{ownerAlias}/{projectAlias}/commits?branch={branchName}

The request returns commits of the specified project branch

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
branchName String Branch name

Responses

STATUS 200 - JSON example:

Example response
    
{
    "_embedded": {
        "commitList": [
            {
                "hash": "f24075cb2c2dedaaaaaaaaaaaa9133d1d8109930",
                "message": "example-commit",
                "shortMessage": "example-commit",
                "createdAt": "2023-03-14T10:40:09Z",
                "committerIdent": {
                    "name": "Vasiliy",
                    "avatar": "/static/image/avatar.jpg",
                    "emailAddress": "example@gmail.com",
                    "when": "2023-03-14T10:40:09Z"
                },
                "authorIdent": {
                    "name": "artem",
                    "avatar": "/static/image/avatar.jpg",
                    "emailAddress": "example@gmail.com",
                    "when": "2023-03-14T10:40:09Z"
                },
                "user": {
                    "id": "67248766-aaaa-aaaa-aaaa-624a59869252",
                    "username": "ExampleUser",
                    "name": "ExampleName",
                    "surname": "ExampleSurname",
                    "fullName": "ExampleName ExampleSurname",
                    "avatar": "https://gitflic.ru/upload/img/6ce797dd-aaaa-aaaa-aaaa-37a55d6c8057.jpg"
                },
                "verificationResult": {
                    "verified": true,
                    "comment": null,
                    "keyId": "aabbccdd11223344"
                },
                "parentCommitIds": [
                    "25752fe5b62327aaaaaaaaaaaa641fb124dd94b7"
                ],
                "parentCommitBranches": [
                    "master"
                ]
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 1,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method for getting differences between commits

GET /project/{ownerAlias}/{projectAlias}/commit/diff?sourceCommitId={sourceCommitId}&targetCommitId={targetCommitId}&ignoreCollapsed={true/false}

The request returns an array of files with changes that occurred between the specified commits.

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
sourceCommitId String Source commit hash
targetCommitId String Target commit hash
ignoreCollapsed Boolean Whether to send information about large files: false (default) or not true

Responses

STATUS 200 - JSON example:

Example response
    
        [
            {
                "id": "e0e336e503c9a733aaaaaaaaaaaa9308509ecde34986b555c617645e807d92c6",
                "newMode": "100644",
                "oldMode": "100644",
                "newPath": "admin/samlSso.ftlh",
                "oldPath": "admin/samlSso.ftlh",
                "lastCommit": null,
                "addedLinesCount": 1,
                "removedLinesCount": 1,
                "fileName": "samlSso.ftlh",
                "filePath": "admin/samlSso.ftlh",
                "fileExtension": "ftlh",
                "isImg": false,
                "isCollapsed": false,
                "isLarge": false,
                "isBinary": false,
                "changeType": null,
                "headers": [
                    "diff --git a/admin/src/main/resources/templates/admin/saml/samlSso.ftlh b/admin/src/main/resources/templates/admin/saml/samlSso.ftlh",
                    "index d037c96..b142de6 100644",
                    "--- a/admin/src/main/resources/templates/admin/saml/samlSso.ftlh",
                    "+++ b/admin/src/main/resources/templates/admin/saml/samlSso.ftlh"
                ],
                "lines": [
                    {
                        "id": "e0e336e503c9a733aaaaaaaaaaaa9308509ecde34986b555c617645e807d92c6-19-19-separator",
                        "body": "@@ -19,7 +19,7 @@",
                        "highLightBody": "@ -19,7 +19,7 @@",
                        "addLineNumber": null,
                        "removeLineNumber": null,
                        "op": "none",
                        "type": "separator",
                        "links": []
                    },
                    {
                        "id": "e0e336e503c9a733aaaaaaaaaaaa9308509ecde34986b555c617645e807d92c6-19-19",
                        "body": "                             <div class="d-flex flex-column mr-auto pl-0">",
                        "highLightBody": "                            <div class=\"d-flex flex-column mr-auto pl-0\">",
                        "addLineNumber": 19,
                        "removeLineNumber": 19,
                        "op": "none",
                        "type": "line",
                        "links": []
                    }
                ],
            }
        ]
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Method for getting differences between tags

GET /project/{ownerAlias}/{projectAlias}/tag/diff?sourceName={sourceName}&targetName={targetName}&ignoreCollapsed={true/false}

The request returns an array of files with changes that occurred between the specified tags.

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
sourceName String Source tag name
targetName String Target tag name
ignoreCollapsed Boolean Whether to send information about large files: false (default) or not true

Responses

STATUS 200 - JSON example:

Example response
    
        [
            {
                "id": "e0e336e503c9a733aaaaaaaaaaaa9308509ecde34986b555c617645e807d92c6",
                "newMode": "100644",
                "oldMode": "100644",
                "newPath": "admin/samlSso.ftlh",
                "oldPath": "admin/samlSso.ftlh",
                "lastCommit": null,
                "addedLinesCount": 1,
                "removedLinesCount": 1,
                "fileName": "samlSso.ftlh",
                "filePath": "admin/samlSso.ftlh",
                "fileExtension": "ftlh",
                "isImg": false,
                "isCollapsed": false,
                "isLarge": false,
                "isBinary": false,
                "changeType": null,
                "headers": [
                    "diff --git a/admin/src/main/resources/templates/admin/saml/samlSso.ftlh b/admin/src/main/resources/templates/admin/saml/samlSso.ftlh",
                    "index d037c96..b142de6 100644",
                    "--- a/admin/src/main/resources/templates/admin/saml/samlSso.ftlh",
                    "+++ b/admin/src/main/resources/templates/admin/saml/samlSso.ftlh"
                ],
                "lines": [
                    {
                        "id": "e0e336e503c9a733aaaaaaaaaaaa9308509ecde34986b555c617645e807d92c6-19-19-separator",
                        "body": "@@ -19,7 +19,7 @@",
                        "highLightBody": "@ -19,7 +19,7 @@",
                        "addLineNumber": null,
                        "removeLineNumber": null,
                        "op": "none",
                        "type": "separator",
                        "links": []
                    },
                    {
                        "id": "e0e336e503c9a733aaaaaaaaaaaa9308509ecde34986b555c617645e807d92c6-19-19",
                        "body": "                             <div class="d-flex flex-column mr-auto pl-0">",
                        "highLightBody": "                            <div class=\"d-flex flex-column mr-auto pl-0\">",
                        "addLineNumber": 19,
                        "removeLineNumber": 19,
                        "op": "none",
                        "type": "line",
                        "links": []
                    }
                ],
            }
        ]
    
  

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Cherry-pick method

PUT /project/{ownerAlias}/{projectAlias}/branch/cherry-pick

The request transfers a commit to the specified branch. The cherry-pick uses the rebase method for transferring changes, so the commit hash after transfer will be different.

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias

POST request body structure:

Parameters Type Description
branch String Name of the branch to transfer the commit to
newBranch String Optional parameter. If specified, the branch field indicates the branch from which a new branch named newBranch will be created, and the commit will be transferred to it
commitHash String Hash of the commit to be transferred
commits String[] Deprecated parameter. Array of commit hashes, only the first will be transferred. Others will be ignored. Ignored if commitHash is specified.

Example JSON object

{
    "branch": "branchName",
    "commitHash": "f24075cb2c2dedaaaaaaaaaaaa9133d1d8109930"
}

Responses

STATUS 200 - Successful commit transfer to branch. JSON example:

Example response
    
{
    "oldCommitHash": "f24075cb2c2dedaaaaaaaaaaaa9133d1d8109930",
    "targetBranch": "branchName",
    "newCommitHash": "4f6ecb9433356faaaaaaaaaaaa039cf0e482b40b"
}
    
  

STATUS 400 - Conflicts present for transfer.

STATUS 403 - No access rights.

STATUS 404 - No data found for the request.


Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.