Repository navigation
revert: CRLF-only diff fix (#12), pending maintainer review - #33
Merged
Merged
Conversation
sujal-maheshwari2004
added a commit
that referenced
this pull request
Nov 15, 2026
…<to> (#29) * fix(promote): refuse to run on a dirty tree and never strand HEAD on <to> promote round-trips through a checkout of <to>. go-git's Checkout only refuses unstaged edits, so staged edits and staged new files were reset away with exit 0, and when it did refuse it had already moved HEAD, leaving the user on <to> with their work in the tree. promote now checks for staged or modified tracked files up front and stops with "commit or stash first" (untracked files are fine; the checkout leaves them alone). If the checkout of <to> still fails, HEAD is restored to the branch or commit the user started on. Fixes #14 Fixes #15 * fix(promote): don't treat CRLF-only checkouts as uncommitted changes go-git ignores core.autocrlf when it has to hash a file (a racy index entry right after a checkout, or a touched file), so a clean CRLF checkout of an LF blob shows as modified and the new clean-tree check would block promote on Windows. A worktree-modified file now only counts when it differs from HEAD by more than line endings (changedLines). * fix(promote): rewrite CRLF-only files instead of letting go-git's checkout refuse The previous commit let a CRLF-only file through promote's own check, but go-git's Checkout hits the same false positive and refuses with "worktree contains unstaged changes" (TestPromoteAllowsLineEndingOnlyDifferences failed). Such files are now rewritten with their committed content before the round trip; only their line endings change, as for every file go-git checks out. Checkout Force was not an option: it deletes untracked files. * refactor(promote): compare line endings with a local helper The changedLines helper this branch used came from #12, which was reverted in #33. Use a small sameIgnoringLineEndings helper instead so promote does not depend on that change.
sujal-maheshwari2004
added a commit
that referenced
this pull request
Nov 15, 2026
…sh one branch (#31) * fix(publish): send committed content, refuse non-serving branches, push 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 * refactor(publish): compare line endings with a local helper changedLines came from #12, reverted in #33; use sameIgnoringLineEndings and import slices directly.
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.
Reverts 91d19bb (#12).
#12 was merged without the maintainer review that
mainnow requires. This revert takes it out so it can come back through a reviewed pull request. It says nothing about the change itself; we've asked @montionugera to open it again.diffwill again report CRLF-only differences until the fix returns.changedLinesandTestChangedLines.go vetandgo test ./...pass.