On Mon, Jan 28, 2013 at 1:30 PM, Petr P <[email protected]> wrote: > > 2013/1/28 Richard Hipp <[email protected]> > >> >> I haven't yet figure out the right syntax for doing a grep of files in >> the repository. The implementation should be relatively easy once the >> right interface is designed. Suggestions are welcomed. >> > > I think there are three use cases: (1) searching timeline, (2) searching > current code, (3) searching code history. >
Good analysis. But perhaps more is needed. I think hg, for example, provides (4) the ability to grep back through the history of a file looking for the most recent version that matches (or does not match) some regexp. > > (1) can be done now by "fossil timeline | grep ..." but having it > integrated would be much easier to work with (and also available to Windows > users). I'd suggest simply adding a parameter with a regexp, which would > filter only those timeline items that match it. > > For (2) and (3) we can lear how "git grep" does it and also what are its > shortcomings. I found this q/a: > "How to grep (search) committed code in the git history?" < > http://stackoverflow.com/q/2928584/1333025> > It seems that while (3) is easy with git, it requires some shell features > that could be problematic on Windows. What about this: > fossil grep regex [path..] > would grep current working tree, optionally limited to the given path. And > fossil grep --some-param regex1 regex [path...] > would grep with "regex" those historical versions whose commit message or > hash matches "regex1". This way, we could flexibly search specific hashes, > look for a certain feature, or grep everything with > fossil grep --some-param "" regex > > [Note that (2) can be done now by something like "fossil ls|xargs grep > ..." on Linux systems.] > > Best regards, > Petr Pudlak > > _______________________________________________ > fossil-users mailing list > [email protected] > http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users > > -- D. Richard Hipp [email protected]
_______________________________________________ fossil-users mailing list [email protected] http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

