Skip to content

git: show without a path, and client-relative --repo - #26

Open
mgasner wants to merge 1 commit into
fix/git-diff-index-worktreefrom
fix/git-show-repo-paths
Open

mgasner wants to merge 1 commit into
fix/git-diff-index-worktreefrom
fix/git-show-repo-paths

Conversation

@mgasner

@mgasner mgasner commented Sep 28, 2026

Copy link
Copy Markdown

Stacked on #25. The diff shows only this change.

What was wrong

  • yas git show REV always sent a BLOB query, so asking for a commit failed with Invalid.
  • --repo and yas git discover PATH were sent as given, so relative paths, including the default ., resolved against the server's cwd instead of the client's. From outside the server's cwd, yas git status failed with "request 0x0031/0x0000 failed with Invalid".

Fix

  • show REV prints the commit in git cat-file commit layout, rebuilt from the LOG record. REV:DIR and REV: list the tree the way ls-tree does. REV:file still prints the file's bytes.
  • A raw tree or blob ID as REV is still rejected, because the server's RESOLVE accepts only commit-like revisions. The help now says "REV names a commit; reach trees and blobs by PATH."
  • --repo and the discover path resolve against the client's cwd, the same as the fs and lsp --root. The help text for all 10 git --repo flags and learn.md are updated to match.

Testing

  • New tests: commit_object_uses_cat_file_layout and relative_repository_paths_resolve_against_client_cwd.
  • Full yas-cli bin tests pass (147).
  • Checked by hand with a scratch repo.

View in Indent
Tag @indent to continue the conversation here.

`yas git show REV` sent a BLOB query for the commit and failed with
Invalid. It now prints the commit in `git cat-file commit` layout (from
the LOG record), and lists a directory for REV:DIR and REV:.

--repo and `git discover PATH` were sent verbatim, so relative paths
(including the default `.`) resolved against the server's cwd. They now
resolve against the client's cwd, like fs and lsp --root.
@github-actions

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 85.6% (1081/1263) 89.4% (84/94) 89.3% (1746/1955)
browser 25.5% (309/1212) 30.4% (34/112) 27.7% (605/2183)
cli 35.2% (8465/24066) 36.1% (785/2175) 35.9% (12261/34181)
composite-transport 96.3% (526/546) 98.4% (60/61) 96.2% (884/919)
compositor 54.9% (11393/20760) 66.1% (833/1260) 54.7% (15780/28840)
desktop 78.4% (4460/5691) 71.6% (393/549) 75.1% (6211/8267)
edge 63.1% (800/1268) 50.9% (82/161) 58.0% (1043/1799)
fonts 77.3% (1257/1626) 82.7% (129/156) 78.9% (2424/3071)
fssync 85.3% (1597/1872) 84.4% (179/212) 86.4% (2813/3255)
git 72.8% (4612/6334) 70.5% (347/492) 70.0% (6569/9386)
guest 67.3% (6829/10148) 67.0% (488/728) 66.6% (8935/13416)
lsp 78.7% (3573/4542) 80.8% (336/416) 76.7% (5408/7054)
proxy 57.8% (1120/1937) 50.5% (104/206) 59.0% (1749/2965)
runtime-dir 93.6% (117/125) 100.0% (14/14) 94.8% (218/230)
sd-notify 73.9% (68/92) 100.0% (6/6) 83.2% (109/131)
server 69.1% (80273/116214) 70.8% (5748/8116) 66.6% (106157/159309)
ssh 42.6% (270/634) 51.5% (34/66) 42.9% (428/998)
terminal-model 49.9% (314/629) 62.3% (38/61) 50.3% (505/1004)
uplink 94.0% (581/618) 92.6% (50/54) 93.0% (1061/1141)
webrtc-forwarder 33.8% (1337/3961) 42.0% (136/324) 36.2% (2318/6409)
webserver 77.0% (1421/1846) 75.2% (179/238) 80.0% (2453/3067)
website 35.1% (355/1012) 34.4% (53/154) 35.8% (607/1694)
xtask 0.0% (0/5131) 0.0% (0/131) 0.0% (0/9124)
yas 87.8% (26485/30170) 93.2% (2036/2184) 82.7% (41700/50414)
Total 65.1% (157243/241697) 67.6% (12148/17970) 63.3% (221984/350812)

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