Skip to content

Define and fully test the semantics of --ignore #36

Description

@defuse

--ignore has tricky semantics, see e.g. #35.

I think the intended behavior should be (this is NOT what it currently does)

  1. the ignored path has to either exist in the original or backup (verified to exist, and be in either original or backup before starting),
  2. the ignored path can either be relative to the roots being compared OR an absolute path OR a path relative to cwd. (Note: the two relative path cases are not mutually exclusive, we'd need to decide how to resolve that).
  3. in either case (relative or absolute), the ignore applies to the opposite side, i.e. if --ignore /home/original/foo is ignored, this automatically ignores backup/foo and vice-versa
  4. currently, report() does not ignore when the path given is the opposite side (I think?), but it probably should,
  5. ignore gets checked first, so --ignoring unreadable stuff won't generate errors, and ignoring mount points won't generate DIFFERENT-FS messages.
  6. with --follow, --ignore applies to the apparent path, not the actual path after symlink resolution (OPEN QUESTION: should it apply to the real path after symlink resolution, too? e.g. if original/foo -> original/abc and --ignore original/abc, does original/foo/x get ignored, or just original/abc/x? I think not because then before enumerating a directory we would have to understand every possible way it might be symlinked to, and there are probably examples where this would take exponential time to resolve, and it could lead to things being ignored by accident.)

Edit: See the comment in cli.rs; a lot of this has been fixed.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions