fix: allow optional HEAD ref through the git-gate#11
Merged
Conversation
The <dialog> element injected into each diff file section had height: 92vh but no explicit display: none for browsers without full <dialog> support. In those browsers the hidden dialog rendered as a 92vh-tall block, creating a massive empty black region below the diff content. Add display: none to .file-dialog and an explicit dialog[open] override to restore visibility when showModal() is called.
The diff view switched to `git diff HEAD` / `git diff --numstat HEAD` so staged new and deleted files show up, but the forced-command SSH gate only permitted the ref-less diff forms. On gated (remote) machines every diff request was refused with "difflab: command not permitted", which the app surfaces as "Remote gate refused command". Status and batch-status were unaffected, so only the diff view broke. Accept an optional trailing HEAD on both diff shapes in git-gate.sh and git-gate.ps1 and pass it through to git unchanged. The ref-less forms still work for older app builds, and any other ref is still rejected. Add gate tests covering diff, diff HEAD, numstat HEAD, the legacy ref-less form, arbitrary-ref rejection, and end-to-end pass-through proving a staged file appears under `diff HEAD` but not plain `diff`.
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.
Problem
After the diff view switched to
git diff HEAD/git diff --numstat HEAD(commit b764919, to show staged new/deleted files), gated machines started rendering a "Git error — Remote gate refused command" page on the diff view.Root cause: the forced-command SSH gate (
gate/git-gate.sh,gate/git-gate.ps1) only permits an exact set of command shapes and never had the ref-bearing diff forms added when the app change shipped. The gate rejectedgit … diff HEADwithdifflab: command not permitted, whichclassify_errormaps toGATE_REJECTED→ "Remote gate refused command".Status/batch-status use
status --short(unchanged), so the machine list kept working and only the diff view broke. Local targets bypass the gate entirely, which is why it wasn't caught before deployment.Fix
HEADon bothdiffanddiff --numstatshapes in both gate scripts, and pass it through to git unchanged.diff,diff HEAD,numstat HEAD, legacy ref-less, arbitrary-ref rejection, and an end-to-end pass-through proving a staged-only file appears underdiff HEADbut not plaindiff.Full suite: 227 passed.
Deployment note
The gate script is installed on each enrolled machine (
/usr/local/lib/difflab/git-gate.sh,C:\ProgramData\difflab\git-gate.ps1). Merging this does not fix already-deployed machines — the updated gate script must be reinstalled on each enrolled host for the diff view to recover there.