On Thu, 12 Jan 2017 00:40:36 -0500, Matt Harbison wrote: > On Wed, 11 Jan 2017 09:15:28 -0500, Yuya Nishihara <y...@tcha.org> wrote: > > I also like the idea of deprecating > > grep() since grep() sounds like searching the file contents. > > I don't have a strong feeling on that. If somebody makes a new search > function though, I wonder if it should be like revset.matching() (but with > stringmatcher support), where the user can control the fields searched, in > order to avoid this sort of ambiguity. I wouldn't want to fold grep() > into author() because of the clashing case sensitive/insensitive you > mention below.
Fair enough. (and my feeling wasn't strong neither.) > >> That leaves only 'author' and 'desc' as not providing the full > >> functionality of the others. > >> > >> > C) If we do A + B, that means 'desc' is the only oddball left. I > >> don't > >> > like the idea that case sensitivity for a raw pattern and a 'literal:' > >> > prefixed pattern would differ. They are both literals in my mind, and > >> > it would be the one remaining exception. The 're:' prefix could > >> follow > >> > regular rules. > > > > I won't insist that 'literal:' must be case-sensitive (because of (A).) > > However, I would guess 're:' is also case-insensitive if 'literal:' is. > > In my mindset, desc() is a case-insensitive matcher in that case. > > > > So I lean towards adding case-insensitive desc('re:'), which would be at > > least > > consistent in that desc() always ignores cases. > > The only reason I would guess 're:' is case sensitive, is because I've > never run into one that hasn't been. I do like the consistency argument > though, so let's try that. I wonder if in addition to the > 'icase-literal:' you suggested, if this also means we need a 'case-re:', > since it doesn't look like you can force re.I off. I don't see any real > benefit for author(), but I can maybe see it for desc(). The series I'm > about to submit hints at the ability to add these with one or two lines. > See what you think. Honestly I just postponed the consideration about case-sensitive desc() by this design. ;) I'm not a fan of 'case-re:' because 're:' is case-sensitive in most revset functions. I'd rather add new case-sensitive desc() or more general function. I found (?-i:...) syntax, but that's Python 3.6 thing, sigh. https://docs.python.org/3/library/re.html _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel