Git Product home page Git Product logo

Comments (6)

mikelalcon avatar mikelalcon commented on May 6, 2024 1

Hi!

K, IIUC you have a .copybara/public/README.md that you want to include despite excluding.copybara. You can do that by doing :

 origin_files = glob(["**"], exclude = ["copy.bara.sky", ".copybara/**", "Jenkinsfile", "README.md"]) + glob([".copybara/public/README.md"]),

Glob can be added. And the semantic is 'OR'. So this would exclude all .copybara files except .copybara/public/README.md.

The second thing you would do is:

core.move(".copybara/public/README.md", "README.md"))

Note that this transformation is reversible. A good property to have for accepting CHANGE_REQUEST contributions from the public repo.

Last thing, about testing it locally :)

This is how I usually test things locally. I found it to be the most convenient way (because you can use a non bare repo):

rm -rf /tmp/local_repo; copybara foo/copy.bara.sky workflow --dry-run --git-destination-path /tmp/local_repo

Then /tmp/local_repo is a non-bare repo with remote origin set to the remote repo and with the created commits in the checked in branch.

from copybara.

DarthHater avatar DarthHater commented on May 6, 2024

That's about what I was looking for! Thanks for the explanation, I'll give it a go.

from copybara.

mikelalcon avatar mikelalcon commented on May 6, 2024

Great! feel free to reopen if it doesn't work.

from copybara.

DarthHater avatar DarthHater commented on May 6, 2024

This worked fairly well! However, if the file doesn't exist in the early commits of the project, it'll barf. What I ended up doing was running it without this config until we'd migrated out everything sans the internal file, and then modified it to do the move of the file.

from copybara.

mikelalcon avatar mikelalcon commented on May 6, 2024

Another option is to wrap core.move in https://github.com/google/copybara/blob/master/docs/reference.md#core.transform

and set ignore_noop = True.

note that this should be temporary since we don't recommend permanent ignore_noops.

from copybara.

jdillon avatar jdillon commented on May 6, 2024

BTW, looks like for an initial migrate with transformations with core.move where early revisions do not have this, can also be done with cli option --ignore-noop to limit the noop handling just for that first --init-history migration.

from copybara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.