On Mon, Jul 20, 2015 at 10:16 AM, Julia Lawall <julia.lawall@xxxxxxx> wrote: > > > On Mon, 20 Jul 2015, Luis R. Rodriguez wrote: > >> On Mon, Jul 20, 2015 at 9:27 AM, Julia Lawall <julia.lawall@xxxxxxx> wrote: >> >> > Do you need patches 2 and 3? >> >> >> >> Do you mean I should squash them together, or something else ? >> > >> > I meant that since --use-git is able to cope with receiving a subtree of a >> > git repository, because git itself is able to cope with that, perhaps you >> > don't need them at all. It seems like you are redoing all the work that >> > git already does. >> >> Ah, well so although --use-gitgrep has its own heuristics for >> determining if gitgrep can correctly be used or not we still need >> something to figure out if it toggle --use-gitgrep or not as I do not >> think Coccinelle automatically tries to make use of --use-gitgrep >> unless otherwise specified, please correct me if I'm wrong. That is, >> if no indexing arguments are passed does Coccinelle figure out on its >> own whether or not to use --use-glimpse, --use-gitgrep and as a last >> resort --use-coccigrep ? This is what pycocci is doing here. Other >> than this another reason for the git class in this series is for >> Coccinelle SmPL patch equivalence proof support, that uses git to >> create branches for the patch version of changes, then the smpl >> version of changes, and finally 'git diff --stat between these two'. > > Not sure to understand. If there is glimpse information in the specified > directory, then it would be reasonable to use glimpse. If there is > glimpse information in a parent directory, I don't think that using > glimpse would be a good idea. In any case, there is no code to handle > that. Indeed. > Otherwise, if you give the argument --use-gitgrep, and the git command > fails (not just that it doesn't find anything, but that it actually > fails), then it will fall back to --use-coccigrep. Ah, so it should be safe to just check for the glimpse index on the target directory, use it if its there, otherwise default to using --use-gitgrep as a second step should be safe, regardless of whether or not the target (directory or file) is part of a git tree? > On the other hand, maybe the git detection is necessary for the > equivalence check. That would be, but the other check seems to be doing double work if I understand correctly as you note. Luis -- To unsubscribe from this list: send the line "unsubscribe backports" in