buildfoundation / mainframer

Tool for remote builds. Sync project to remote machine, execute command, sync back.
Apache License 2.0
1.73k stars 162 forks source link

Whitelist/Include mode. #219

Open artem-zinnatullin opened 6 years ago

artem-zinnatullin commented 6 years ago

On our big project I'm constantly facing issue of syncing too much unnecessary data thus have to explicitly ignore lots of different entries.

Another problem is that if you change some source files locally during remote execution, Mainframer can override them with remote version after Sync remote → local machine...

To solve these issues we can give users a way to mix following rsync options:

--exclude=PATTERN exclude files matching PATTERN --exclude-from=FILE read exclude patterns from FILE --include=PATTERN don't exclude files matching PATTERN --include-from=FILE read include patterns from FILE

So I could put * in .mainframer/remoteignore and then put build (to sync Gradle build output for example) in .mainframer/remoteinclude

@ming13 WDYT?

artem-zinnatullin commented 6 years ago

This won't be a breaking change btw

Pozzoooo commented 6 years ago

Global configuration are quite useful here :)

For the sync back I've added .kt and .java in the localignore

artem-zinnatullin commented 6 years ago

Yeah, in my case there are also files with no pattern in them

Also excluding everything by default and whitelisting what you want to sync might make rsync faster during fs lookup, I'll need to benchmark this though

arturdryomov commented 6 years ago

Sounds good, but isn’t it gonna complicate things by a certain magnitude? I. e. you should keep in mind which files are included and excluded and what the resolution would be in the end. I’m talking about the user perspective BTW.

What about a radical idea to replace excludes with includes only?

artem-zinnatullin commented 6 years ago

Well, yeah I've thought about includes-only but idk, you can get exact same problem but upside down.

What I like about current proposal is that it's not breaking change or complication, but rather an additional feature.

Also, git has similar concept with ! to unignore stuff.

arturdryomov commented 6 years ago

Then sure thing, let’s do it!

vganin commented 5 years ago

Hi, is this feature going to make to 2.x? It might come very handy.