Skip to content

chore: renormalize mvnw.cmd line endings - #1265

Open
yebuguntang wants to merge 2 commits into
apache:mainfrom
yebuguntang:fix/mvnw-cmd-line-endings
Open

yebuguntang wants to merge 2 commits into
apache:mainfrom
yebuguntang:fix/mvnw-cmd-line-endings

Conversation

@yebuguntang

Copy link
Copy Markdown

Purpose of the pull request

Closes #1264

mvnw.cmd always shows as modified in git status after cloning, even though nobody changed the file. .gitattributes says *.cmd blobs are stored as LF, but this one was committed with CRLF before the rule existed (#1049).

What's changed?

git add --renormalize mvnw.cmd

The stored blob becomes LF. The file Windows users check out is unchanged, same hash before and after. Verified:

  • git ls-files --eol now reports i/lf w/crlf
  • staged diff with --ignore-cr-at-eol comes back empty
  • git status is clean after the commit
  • mvnw.cmd -DskipTests package still builds
image

No docs or test changes needed — this only touches how the file is stored in git, not its content.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

@yebuguntang

Copy link
Copy Markdown
Author

Hi @GOODBOY008 , could you review this small fix? It resolves #1264 — mvnw.cmd always shows as modified after cloning on Windows. Verified the stored blob becomes LF while the checked-out file is unchanged. Thanks!

@Mikkey-f Mikkey-f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Windows 11:

  • On current main: git ls-files --eol mvnw.cmd → i/crlf w/crlf attr/text eol=crlf, and a fresh worktree reports M mvnw.cmd — reproduces #1264.
  • On this PR: i/lf w/crlf attr/text eol=crlf, and git status --porcelain is clean.
  • git diff --ignore-cr-at-eol origin/main...HEAD is empty, so only the stored line endings change; the checked-out script stays CRLF for cmd.exe.

LGTM — this fixes the fresh-clone symptom, and existing clones pick it up on pull.

@GOODBOY008
GOODBOY008 self-requested a review November 2, 2026 09:42

This branch has not been deployed

No deployments
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.

[Task] mvnw.cmd always shows as modified after cloning

2 participants