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

.driveignore behavior is difficult to predict #1030

Open
khenriks opened this issue Aug 26, 2018 · 0 comments
Open

.driveignore behavior is difficult to predict #1030

khenriks opened this issue Aug 26, 2018 · 0 comments

Comments

@khenriks
Copy link

I've been trying to set up drive so that when I run drive pull it will only pull the whitelisted files/directories I specify. This kind of turns the .driveignore file on its head, since it's meant to exclude rather than include. I was able to make it work thanks to the work in #535, but it doesn't seem to be fully documented, and I've had a lot of trouble making it make sense.

Eventually, I ended up modifying the regex matching function so it would print out what it was doing, and I found the following behavior:

  1. The regexes listed are matched against the full path from the drive root, including a leading slash.
  2. The regexes are matched against the file name by itself.
  3. At the beginning, a single "/" is matched, as well as the full path to the drive root on the filesystem (e.g. /home/khenriks/myDrive).

If any of these matches indicates a file/path is excluded, then it is.

The behavior in 1 and 2 is non-obvious, but if it were documented it doesn't seem too challenging to work with. But the behavior in 3 seems very strange to me. I can't see any reason someone would want to exclude the entire drive folder, and also matching against the path on disk also doesn't seem useful. I think it would be good to skip 3 entirely.

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

No branches or pull requests

1 participant