You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@zkry Probably the discussion section on GitHub would be better for this but it looks that it's not enabled for this repository.
I've no idea if this is really doable and how coherent with p-search goals is, but I would love to also see candidates from past commits, similar to what one gets with git grep "string" $(git rev-list <commit_a>..<commit_b> (probably searching across all commits by default may be a bad idea, especially on big/old repos...)
What do you think?
The text was updated successfully, but these errors were encountered:
Thanks for reaching out! As it turns out, this is a feature that has crossed my mind too and is definitely in line with what p-search is intended for. There are a couple of ways that this could be implemented with varying levels of effort. I'll write my initial thoughts for future reference when I'm available to work on this:
Perhaps the simplest way to implement this would be to add a new search tool (alongside the currently existing rg, ag, grep) for git grep. This should be a rather simple way to implement this, except there'd need to be a way to specify commit ranges for which nothing exists yet.
Other possible implementations are:
creating a new candidate generator specifically to search git history. This could then set the content to be the history of all revisions. There could be a candidate for each revision.
A mapping could be created to tack-on the contents of specified revisious. Search for this would be slow though and incorporating this with git grep rouldn't be trivial.
Create a specialized prior for git repositories to do git grep. This would require re-implementing the BM25 algorithm. Also, there would be no way to view the preview the match if it was in a previous revision.
I'll add this feature to my batch of upcoming features to work on.
@zkry Probably the discussion section on GitHub would be better for this but it looks that it's not enabled for this repository.
I've no idea if this is really doable and how coherent with
p-search
goals is, but I would love to also see candidates from past commits, similar to what one gets withgit grep "string" $(git rev-list <commit_a>..<commit_b>
(probably searching across all commits by default may be a bad idea, especially on big/old repos...)What do you think?
The text was updated successfully, but these errors were encountered: