merge_commits
Creates, updates, deletes, gets or lists a merge_commits resource.
Overview
| Name | merge_commits |
| Type | Resource |
| Id | aws.codecommit.merge_commits |
Fields
The following fields are returned by SELECT queries:
- get_merge_commit
| Name | Datatype | Description |
|---|---|---|
base_commit_id | string | The commit ID of the merge base. |
destination_commit_id | string | The commit ID of the destination commit specifier that was used in the merge evaluation. |
merged_commit_id | string | The commit ID for the merge commit created when the source branch was merged into the destination branch. If the fast-forward merge strategy was used, there is no merge commit. |
source_commit_id | string | The commit ID of the source commit specifier that was used in the merge evaluation. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_merge_commit | select | region | Returns information about a specified merge commit. | |
create_unreferenced_merge_commit | insert | region, repositoryName, sourceCommitSpecifier, destinationCommitSpecifier, mergeOption | Creates an unreferenced commit that represents the result of merging two branches using a specified merge strategy. This can help you determine the outcome of a potential merge. This API cannot be used with the fast-forward merge strategy because that strategy does not create a merge commit. This unreferenced merge commit can only be accessed using the GetCommit API or through git commands such as git fetch. To retrieve this commit, you must specify its commit ID or otherwise reference it. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_merge_commit
Returns information about a specified merge commit.
SELECT
base_commit_id,
destination_commit_id,
merged_commit_id,
source_commit_id
FROM aws.codecommit.merge_commits
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_unreferenced_merge_commit
- Manifest
Creates an unreferenced commit that represents the result of merging two branches using a specified merge strategy. This can help you determine the outcome of a potential merge. This API cannot be used with the fast-forward merge strategy because that strategy does not create a merge commit. This unreferenced merge commit can only be accessed using the GetCommit API or through git commands such as git fetch. To retrieve this commit, you must specify its commit ID or otherwise reference it.
INSERT INTO aws.codecommit.merge_commits (
repositoryName,
sourceCommitSpecifier,
destinationCommitSpecifier,
mergeOption,
conflictDetailLevel,
conflictResolutionStrategy,
authorName,
email,
commitMessage,
keepEmptyFolders,
conflictResolution,
region
)
SELECT
'{{ repositoryName }}' /* required */,
'{{ sourceCommitSpecifier }}' /* required */,
'{{ destinationCommitSpecifier }}' /* required */,
'{{ mergeOption }}' /* required */,
'{{ conflictDetailLevel }}',
'{{ conflictResolutionStrategy }}',
'{{ authorName }}',
'{{ email }}',
'{{ commitMessage }}',
{{ keepEmptyFolders }},
'{{ conflictResolution }}',
'{{ region }}'
RETURNING
commit_id,
tree_id
;
# Description fields are for documentation purposes
- name: merge_commits
props:
- name: region
value: "{{ region }}"
description: Required parameter for the merge_commits resource.
- name: repositoryName
value: "{{ repositoryName }}"
description: |
The name of the repository where you want to create the unreferenced merge commit.
- name: sourceCommitSpecifier
value: "{{ sourceCommitSpecifier }}"
description: |
The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).
- name: destinationCommitSpecifier
value: "{{ destinationCommitSpecifier }}"
description: |
The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).
- name: mergeOption
value: "{{ mergeOption }}"
description: |
The merge option or strategy you want to use to merge the code.
valid_values: ['FAST_FORWARD_MERGE', 'SQUASH_MERGE', 'THREE_WAY_MERGE']
- name: conflictDetailLevel
value: "{{ conflictDetailLevel }}"
description: |
The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.
valid_values: ['FILE_LEVEL', 'LINE_LEVEL']
- name: conflictResolutionStrategy
value: "{{ conflictResolutionStrategy }}"
description: |
Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.
valid_values: ['NONE', 'ACCEPT_SOURCE', 'ACCEPT_DESTINATION', 'AUTOMERGE']
- name: authorName
value: "{{ authorName }}"
description: |
The name of the author who created the unreferenced commit. This information is used as both the author and committer for the commit.
- name: email
value: "{{ email }}"
description: |
The email address for the person who created the unreferenced commit.
- name: commitMessage
value: "{{ commitMessage }}"
description: |
The commit message for the unreferenced commit.
- name: keepEmptyFolders
value: {{ keepEmptyFolders }}
description: |
If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If this is specified as true, a .gitkeep file is created for empty folders. The default is false.
- name: conflictResolution
description: |
If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.
value:
replaceContents:
- filePath: "{{ filePath }}"
replacementType: "{{ replacementType }}"
content: "{{ content }}"
fileMode: "{{ fileMode }}"
deleteFiles:
- filePath: "{{ filePath }}"
setFileModes:
- filePath: "{{ filePath }}"
fileMode: "{{ fileMode }}"