google / google/copybara

Unexpected merge importing a pull request

Open
#104 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.8k
Forks
345
PR merge metrics
No merged PRs in 30d

Description

When trying to import a pull request using the workflow:

```
core.workflow(
name = "import_pr",
mode = "CHANGE_REQUEST",
origin = git.github_pr_origin(
url = github_public_url,
branch = "master",
),
destination = git.destination(
url = github_sot_url,
fetch = "master",
),
origin_files = glob(["**"]),
destination_files = glob(
["somedir/**"],
exclude = [
"somedir/bfile",
],
),
authoring = authoring.pass_thru("Default email "),
transformations = [
core.move("", "somedir"),
metadata.save_author(),
metadata.expose_label("COPYBARA_INTEGRATE_REVIEW"),
metadata.expose_label("GITHUB_PR_NUMBER", new_name = "Closes", separator = " #"),
],
)
```

I get:

```
% copybara copy.bara.sky import_pr 1
Nov 09, 2019 2:51:27 PM com.google.copybara.Main configureLog
INFO: Setting up LogManager
Copybara source mover (Version: Unknown version)
Task: Integrating change from https://github.com/ob/cb-sot-public/pull/1 from ob:ob-patch-1 21171d13a57703bae681c45dd57b2e76bffb1ab5
ERROR: Conflict detected while rebasing /Users/obonilla/copybara/temp/workdir109556842962639907/checkout to d0b3be83ebc842c8dd6feae051391d7a82adf9b8. Please sync or update the change in the origin and retry. Git output was:
First, rewinding head to replay your work on top of it...
Applying: Project import generated by Copybara.
Applying: Project import generated by Copybara.
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
CONFLICT (add/add): Merge conflict in .gitignore
Auto-merging .gitignore
Patch failed at 0002 Project import generated by Copybara.
Resolve all conflicts manually, mark them as resolved with
"git add/rm ", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".

```

However, that pull request didn't change the `.gitignore` file so I didn't expect this to be a problem.

SoT repo: https://github.com/ob/cb-sot, exported repo: https://github.com/ob/cb-sot-public, PR that I'm trying to import: https://github.com/ob/cb-sot-public/pull/1

I don't see why Copybara is trying to merge the two `.gitignore` files, are they treated specially by globs?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.