Proposed function path_in_directory() [was: Re: [PATCH v2 8/9] longest_ancestor_length(): resolve symlinks before comparing paths]

2012-10-06 Thread Michael Haggerty
On 10/01/2012 06:51 AM, Michael Haggerty wrote: > I think I would advocate that the prefix has to match the front of the > path exactly (including any trailing slashes) and either > > strlen(prefix) == 0 > or the prefix ended with a '/' > or the prefix and path are identical > or t

Re: [PATCH v2 8/9] longest_ancestor_length(): resolve symlinks before comparing paths

2012-09-30 Thread Junio C Hamano
Michael Haggerty writes: > I think I would advocate that the prefix has to match the front of > the path exactly (including any trailing slashes) and either > > strlen(prefix) == 0 > or the prefix ended with a '/' > or the prefix and path are identical > or the character in path f

Re: [PATCH v2 8/9] longest_ancestor_length(): resolve symlinks before comparing paths

2012-09-30 Thread Michael Haggerty
On 09/30/2012 10:00 AM, Junio C Hamano wrote: > Michael Haggerty writes: > >> longest_ancestor_length() relies on a textual comparison of directory >> parts to find the part of path that overlaps with one of the paths in >> prefix_list. But this doesn't work if any of the prefixes involves a >>

Re: [PATCH v2 8/9] longest_ancestor_length(): resolve symlinks before comparing paths

2012-09-30 Thread Junio C Hamano
Michael Haggerty writes: > longest_ancestor_length() relies on a textual comparison of directory > parts to find the part of path that overlaps with one of the paths in > prefix_list. But this doesn't work if any of the prefixes involves a > symbolic link, because the directories will look diffe

[PATCH v2 8/9] longest_ancestor_length(): resolve symlinks before comparing paths

2012-09-28 Thread Michael Haggerty
longest_ancestor_length() relies on a textual comparison of directory parts to find the part of path that overlaps with one of the paths in prefix_list. But this doesn't work if any of the prefixes involves a symbolic link, because the directories will look different even though they might logical