Skip to content

merge commits in the SoT repo obliterate actual git history #314

Open
@petergaultney

Description

@petergaultney

we have an internal repo that we open source parts of.

the internal repo has the correct git blame on every line.

the external repo has the correct current code - but completely wrong git blame. Every line is a merge commit that had nothing to do with the file (indeed, nothing to do with anything anywhere near the file!).

the relevant bit of our config is

core.workflow(
    name="open-source",
    mode="ITERATIVE",
    origin=git.origin(
        url="file://INTERNAL_REPO_PATH_PLACEHOLDER",
        # this looks goofy, but I have been unable to find any alternative that will work
        # with dynamic input paths.
        # see https://github.com/google/copybara/issues/142#issuecomment-1782115935
        ref="HEAD",
        first_parent=False,  # try to get the underlying branch commits instead of just the merge commits.
        partial_fetch=True,
    ),
    destination=git.destination(
        url="file://EXTERNAL_REPO_PATH_PLACEHOLDER",
        fetch="main",
        push="open-source",
    ),
)

there must be something i'm doing wrong with our config, but I can't figure out what it is...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions