You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarify how multi-directory ignore patterns like "foo/bar/" shall behave #5275
the pattern "moo/" matches, for example, the paths "map/moo/" and "moo/"
And that works as it should.
However, which paths should a pattern that spans multiple directories match?
"foo/bar/" (currently matches "foo/bar/" and NOT "any/foo/bar/")
"*/bar/" (currently matches "any/bar/" and NOT "bar/" or "any1/any2/bar/")
And that's a bit surprising given how "moo/" does match "any/moo/". It also limits expressivity of patterns since one could always get back to the current behavior by anchoring the pattern with a starting "/".
On the other hand, there will be users who depend exactly on the current behavior of ignore patterns.
@guruz I've checked what changing the behavior would look like (see patch above) and am wondering whether it wouldn't be simpler to create a custom path-matching function instead of trying to write this in terms of fnmatch. Didn't you have an attempt of replacing this with regular expressions?
We benchmarked that the regexp approach is faster. (at least on OS X and Windows)
@ckamm Do I see it correctly that your branch changes for #4999 in ckamm@d6ad54c do the full path matching?
So we can make #4628 be fixed by your branch..
@guruz I vote for removing this ticket from 2.3. The current behavior works for users and merging #4999 is probably out of scope for 2.3. What's your opinion?
All existing patterns that contain a / that's not at the end get migrated to be anchored, e.g. "foo/bar" -> "^/foo/bar"
The behavior of patterns like "moo" is unchanged (match "/moo", "/foo/moo", not "/moooo", not "/omoo")
The behavior of new unanchored patterns is consistent with that (even if they contain a "/"): "foo/bar" matches "/foo/bar" and "/cow/foo/bar", i.e. anything with two consecutive path components where one is "foo" and the other is "bar".
The intention is to not change existing behavior at all, while removing the current unintuitive behavior.
The start of an implementation of this is in #4999. @guruz
This is now also needed to address the difference in pattern matching that existed between windows and unix platforms #6245
Concrete migration suggestion:
We deploy a system-wide sync-exclude-v2.lst with master
When master starts and finds a user-score exclude list, it creates a v2 version based on it
The goal is to have switching back and forth between old and new versions not be a huge pain.
Concrete v2 exclude config file could look like this
{
version: 2, // new, to make future work easier
excludes: [
{
pattern: "moo",
directory_only: true, // old trailing /
may_remove: true, // old ']' prefix
match_full_path: false, // new for this ticket, to allow 'moo/foo' patterns that match 'prefex/moo/foo'
star_matches_slash: true // for #6245, used when migrating old windows patterns
} // , ...
]
}
Activity
ckamm commentedon Oct 25, 2016
Current behavior in the code:
wip: Allow for mobile /-containing exclude patterns owncloud#5275
ckamm commentedon Oct 25, 2016
@guruz I've checked what changing the behavior would look like (see patch above) and am wondering whether it wouldn't be simpler to create a custom path-matching function instead of trying to write this in terms of
fnmatch. Didn't you have an attempt of replacing this with regular expressions?guruz commentedon Oct 26, 2016
(WiP is here: #4999 ... )
guruz commentedon Nov 23, 2016
We could agree to fix #4628 (what you reported above) by extending #4999
But then I need to benchmark this first..
guruz commentedon Dec 14, 2016
We benchmarked that the regexp approach is faster. (at least on OS X and Windows)
@ckamm Do I see it correctly that your branch changes for #4999 in ckamm@d6ad54c do the full path matching?
So we can make #4628 be fixed by your branch..
FYI @ogoffart
ckamm commentedon Jan 4, 2017
@guruz I think it does full matching. I recommend that once we have decided to merge #4999, we fix #4628 by adding tests for that.
ckamm commentedon Jan 11, 2017
@guruz I vote for removing this ticket from 2.3. The current behavior works for users and merging #4999 is probably out of scope for 2.3. What's your opinion?
ckamm commentedon Jan 17, 2017
Here's what I propose:
The intention is to not change existing behavior at all, while removing the current unintuitive behavior.
The start of an implementation of this is in #4999. @guruz
ckamm commentedon Dec 19, 2017
This is now also needed to address the difference in pattern matching that existed between windows and unix platforms #6245
Concrete migration suggestion:
sync-exclude-v2.lstwith masterThe goal is to have switching back and forth between old and new versions not be a huge pain.
Concrete v2 exclude config file could look like this