Skip to content

Add diffr search - #106

Open
sidkmenon wants to merge 4 commits into
search/plugin-contractfrom
search/review
Open

sidkmenon wants to merge 4 commits into
search/plugin-contractfrom
search/review

Conversation

@sidkmenon

Copy link
Copy Markdown
Contributor

Stacked on #105.

git grep … | diffr search BASE HEAD shapes each hit's file as a diff at the pinned commits, through the same context plugin as normal diffs; diffr search pprint renders the results. Computed diffs are cached as JSON files under [storage] path.

AI assistance: developed with Claude Code.

https://claude.ai/code/session_01Jcs63VAkAWzCT54XzdvDyb

DiffResult::from_sources_with_context parses an identical pair once and
gives both sides matching folds, so context can run on unchanged files.
Ordinary diffs keep the identical-source fast path.

AI assistance: developed with OpenAI Codex and Claude Code.

Agent-Session: 01a10126-800c-7922-a418-bb477c280cbd
Agent-Session: dca03de1-4350-4b24-b376-cb54c86fcc2d
Agent-Session: 9a22412a-b2b1-4e3a-a35d-e310f6846f29
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a103af-15d8-79c3-9da1-1dce5fa8bdc7
Agent-Session: 01a1061e-c424-7fa2-8db0-b8e0c93f5d16
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
Search keeps each query-independent diff as one JSON file, named by a
hash of its analysis settings and source identities and written
atomically. [storage] path sets the directory, .cache/diffr in the
repository by default.

AI assistance: developed with OpenAI Codex and Claude Code.

Agent-Session: 01a10126-800c-7922-a418-bb477c280cbd
Agent-Session: dca03de1-4350-4b24-b376-cb54c86fcc2d
Agent-Session: 9a22412a-b2b1-4e3a-a35d-e310f6846f29
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a103af-15d8-79c3-9da1-1dce5fa8bdc7
Agent-Session: 01a1061e-c424-7fa2-8db0-b8e0c93f5d16
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
A search Session pins a repository to two commits and classifies their
manifest. For each hit it loads or computes the file's cached diff and
marks the hit's line on the matching leaf, then runs the context plugin
on every file with a hit, unless the caller overrides the plugins.

AI assistance: developed with OpenAI Codex and Claude Code.

Agent-Session: 01a10126-800c-7922-a418-bb477c280cbd
Agent-Session: dca03de1-4350-4b24-b376-cb54c86fcc2d
Agent-Session: 9a22412a-b2b1-4e3a-a35d-e310f6846f29
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a103af-15d8-79c3-9da1-1dce5fa8bdc7
Agent-Session: 01a1061e-c424-7fa2-8db0-b8e0c93f5d16
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5
diffr search BASE HEAD reads revision-qualified git grep -n or -nz hits
from stdin and writes one JSON result per file with a hit, with --options
for plugin overrides. diffr search pprint renders results without
reading the repository. tests/search.rs drives both against a fixture
repository.

AI assistance: developed with OpenAI Codex and Claude Code.

Agent-Session: 01a10126-800c-7922-a418-bb477c280cbd
Agent-Session: dca03de1-4350-4b24-b376-cb54c86fcc2d
Agent-Session: 9a22412a-b2b1-4e3a-a35d-e310f6846f29
Agent-Session: 82924cb5-dcfa-42e4-abb0-ef40393249f8
Agent-Session: 01a103af-15d8-79c3-9da1-1dce5fa8bdc7
Agent-Session: 11f062a8-d0e9-4c39-a0a5-d32e2ca60fb7
Agent-Session: 01a1061e-c424-7fa2-8db0-b8e0c93f5d16
Agent-Session: b7f96806-2bcb-4ee8-aca4-c5bedad0939a
Agent-Session: 01a10ad4-5daa-74b2-9479-9dca5e8b2572
Agent-Session: ea775653-fef8-47be-96ea-16815bdff22c
Agent-Session: d72470a3-1f93-4201-8e6d-2730c798e92b
Agent-Session: 01a10dbe-bfd3-7750-b69a-1c24fb1211cb
Agent-Session: 01a10dbe-5dcc-74a3-a06b-f810c6d3af7e
Agent-Session: 01a10e7a-1dfa-7bd1-a6f4-8449c22813e2
Agent-Session: 5700e9f2-ed1a-41d0-825c-bda83f9e8aa0
Agent-Session: 01a10f90-e4ce-70f2-84d1-26d64820eed3
Agent-Session: 01a11898-f278-7b30-b366-ea64bfc7ff5e
Agent-Session: 01a118dd-0ded-7b60-a820-60e4f5797db5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant