Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected files changed outside of the destination configuration #312

Open
claydiffrient opened this issue Feb 7, 2025 · 2 comments
Open

Comments

@claydiffrient
Copy link

Something seem to be odd in the way that Copybara handles files in the destination repository. It's changing files that I wouldn't expect to change.

I've set up a workflow with a configuration like this:

origin_files = glob([
  "readme.md",
  "LICENSE",
  "src/**",
]),
destination_files = glob([
   "third_party/package/**"
], exclude = [
   "third_party/package/copy.bara.sky"
]),
transformations = [
   core.move("", "third_party/package")
]

And then when I run it, I get a bunch of changes in my repository on several files that are outside of third_party/package. All of which appear to be differences in line endings. These changes don't exist outside of the branch that Copybara created and pushed up.

I'm wondering if the way Copybara detects changes when it pulls the destination repository is different or handled differently than the normal MacOS system does. But regardless, it seems like it should only be doing a git add third_party/package/ and ignore those things anyway.

@hsudhof
Copy link
Collaborator

hsudhof commented Feb 7, 2025

My guess would be that those deltas were introduced by your git CLI setup.

@claydiffrient
Copy link
Author

My guess would be that those deltas were introduced by your git CLI setup.

That's fair. I do have my git config set to core.autocrlf=input, so perhaps it's doing something like that.

I guess I'm still confused on why Copybara would handle it differently than at the system level. I'm assuming that Copybara respects the gitconfig? And then also why wouldn't it just add/commit/push the files that are explicitly intended to be added in the destination_files glob?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants