Repository navigation
bisync: add overlapping paths check - #7515
Merged
Merged
Conversation
nielash
marked this pull request as ready for review
December 18, 2023 18:44
5 tasks done
This was referenced Jan 18, 2024
Before this change, Bisync did not check to make sure that Path1 and Path2 do not overlap, nor did it check for overlaps with `--backup-dir`. While `sync` does check for these things, it can sometimes be fooled because of the way Bisync calls it with `--files-from` filters. Relying on sync could also leave a run in a half-finished state if it were to error in one direction but not the other (`--backup-dir` only checks for overlaps with the dest.) After this change, Bisync does its own check up front, so we can quickly return an error and exit before any changes are made.
Before this change, certain shell quoting / escaping errors (particularly on Windows) were not detected by Bisync, possibly resulting in incorrect expansion and confusing errors. In particular, Windows paths with a single trailing backslash followed by a quote would be interpreted as an escaped quote -- resulting in the quote and subsequent flags being erroneously considered part of the path. After this change, Bisync specifically checks for a few of the most common patterns, and if detected, exits with a more helpful error message before doing any damage.
nielash
force-pushed
the
bisync-overlap-check
branch
from
January 20, 2024 21:33
0aece34 to
2a58207
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(This PR is dependent on #7410, #7497, #7498, and #7501 -- only 1 commit is new 🙂 )
What is the purpose of this change?
Before this change, Bisync did not check to make sure that Path1 and Path2 do not overlap, nor did it check for overlaps with
--backup-dir. Whilesyncdoes check for these things, it can sometimes be fooled because of the way Bisync calls it with--files-fromfilters. Relying on sync could also leave a run in a half-finished state if it were to error in one direction but not the other (--backup-dironly checks for overlaps with the dest.)After this change, Bisync does its own check up front, so we can quickly return an error and exit before any changes are made.
Was the change discussed in an issue or in the forum before?
Checklist