这是indexloc提供的服务,不要输入任何密码
Skip to content

Support the use case of not using mergebase for --since #514

@SamChou19815

Description

@SamChou19815

Describe the feature you'd like to request

I am trying to integrate turborepo in my GitHub actions workflow.

I want to avoid checking out the entire history, so I tried to only check out two commits: the base commit and the merge commit of the pull request. Then I want to use --since=[base-commit] to only rebuild what has been affected by the request.

However, this will result in a fatal error due to these lines:

if fromCommit != "" {
// Grab the diff from the merge-base to HEAD using ... syntax. This ensures we have just
// the changes that have occurred on the current branch.
command = []string{"diff", "--name-only", fromCommit + "...HEAD"}
out, err = exec.Command("git", append(command, relSuffix...)...).CombinedOutput()
if err != nil {
log.Fatalf("unable to check diff vs. %s: %s", fromCommit, err)
}
committedChanges := strings.Split(string(out), "\n")
files = append(files, committedChanges...)
}

Example of failed run: https://github.com/SamChou19815/infra/pull/25

When using three dots, git will try to find the mergebase between the two commits, which usually does not exist when you only checkout two isolated commits. I would like to support the use case so I don't have to checkout the entire history just for an incremental build from turborepo.

Describe the solution you'd like

An option that runs git diff --name-only fromCommit..HEAD under the hood would be great.

Describe alternatives you've considered

Use build cache instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ergonomicsIssues and features impacting the developer experience of using turbo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions