Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.DevOps.getRepositoryFileDiff
Explore with Pulumi AI
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,
});
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)
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
	})
}
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,
    });
});
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());
    }
}
variables:
  testRepositoryFileDiff:
    fn::invoke:
      function: oci:DevOps:getRepositoryFileDiff
      arguments:
        baseVersion: ${repositoryFileDiffBaseVersion}
        repositoryId: ${testRepository.id}
        targetVersion: ${repositoryFileDiffTargetVersion}
        filePath: ${repositoryFileDiffFilePath}
        isComparisonFromMergeBase: ${repositoryFileDiffIsComparisonFromMergeBase}
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>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]func GetRepositoryFileDiff(ctx *Context, args *GetRepositoryFileDiffArgs, opts ...InvokeOption) (*GetRepositoryFileDiffResult, error)
func GetRepositoryFileDiffOutput(ctx *Context, args *GetRepositoryFileDiffOutputArgs, opts ...InvokeOption) GetRepositoryFileDiffResultOutput> 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)
}public static CompletableFuture<GetRepositoryFileDiffResult> getRepositoryFileDiff(GetRepositoryFileDiffArgs args, InvokeOptions options)
public static Output<GetRepositoryFileDiffResult> getRepositoryFileDiff(GetRepositoryFileDiffArgs args, InvokeOptions options)
fn::invoke:
  function: oci:DevOps/getRepositoryFileDiff:getRepositoryFileDiff
  arguments:
    # arguments dictionaryThe following arguments are supported:
