1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. getRepositoryFileDiff
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.DevOps.getRepositoryFileDiff

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

This data source provides details about a specific Repository File Diff resource in Oracle Cloud Infrastructure Devops service.

Gets the line-by-line difference between file on different commits.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testRepositoryFileDiff = oci.DevOps.getRepositoryFileDiff({
    baseVersion: repositoryFileDiffBaseVersion,
    repositoryId: testRepository.id,
    targetVersion: repositoryFileDiffTargetVersion,
    filePath: repositoryFileDiffFilePath,
    isComparisonFromMergeBase: repositoryFileDiffIsComparisonFromMergeBase,
});
Copy
import pulumi
import pulumi_oci as oci

test_repository_file_diff = oci.DevOps.get_repository_file_diff(base_version=repository_file_diff_base_version,
    repository_id=test_repository["id"],
    target_version=repository_file_diff_target_version,
    file_path=repository_file_diff_file_path,
    is_comparison_from_merge_base=repository_file_diff_is_comparison_from_merge_base)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/devops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := devops.GetRepositoryFileDiff(ctx, &devops.GetRepositoryFileDiffArgs{
			BaseVersion:               repositoryFileDiffBaseVersion,
			RepositoryId:              testRepository.Id,
			TargetVersion:             repositoryFileDiffTargetVersion,
			FilePath:                  repositoryFileDiffFilePath,
			IsComparisonFromMergeBase: pulumi.BoolRef(repositoryFileDiffIsComparisonFromMergeBase),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testRepositoryFileDiff = Oci.DevOps.GetRepositoryFileDiff.Invoke(new()
    {
        BaseVersion = repositoryFileDiffBaseVersion,
        RepositoryId = testRepository.Id,
        TargetVersion = repositoryFileDiffTargetVersion,
        FilePath = repositoryFileDiffFilePath,
        IsComparisonFromMergeBase = repositoryFileDiffIsComparisonFromMergeBase,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DevOps.DevOpsFunctions;
import com.pulumi.oci.DevOps.inputs.GetRepositoryFileDiffArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testRepositoryFileDiff = DevOpsFunctions.getRepositoryFileDiff(GetRepositoryFileDiffArgs.builder()
            .baseVersion(repositoryFileDiffBaseVersion)
            .repositoryId(testRepository.id())
            .targetVersion(repositoryFileDiffTargetVersion)
            .filePath(repositoryFileDiffFilePath)
            .isComparisonFromMergeBase(repositoryFileDiffIsComparisonFromMergeBase)
            .build());

    }
}
Copy
variables:
  testRepositoryFileDiff:
    fn::invoke:
      function: oci:DevOps:getRepositoryFileDiff
      arguments:
        baseVersion: ${repositoryFileDiffBaseVersion}
        repositoryId: ${testRepository.id}
        targetVersion: ${repositoryFileDiffTargetVersion}
        filePath: ${repositoryFileDiffFilePath}
        isComparisonFromMergeBase: ${repositoryFileDiffIsComparisonFromMergeBase}
Copy

Using getRepositoryFileDiff

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getRepositoryFileDiff(args: GetRepositoryFileDiffArgs, opts?: InvokeOptions): Promise<GetRepositoryFileDiffResult>
function getRepositoryFileDiffOutput(args: GetRepositoryFileDiffOutputArgs, opts?: InvokeOptions): Output<GetRepositoryFileDiffResult>
Copy
def get_repository_file_diff(base_version: Optional[str] = None,
                             file_path: Optional[str] = None,
                             is_comparison_from_merge_base: Optional[bool] = None,
                             repository_id: Optional[str] = None,
                             target_version: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetRepositoryFileDiffResult
def get_repository_file_diff_output(base_version: Optional[pulumi.Input[str]] = None,
                             file_path: Optional[pulumi.Input[str]] = None,
                             is_comparison_from_merge_base: Optional[pulumi.Input[bool]] = None,
                             repository_id: Optional[pulumi.Input[str]] = None,
                             target_version: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryFileDiffResult]
Copy
func GetRepositoryFileDiff(ctx *Context, args *GetRepositoryFileDiffArgs, opts ...InvokeOption) (*GetRepositoryFileDiffResult, error)
func GetRepositoryFileDiffOutput(ctx *Context, args *GetRepositoryFileDiffOutputArgs, opts ...InvokeOption) GetRepositoryFileDiffResultOutput
Copy

> Note: This function is named GetRepositoryFileDiff in the Go SDK.

public static class GetRepositoryFileDiff 
{
    public static Task<GetRepositoryFileDiffResult> InvokeAsync(GetRepositoryFileDiffArgs args, InvokeOptions? opts = null)
    public static Output<GetRepositoryFileDiffResult> Invoke(GetRepositoryFileDiffInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRepositoryFileDiffResult> getRepositoryFileDiff(GetRepositoryFileDiffArgs args, InvokeOptions options)
public static Output<GetRepositoryFileDiffResult> getRepositoryFileDiff(GetRepositoryFileDiffArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:DevOps/getRepositoryFileDiff:getRepositoryFileDiff
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

BaseVersion This property is required. string
The branch to compare changes against.
FilePath This property is required. string
A filter to return only commits that affect any of the specified paths.
RepositoryId This property is required. string
Unique repository identifier.
TargetVersion This property is required. string
The branch where changes are coming from.
IsComparisonFromMergeBase bool
Boolean to indicate whether to use merge base or most recent revision.
BaseVersion This property is required. string
The branch to compare changes against.
FilePath This property is required. string
A filter to return only commits that affect any of the specified paths.
RepositoryId This property is required. string
Unique repository identifier.
TargetVersion This property is required. string
The branch where changes are coming from.
IsComparisonFromMergeBase bool
Boolean to indicate whether to use merge base or most recent revision.
baseVersion This property is required. String
The branch to compare changes against.
filePath This property is required. String
A filter to return only commits that affect any of the specified paths.
repositoryId This property is required. String
Unique repository identifier.
targetVersion This property is required. String
The branch where changes are coming from.
isComparisonFromMergeBase Boolean
Boolean to indicate whether to use merge base or most recent revision.
baseVersion This property is required. string
The branch to compare changes against.
filePath This property is required. string
A filter to return only commits that affect any of the specified paths.
repositoryId This property is required. string
Unique repository identifier.
targetVersion This property is required. string
The branch where changes are coming from.
isComparisonFromMergeBase boolean
Boolean to indicate whether to use merge base or most recent revision.
base_version This property is required. str
The branch to compare changes against.
file_path This property is required. str
A filter to return only commits that affect any of the specified paths.
repository_id This property is required. str
Unique repository identifier.
target_version This property is required. str
The branch where changes are coming from.
is_comparison_from_merge_base bool
Boolean to indicate whether to use merge base or most recent revision.
baseVersion This property is required. String
The branch to compare changes against.
filePath This property is required. String
A filter to return only commits that affect any of the specified paths.
repositoryId This property is required. String
Unique repository identifier.
targetVersion This property is required. String
The branch where changes are coming from.
isComparisonFromMergeBase Boolean
Boolean to indicate whether to use merge base or most recent revision.

getRepositoryFileDiff Result

The following output properties are available:

AreConflictsInFile bool
Indicates whether the changed file contains conflicts.
BaseVersion string
Changes List<GetRepositoryFileDiffChange>
List of changed section in the file.
FilePath string
Id string
The provider-assigned unique ID for this managed resource.
IsBinary bool
Indicates whether the file is binary.
IsLarge bool
Indicates whether the file is large.
NewId string
The ID of the changed object on the target version.
NewPath string
The path on the target version to the changed object.
OldId string
The ID of the changed object on the base version.
OldPath string
The path on the base version to the changed object.
RepositoryId string
TargetVersion string
IsComparisonFromMergeBase bool
AreConflictsInFile bool
Indicates whether the changed file contains conflicts.
BaseVersion string
Changes []GetRepositoryFileDiffChange
List of changed section in the file.
FilePath string
Id string
The provider-assigned unique ID for this managed resource.
IsBinary bool
Indicates whether the file is binary.
IsLarge bool
Indicates whether the file is large.
NewId string
The ID of the changed object on the target version.
NewPath string
The path on the target version to the changed object.
OldId string
The ID of the changed object on the base version.
OldPath string
The path on the base version to the changed object.
RepositoryId string
TargetVersion string
IsComparisonFromMergeBase bool
areConflictsInFile Boolean
Indicates whether the changed file contains conflicts.
baseVersion String
changes List<GetRepositoryFileDiffChange>
List of changed section in the file.
filePath String
id String
The provider-assigned unique ID for this managed resource.
isBinary Boolean
Indicates whether the file is binary.
isLarge Boolean
Indicates whether the file is large.
newId String
The ID of the changed object on the target version.
newPath String
The path on the target version to the changed object.
oldId String
The ID of the changed object on the base version.
oldPath String
The path on the base version to the changed object.
repositoryId String
targetVersion String
isComparisonFromMergeBase Boolean
areConflictsInFile boolean
Indicates whether the changed file contains conflicts.
baseVersion string
changes GetRepositoryFileDiffChange[]
List of changed section in the file.
filePath string
id string
The provider-assigned unique ID for this managed resource.
isBinary boolean
Indicates whether the file is binary.
isLarge boolean
Indicates whether the file is large.
newId string
The ID of the changed object on the target version.
newPath string
The path on the target version to the changed object.
oldId string
The ID of the changed object on the base version.
oldPath string
The path on the base version to the changed object.
repositoryId string
targetVersion string
isComparisonFromMergeBase boolean
are_conflicts_in_file bool
Indicates whether the changed file contains conflicts.
base_version str
changes Sequence[devops.GetRepositoryFileDiffChange]
List of changed section in the file.
file_path str
id str
The provider-assigned unique ID for this managed resource.
is_binary bool
Indicates whether the file is binary.
is_large bool
Indicates whether the file is large.
new_id str
The ID of the changed object on the target version.
new_path str
The path on the target version to the changed object.
old_id str
The ID of the changed object on the base version.
old_path str
The path on the base version to the changed object.
repository_id str
target_version str
is_comparison_from_merge_base bool
areConflictsInFile Boolean
Indicates whether the changed file contains conflicts.
baseVersion String
changes List<Property Map>
List of changed section in the file.
filePath String
id String
The provider-assigned unique ID for this managed resource.
isBinary Boolean
Indicates whether the file is binary.
isLarge Boolean
Indicates whether the file is large.
newId String
The ID of the changed object on the target version.
newPath String
The path on the target version to the changed object.
oldId String
The ID of the changed object on the base version.
oldPath String
The path on the base version to the changed object.
repositoryId String
targetVersion String
isComparisonFromMergeBase Boolean

Supporting Types

GetRepositoryFileDiffChange

BaseLine This property is required. int
The number of a line in the base version.
BaseSpan This property is required. int
Number of lines chunk spans in base version.
DiffSections This property is required. List<GetRepositoryFileDiffChangeDiffSection>
List of difference section.
TargetLine This property is required. int
Line number in target version where changes begin.
TargetSpan This property is required. int
Number of lines chunk spans in target version.
BaseLine This property is required. int
The number of a line in the base version.
BaseSpan This property is required. int
Number of lines chunk spans in base version.
DiffSections This property is required. []GetRepositoryFileDiffChangeDiffSection
List of difference section.
TargetLine This property is required. int
Line number in target version where changes begin.
TargetSpan This property is required. int
Number of lines chunk spans in target version.
baseLine This property is required. Integer
The number of a line in the base version.
baseSpan This property is required. Integer
Number of lines chunk spans in base version.
diffSections This property is required. List<GetRepositoryFileDiffChangeDiffSection>
List of difference section.
targetLine This property is required. Integer
Line number in target version where changes begin.
targetSpan This property is required. Integer
Number of lines chunk spans in target version.
baseLine This property is required. number
The number of a line in the base version.
baseSpan This property is required. number
Number of lines chunk spans in base version.
diffSections This property is required. GetRepositoryFileDiffChangeDiffSection[]
List of difference section.
targetLine This property is required. number
Line number in target version where changes begin.
targetSpan This property is required. number
Number of lines chunk spans in target version.
base_line This property is required. int
The number of a line in the base version.
base_span This property is required. int
Number of lines chunk spans in base version.
diff_sections This property is required. Sequence[devops.GetRepositoryFileDiffChangeDiffSection]
List of difference section.
target_line This property is required. int
Line number in target version where changes begin.
target_span This property is required. int
Number of lines chunk spans in target version.
baseLine This property is required. Number
The number of a line in the base version.
baseSpan This property is required. Number
Number of lines chunk spans in base version.
diffSections This property is required. List<Property Map>
List of difference section.
targetLine This property is required. Number
Line number in target version where changes begin.
targetSpan This property is required. Number
Number of lines chunk spans in target version.

GetRepositoryFileDiffChangeDiffSection

Lines This property is required. List<GetRepositoryFileDiffChangeDiffSectionLine>
The lines within changed section.
Type This property is required. string
Type of change.
Lines This property is required. []GetRepositoryFileDiffChangeDiffSectionLine
The lines within changed section.
Type This property is required. string
Type of change.
lines This property is required. List<GetRepositoryFileDiffChangeDiffSectionLine>
The lines within changed section.
type This property is required. String
Type of change.
lines This property is required. GetRepositoryFileDiffChangeDiffSectionLine[]
The lines within changed section.
type This property is required. string
Type of change.
lines This property is required. Sequence[devops.GetRepositoryFileDiffChangeDiffSectionLine]
The lines within changed section.
type This property is required. str
Type of change.
lines This property is required. List<Property Map>
The lines within changed section.
type This property is required. String
Type of change.

GetRepositoryFileDiffChangeDiffSectionLine

BaseLine This property is required. int
The number of a line in the base version.
ConflictMarker This property is required. string
Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
LineContent This property is required. string
The contents of a line.
TargetLine This property is required. int
Line number in target version where changes begin.
BaseLine This property is required. int
The number of a line in the base version.
ConflictMarker This property is required. string
Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
LineContent This property is required. string
The contents of a line.
TargetLine This property is required. int
Line number in target version where changes begin.
baseLine This property is required. Integer
The number of a line in the base version.
conflictMarker This property is required. String
Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
lineContent This property is required. String
The contents of a line.
targetLine This property is required. Integer
Line number in target version where changes begin.
baseLine This property is required. number
The number of a line in the base version.
conflictMarker This property is required. string
Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
lineContent This property is required. string
The contents of a line.
targetLine This property is required. number
Line number in target version where changes begin.
base_line This property is required. int
The number of a line in the base version.
conflict_marker This property is required. str
Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
line_content This property is required. str
The contents of a line.
target_line This property is required. int
Line number in target version where changes begin.
baseLine This property is required. Number
The number of a line in the base version.
conflictMarker This property is required. String
Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
lineContent This property is required. String
The contents of a line.
targetLine This property is required. Number
Line number in target version where changes begin.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi