Skip to content

fix(plugin-gradle): Try to locate the git system config without executing any processes #2514

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zml2008
Copy link

@zml2008 zml2008 commented Jun 16, 2025

While it's not possible to match git's behavior exactly, this attempts to read the system gitconfig correcting a regression from 6.21.0 to 6.22.0.

This is a pretty ugly "fix" for the issue -- I came to this approach after trying to use Gradle's ExecOperations to wrap calls out to git, which failed since the subprocess creation happens at configuration time. Looking at git's logic to locate a system config file, this implementation is close-ish -- git's behaviour is determined by some compile-time flags, so to get exact behaviour we would have to call out to the actual git implementation. I'd love to see a better approach, but this is where I got after an afternoon of poking around so I thought I'd toss it up.

Fixes #2404

…ting any processes

While it's not possible to match cgit's behavior exactly, this
attempts to read the system gitconfig correcting a regression from 6.21.0 to 6.22.0.

Fixes diffplug#2404
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.

Investigate git-diff windows line ending issues in Spotless 7.0+
1 participant