- BaseVersion string
- The branch to compare changes against.
- FilePath string
- A filter to return only commits that affect any of the specified paths.
- RepositoryId string
- Unique repository identifier.
- TargetVersion string
- The branch where changes are coming from.
- IsComparison boolFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- BaseVersion string
- The branch to compare changes against.
- FilePath string
- A filter to return only commits that affect any of the specified paths.
- RepositoryId string
- Unique repository identifier.
- TargetVersion string
- The branch where changes are coming from.
- IsComparison boolFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- baseVersion String
- The branch to compare changes against.
- filePath String
- A filter to return only commits that affect any of the specified paths.
- repositoryId String
- Unique repository identifier.
- targetVersion String
- The branch where changes are coming from.
- isComparison BooleanFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- baseVersion string
- The branch to compare changes against.
- filePath string
- A filter to return only commits that affect any of the specified paths.
- repositoryId string
- Unique repository identifier.
- targetVersion string
- The branch where changes are coming from.
- isComparison booleanFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- base_version str
- The branch to compare changes against.
- file_path str
- A filter to return only commits that affect any of the specified paths.
- repository_id str
- Unique repository identifier.
- target_version str
- The branch where changes are coming from.
- is_comparison_ boolfrom_ merge_ base 
- Boolean to indicate whether to use merge base or most recent revision.
- baseVersion String
- The branch to compare changes against.
- filePath String
- A filter to return only commits that affect any of the specified paths.
- repositoryId String
- Unique repository identifier.
- targetVersion String
- The branch where changes are coming from.
- isComparison BooleanFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
getRepositoryFileDiff Result
The following output properties are available:
- AreConflicts boolIn File 
- Indicates whether the changed file contains conflicts.
- BaseVersion string
- Changes
List<GetRepository File Diff Change> 
- 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
- IsComparison boolFrom Merge Base 
- AreConflicts boolIn File 
- Indicates whether the changed file contains conflicts.
- BaseVersion string
- Changes
[]GetRepository File Diff Change 
- 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
- IsComparison boolFrom Merge Base 
- areConflicts BooleanIn File 
- Indicates whether the changed file contains conflicts.
- baseVersion String
- changes
List<GetRepository File Diff Change> 
- 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
- isComparison BooleanFrom Merge Base 
- areConflicts booleanIn File 
- Indicates whether the changed file contains conflicts.
- baseVersion string
- changes
GetRepository File Diff Change[] 
- 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
- isComparison booleanFrom Merge Base 
- are_conflicts_ boolin_ file 
- Indicates whether the changed file contains conflicts.
- base_version str
- changes
Sequence[GetRepository File Diff Change] 
- 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_ boolfrom_ merge_ base 
- areConflicts BooleanIn File 
- 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
- isComparison BooleanFrom Merge Base 
Supporting Types
GetRepositoryFileDiffChange    
- BaseLine int
- The number of a line in the base version.
- BaseSpan int
- Number of lines chunk spans in base version.
- DiffSections List<GetRepository File Diff Change Diff Section> 
- List of difference section.
- TargetLine int
- Line number in target version where changes begin.
- TargetSpan int
- Number of lines chunk spans in target version.
- BaseLine int
- The number of a line in the base version.
- BaseSpan int
- Number of lines chunk spans in base version.
- DiffSections []GetRepository File Diff Change Diff Section 
- List of difference section.
- TargetLine int
- Line number in target version where changes begin.
- TargetSpan int
- Number of lines chunk spans in target version.
- baseLine Integer
- The number of a line in the base version.
- baseSpan Integer
- Number of lines chunk spans in base version.
- diffSections List<GetRepository File Diff Change Diff Section> 
- List of difference section.
- targetLine Integer
- Line number in target version where changes begin.
- targetSpan Integer
- Number of lines chunk spans in target version.
- baseLine number
- The number of a line in the base version.
- baseSpan number
- Number of lines chunk spans in base version.
- diffSections GetRepository File Diff Change Diff Section[] 
- List of difference section.
- targetLine number
- Line number in target version where changes begin.
- targetSpan number
- Number of lines chunk spans in target version.
- base_line int
- The number of a line in the base version.
- base_span int
- Number of lines chunk spans in base version.
- diff_sections Sequence[GetRepository File Diff Change Diff Section] 
- List of difference section.
- target_line int
- Line number in target version where changes begin.
- target_span int
- Number of lines chunk spans in target version.
- baseLine Number
- The number of a line in the base version.
- baseSpan Number
- Number of lines chunk spans in base version.
- diffSections List<Property Map>
- List of difference section.
- targetLine Number
- Line number in target version where changes begin.
- targetSpan Number
- Number of lines chunk spans in target version.
GetRepositoryFileDiffChangeDiffSection      
- Lines
List<GetRepository File Diff Change Diff Section Line> 
- The lines within changed section.
- Type string
- Type of change.
- Lines
[]GetRepository File Diff Change Diff Section Line 
- The lines within changed section.
- Type string
- Type of change.
- lines
List<GetRepository File Diff Change Diff Section Line> 
- The lines within changed section.
- type String
- Type of change.
- lines
GetRepository File Diff Change Diff Section Line[] 
- The lines within changed section.
- type string
- Type of change.
- lines
Sequence[GetRepository File Diff Change Diff Section Line] 
- The lines within changed section.
- type str
- Type of change.
- lines List<Property Map>
- The lines within changed section.
- type String
- Type of change.
GetRepositoryFileDiffChangeDiffSectionLine       
- BaseLine int
- The number of a line in the base version.
- ConflictMarker 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 string
- The contents of a line.
- TargetLine int
- Line number in target version where changes begin.
- BaseLine int
- The number of a line in the base version.
- ConflictMarker 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 string
- The contents of a line.
- TargetLine int
- Line number in target version where changes begin.
- baseLine Integer
- The number of a line in the base version.
- conflictMarker 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 String
- The contents of a line.
- targetLine Integer
- Line number in target version where changes begin.
- baseLine number
- The number of a line in the base version.
- conflictMarker 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 string
- The contents of a line.
- targetLine number
- Line number in target version where changes begin.
- base_line int
- The number of a line in the base version.
- conflict_marker 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 str
- The contents of a line.
- target_line int
- Line number in target version where changes begin.
- baseLine Number
- The number of a line in the base version.
- conflictMarker 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 String
- The contents of a line.
- targetLine 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 ociTerraform Provider.