Repository navigation
feature: add fulltext commit search across SHA/author/committer/message (implements #985) - #2543
mdindoffer wants to merge 2 commits into
Conversation
9e2c50e to
9194736
Compare
|
@love-linger Are you accepting pull requests? I tested this manually on my local build, I did not find any issues. What do you think about calling this option "All" if it does not include the path/content search? Should I rename it to something like "Metadata" instead? |
|
Sorry for the delayed reply. I do not think we need this feature.
|
|
Could you please elaborate on why do you think this is "unhelpful"? I would argue this is a very nice usability improvement, for the justification see the original issue #985 . When you are searching for multiple "things" in succession you would have to always pick and select the appropriate item from the dropdown, now you finally have a fulltext search where you can copy&paste the commit SHA and the author email and so on. The performance is OK, I tested this on a repository with thousands of commits, it was instantaneous. Saving 2-3 mouse clicks per user interaction is a usability design win. When you look for UX best practices for implementing search functionality, they always mention a unified index is a cornerstone: |
|
I think I have explained it very clearly - it will take too long time. For example: with your PR, seaching a simple string |
c8ba2ff to
4c7e0e5
Compare
617e0c1 to
ec12af3
Compare
…ge (sourcegit-scm#985) Git cannot OR --grep/--author/--committer in a single invocation, so the new `All` method (now the default) runs the field queries separately, plus an exact-SHA lookup, and merges the deduplicated results sorted by commit time. Adds an internal-only `ByCommitter` query mode to power it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9194736 to
6d59768
Compare
Git ANDs --grep/--author/--committer within a single invocation, so the `All` search needs one `git log` per field. Each of those is a full history walk on large repositories, and running them one after another multiplied the wall time by the number of fields (10+ seconds on the Unreal Engine repo versus under 5 for a single-field search). Run the message query, the author query and the exact-SHA lookup concurrently with Task.WhenAll so wall time stays close to a single-field search. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
OK, I reworked the implementation. Now, it runs the search in parallel by awaiting on This should on a multicore system bring back the performance of the search on par with the other search modes. @love-linger Could you please give this another chance? |
Summary
This PR adds a "fulltext" search capability to perform a unified search across multiple commit fields at once, which was refused a year ago in #985 due to time constraints.
How & why
Git has no bult-in logical "OR"
--grep/--author/--committerin a single invocation, so the newAllmethod (now the default) runs the field queries separately, plus an exact-SHA lookup, and merges the deduplicated results sorted by commit time. Adds an internal-onlyByCommitterquery mode to power it.Disclaimer
This was done with the help of Claude, as I have not done any C# development in the last 8 years. Feel free to reject on maintainability concerns.