> On Jan. 27, 2016, 10:06 p.m., Benjamin Bannier wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp, line 68 > > <https://reviews.apache.org/r/42860/diff/2/?file=1224085#file1224085line68> > > > > I am extremely confused about the expected semantics of this function > > (e.g. `EXPECT_SOME_EQ("/", path::sameParent({"/usr", "/", "/tmp"}));`?). I > > feel developing an intuition would be easier would this function take just > > two args (but am unsure); also, the name seems to suggest this returning > > some `bool` type which it doesn't. > > > > Looking at the implementation isn't too helpful either due to the > > complicated control flow. It should in principle be possible to simplify > > this by separating extracting path components and their comparisons, but am > > unsure if this is something we need for the intended use case from the > > follow-up patch. > > haosdent huang wrote: > Thank you very much for your review. Do you mean change `sameParent` to > other names here?
If you can, yes, but I am unsure this is a useful enough primitive for `path`s. You should find a shepherd and discuss this with him/her. I'd imagine that if you'd provide something to e.g. find a common prefix for a list of `path`s one might be able to reuse that functionality elsewhere; to get the functionality you need you could then check if that common prefix is already in the given list (that would be in your next patch, not here in stout). - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/42860/#review116606 ----------------------------------------------------------- On Jan. 28, 2016, 3:12 a.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/42860/ > ----------------------------------------------------------- > > (Updated Jan. 28, 2016, 3:12 a.m.) > > > Review request for mesos, Jie Yu and Joris Van Remoortere. > > > Bugs: MESOS-4521 > https://issues.apache.org/jira/browse/MESOS-4521 > > > Repository: mesos > > > Description > ------- > > Add paths::sameParent to find out the same root of a path list. > > > Diffs > ----- > > 3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp > ef538045a8b7a1e3d8962c869317d86a85e0259f > 3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp > 6dff5e76e0e15098c5a262adc50bfcb65f933697 > > Diff: https://reviews.apache.org/r/42860/diff/ > > > Testing > ------- > > > Thanks, > > haosdent huang > >