Repository navigation
fix(publish): send committed content, refuse non-serving branches, push one branch - #31
Merged
Merged
Conversation
sujal-maheshwari2004
force-pushed
the
fix/repo-root-paths
branch
from
November 15, 2026 05:10
ee5d3cf to
9e2c271
Compare
sujal-maheshwari2004
requested review from
guptadevik2003 and
iamDyeus
as code owners
November 15, 2026 05:10
sujal-maheshwari2004
force-pushed
the
fix/publish-committed-content
branch
from
November 15, 2026 05:10
0615b3c to
5aaa3da
Compare
sujal-maheshwari2004
force-pushed
the
fix/repo-root-paths
branch
from
November 15, 2026 05:13
9e2c271 to
ecd853a
Compare
…sh one branch push -server and publish read prompts from the working tree and sent them with no Branch or Message, so on git branch dev an uncommitted edit went live on the server's main (what agents read). push also used go-git's default refspec and pushed every local branch. - Inside a repo, prompts are read from the HEAD commit; a prompt with uncommitted changes is refused. A CRLF checkout of an LF blob is not a change (go-git ignores core.autocrlf when it hashes racy/touched files). - Without -branch, only git main/master/prod may publish to server main; other branches must name the server branch with -branch. - Each version carries the HEAD commit subject and hash as its message. - push pushes only the current branch and refuses a detached HEAD. - Outside a git repo, publish still sends plain files as they are on disk. Fixes #16
sujal-maheshwari2004
force-pushed
the
fix/publish-committed-content
branch
from
November 15, 2026 05:14
5aaa3da to
ea43336
Compare
sujal-maheshwari2004
changed the base branch from
fix/repo-root-paths
to
main
November 15, 2026 05:14
Open
3 tasks
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.
Fixes #16. Stacked on #30: review and merge #30 first, and GitHub will retarget this PR to
main.Problem.
push -serverandpublishread prompts from the working tree and sentPublishPromptRequest{Uri, Template, Slots}with noBranchand noMessage. On git branchdevwith an uncommitted edit,push -serverput that edit live on the server'smainand notified every subscriber. It also pushed every local branch, because it used go-git's default refspec.Change (the rule agreed for the issue)
commit them first.-branch, publishing to the server'smainis allowed only from gitmain,masterorprod; the README names prod as the published branch. From any other branch it refuses unless you pass-branch <server-branch>, which publishes to that server branch.<HEAD subject> (<hash>), so server History and the UI no longer show "(no message)".pushpushes only the current branch and refuses a detached HEAD. The publish plan is checked beforegit push, so a refusal sends nothing.publishstill sends plain files as they are on disk.core.autocrlfwhenever it has to hash a file (a racy index entry right after a checkout, or a touched file), so a clean CRLF checkout shows as modified. Such files count as changed only if they differ from HEAD by more than line endings; this reuseschangedLinesfrom fix(diff): compare normalized lines so CRLF-only differences are skipped (#11) #12.Tested
publish_committed_test.go:devis refused without-branchand allowed with itpriompt serveand a bare git remote:mainondevwith an uncommitted edit:push -serverpublishes the uncommitted text to server main and pushesdev main prod.on dev: refusing to publish to the server's main .... Onmainwith a real edit it refuses withhas uncommitted changes. Onmainwith a clean but touched CRLF checkout it publishes.push -serverfrommainpushes onlymain.go vet ./...andgo test ./...pass.Docs: README updated. The docs site's CLI reference will need the new
-branchflag once this merges.