Skip to content

revert: CRLF-only diff fix (#12), pending maintainer review - #33

Merged
sujal-maheshwari2004 merged 1 commit into
mainfrom
revert/crlf-diff-pr12
Nov 15, 2026
Merged

sujal-maheshwari2004 merged 1 commit into
mainfrom
revert/crlf-diff-pr12

Conversation

@sujal-maheshwari2004

Copy link
Copy Markdown
Member

Reverts 91d19bb (#12).

#12 was merged without the maintainer review that main now 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.

… are skipped (#11) (#12)"

This reverts commit 91d19bb.

The change was merged without the required maintainer review. It is being
reverted so it can come back through a reviewed pull request; reverting does
not imply a problem with the change itself. Reopens #11.
@sujal-maheshwari2004
sujal-maheshwari2004 merged commit 15e0a4c into main Nov 15, 2026
1 check passed
@sujal-maheshwari2004
sujal-maheshwari2004 deleted the revert/crlf-diff-pr12 branch November 15, 2026 05:03
sujal-maheshwari2004 added a commit that referenced this pull request Nov 15, 2026
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
changedLines came from #12, reverted in #33; use sameIgnoringLineEndings
and import slices directly.
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
changedLines came from #12, reverted in #33; use sameIgnoringLineEndings
and import slices directly.
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.
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