Returns a structured, line-level diff between two blob versions in a repository¶
Description¶
Returns a structured, line-level diff between two blob versions in a repository. The diff is returned as an ordered list of hunks, where each hunk represents a contiguous run of changed lines together with any surrounding unchanged context lines.
Results are paginated. Use MaxResults and NextToken to retrieve additional pages.
For the typical usage workflow, see get_differences.
Usage¶
codecommit_get_blob_differences(repositoryName, afterBlobId,
beforeBlobId, contextLines, ignoreWhitespace, MaxResults, NextToken)
Arguments¶
-
repositoryName[required] The name of the repository that contains the blobs to compare.
-
afterBlobId[required] The ID of the "after" (destination) blob in the diff. Typically the value of
afterBlob.blobIdfrom aDifferenceobject returned byget_differences. -
beforeBlobIdThe ID of the "before" (source) blob in the diff. Typically the value of
beforeBlob.blobIdfrom aDifferenceobject returned byget_differences.If you do not specify a value, the operation returns a diff against an empty before-state. This is equivalent to treating the file as newly added.
-
contextLinesThe number of unchanged lines of context to include before and after each block of changes in a hunk. Valid values are 0 through 20. Defaults to
3. -
ignoreWhitespaceSpecifies whether to ignore whitespace-only changes when computing the diff. When
true, the operation treats lines that differ only in whitespace as unchanged. Defaults tofalse. -
MaxResultsThe maximum number of
DiffHunkentries to return in a single response page. Defaults to100. -
NextTokenAn enumeration token that returns the next batch of results when present in a request.
Value¶
A list with the following syntax:
list(
hunks = list(
list(
beforeStartLine = 123,
beforeLineCount = 123,
afterStartLine = 123,
afterLineCount = 123,
changes = list(
list(
type = "CONTEXT"|"ADD"|"DELETE",
beforeLineNumber = 123,
afterLineNumber = 123,
content = "string"
)
)
)
),
isBinary = TRUE|FALSE,
beforeBlobSize = 123,
afterBlobSize = 123,
NextToken = "string"
)