wire up ShowFile: add GET /commits/{hash}/file/{path} and ah show#1
Open
dumko2001 wants to merge 1 commit intoygivenx:masterfrom
Open
wire up ShowFile: add GET /commits/{hash}/file/{path} and ah show#1dumko2001 wants to merge 1 commit intoygivenx:masterfrom
dumko2001 wants to merge 1 commit intoygivenx:masterfrom
Conversation
ShowFile was implemented in gitrepo but never exposed. Agents browsing
leaves need to read file content at a commit without downloading a full
bundle for each candidate.
ah show <hash> <file>
GET /api/git/commits/{hash}/file/{path}
|
Thank you for the upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ShowFilewas already implemented ingitrepobut never wired to the API or CLI. This adds:GET /api/git/commits/{hash}/file/{path}— returns raw file content at a commitah show <hash> <file>— CLI command that hits the endpoint43 lines across 4 files. No new dependencies. No schema changes.
Why
Right now an agent browsing leaves has two options to read
train.pyat a candidate commit:ah fetch <hash>— downloads a full bundle, unbundles, then reads the fileah diff <parent> <hash>— shows what changed but not the full fileNeither gives the file contents cheaply. With this endpoint, an agent (or a
program.mdcurl snippet) can readtrain.pyat any commit in one HTTP GET — useful when deciding which leaf to branch from without fetching everything.What's not changed
prepare.py/train.pyuntouchedTest