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

Deleting files on up file sync #149

Merged
merged 2 commits into from
Jun 26, 2015
Merged

Deleting files on up file sync #149

merged 2 commits into from
Jun 26, 2015

Conversation

EvanK
Copy link
Contributor

@EvanK EvanK commented Jun 19, 2015

It appears that, on sync from remote to local, we are removing any destination files that don't exist on source.

However, on sync from local to remote, we are not.

/cc @ericrasch

@EvanK EvanK self-assigned this Jun 19, 2015
* added `--delete` to remove files on destination that don't exist on source
* added `--copy-links` to copy _content_ of symlinks as files, rather than preserving links
* removed `--keep-dirlinks` to preserve symlink directories as links

This is a **potentially breaking change**
@EvanK EvanK changed the title Deleting files on up file sync [RFC] Deleting files on up file sync Jun 19, 2015
@EvanK
Copy link
Contributor Author

EvanK commented Jun 19, 2015

As this could potentially break sites that rely on preserving remote symlinks, it should be merged and released with care.

I don't recall why this behavior was different for up than down, but I checked and Evolution does not have this issue.

Pinging @ericclemmons to see if it rings any bells for him

@ericrasch
Copy link
Contributor

For background, we're needing this delete/sync capability in order to remove files in folders that aren't committed to repos, namely the /wp-content/uploads/ folder where exploit/hack files are being dropped-in and need removal.

@ericclemmons
Copy link
Contributor

The original logic was:

  • Remote will always be ahead of master because of content, uploaded images, and plugins modifying the file system. Therefore, when syncing down, if a file is missing on remote, it's best to know reflect that within the repo since this is a significant difference.
  • Conversely, local wouldn't delete any remote files because users & plugins are modifying the file system beyond what's in master. Remember that /wp-content/uploads is normally not committed to the repo for size reasons and that it's considered a "DB".

I agree with @ericrasch that there needs to be a way to have a "clean slate", but I'm not 100% sure what that would be.

Each deployment technically starts "fresh" with a new git clone, but the shared_folders, not being versioned, remain between deployments.

I honestly don't know what the best solution is. We trust wp-content/uploads the same as we trust the MySQL DB: any cleanup is largely manual because it's expected to be pristine.

Any ideas?

@ericrasch
Copy link
Contributor

What about keeping everything as-is, so genesis:up:files is still safe-guarded, but adding another command which allows for the clean slate. How about something like genesis:up:mirror which would allow for the removal/deletion of files on the remote site?

@ericclemmons
Copy link
Contributor

👍 Great suggestion! genesis:up:mirror seems very clear to me. I almost considered genesis:up:files --force, but...switches suck :)

@ericrasch
Copy link
Contributor

Thumbs down?

@ericclemmons
Copy link
Contributor

Not according to this screen shot after I edited the typo :)

screen shot 2015-06-19 at 9 49 15 pm

@EvanK
Copy link
Contributor Author

EvanK commented Jun 25, 2015

Implemented!

@EvanK EvanK changed the title [RFC] Deleting files on up file sync Deleting files on up file sync Jun 26, 2015
EvanK added a commit that referenced this pull request Jun 26, 2015
@EvanK EvanK merged commit 04a6445 into master Jun 26, 2015
@EvanK
Copy link
Contributor Author

EvanK commented Jun 29, 2015

@ericrasch Fixed copy-links bug as of v0.2.60

@ericrasch
Copy link
Contributor

Thanks, @EvanK, works great!

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

Successfully merging this pull request may close these issues.

3 participants