-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DiffPlug supports git core.eol
, but does not support core.autocrlf
#540
Comments
We delegate to JGit for this, and the latest Spotless I haven't done the archaeology to lookup what version of JGit was in Spotless |
I've upgraded to 3.27.2 and see the same problem. As for JGit release notes, the only thing I turned up was: 5.6.0: Remove an old work-around for core.autocrlf = input I don't know if that would help, to me it reads a bit like "autocrlf didn't used to work, now it does, so we no longer need this other code path". |
I did find a bug related to Git for Windows' use of an additional git config file, although that wasn't what I was using. I've gone through
Unfortunately the behavior is still the same. |
Can you try one more thing?
This will force your build to use the very latest git. If it still persists, then we'll have to file a bug with JGit. |
Same error, unfortunately: I definitely saw it pull down a fresh version of |
core.eol
, but does not support core.autocrlf
After digging in a bit more, I think this is a bug/missing-feature in Spotless, not JGit. Reading from https://git-scm.com/docs/gitattributes
But it looks like we don't respect that anywhere: spotless/lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java Line 264 in 2204946
spotless/lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java Line 278 in 2204946
The nice thing about It would be great to support I would love to merge a PR for this, but writing one will probably not make it to the top of my todo list. |
That works perfectly, thanks. I'd skimmed that documentation and assumed it meant adding a As It would be worth supporting |
Fixed in |
@nedtwigg This is broken in plugin-gradle >= 6.2.2. Working in 6.2.1. I can reproduce this in my windows machine. |
Thanks for bug report @arulrajnet. Must have been broken by #1119. Happy to merge a PR for this. |
I'm developing on a Windows machine against a Unix repo, and have
core.autocrlf=input
set globally. My understanding based on #22 (comment) was that this was a supported scenario, without requiring further configuration.Running spotless 3.18.0 on Gradle 5.0, spotless fails my build and appears to demand that I change line endings to
\r\n
.My spotless config block is pretty simple:
I've tried explicitly setting
lineEndings: 'GIT_ATTRIBUTES'
(no change in behavior), andlineEndings: 'UNIX'
(this works, but I'm not able to update every repo I have to work with).Am I doing something daft here?
The text was updated successfully, but these errors were encountered: