GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix] Add git worktree support for ratchet functionality by kevinburkesegment · Pull Request #2779 · diffplug/spotless

Conversation

@kevinburkesegment

@kevinburkesegment kevinburkesegment commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Git ratchet functionality failed in worktree directories with "Cannot find git repository in any parent directory" because JGit's RepositoryCache.FileKey.isGitRepository() doesn't properly recognize worktree git directories.

Worktrees have a different structure where some files (objects, refs, etc.) are shared via a commondir file pointing to the main repository. This commit adds a custom isGitRepository() method that detects worktrees by checking for the commondir file and validates them appropriately.

Also adds comprehensive test coverage for worktree support.

Fixes #2728

Please DO NOT FORCE PUSH. Don't worry about messy history, it's easier to do code review if we can tell what happened after the review, and force pushing breaks that.

Please make sure that your PR allows edits from maintainers. Sometimes it's faster for us to just fix something than it is to describe how to fix it.

Allow edits from maintainers

After creating the PR, please add a commit that adds a bullet-point under the [Unreleased] section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:

  • a summary of the change
  • either
    • a link to the issue you are resolving (for small changes)
    • a link to the PR you just created (for big changes likely to have discussion)

If your change only affects a build plugin, and not the lib, then you only need to update the plugin-foo/CHANGES.md for that plugin.

If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.

This makes it easier for the maintainers to quickly release your changes :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikelane

mikelane commented Jan 16, 2026

Copy link
Copy Markdown

I sure would love it if this was merged in. Any idea when it'll happen?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Pankraz76

This comment was marked as spam.

Sign in to view
@Goooler

This comment was marked as outdated.

Sign in to view
@Pankraz76

This comment was marked as spam.

Sign in to view
@Pankraz76

This comment was marked as abuse.

Sign in to view
This was referenced Jan 17, 2026
[fix] removeSemicolons() should not be applied to multiline strings in groovy #2780 #2792
Merged
Add a expandWildcardImports API for java ([#2777](https://github.com/diffplug/spotless/issues/2594)) #2744 #2777
Closed
[rewrite] add CodeCleanup #2813
Closed
@nedtwigg

nedtwigg commented Jan 21, 2026

Copy link
Copy Markdown
Member

Happy to merge this, but the test failures in the maven tests seem to be real.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikelane

mikelane commented Jan 21, 2026

Copy link
Copy Markdown

Happy to merge this, but the test failures in the maven tests seem to be real.

Sorry if I stirred up any drama! That definitely wasn't my intent. I'd very much like this merged, but it doesn't seem useful to merge it with failing tests. So I'm okay to wait until it's all the way done.

I'd lend a hand, but honestly, it'd be vibe coded if I did. If you're okay with Gen AI contributions, I'll help out. Otherwise, I'll leave it to you all.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kevinburkesegment

kevinburkesegment commented Jan 21, 2026

Copy link
Copy Markdown
Contributor Author

Let me see if I can resolve the Maven issues

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jan 21, 2026

Copy link
Copy Markdown
Member

Sorry if I stirred up any drama!

lol, not your fault at all. All is well. It's just a backburner project for many different people who have never met in person, sometimes stuff builds up without a face to face :). I represent the company that puts its name on the tin, so I have to review for security before anything goes in, so I end up being the choke point when I'm crunching (as I have been the past few months).

If you're okay with Gen AI contributions

Gen AI is welcome, but please run CI locally to before opening a PR. I don't care how the hot dog gets made, I just don't want a notification everytime a new intermediate step is taken.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jan 21, 2026

Copy link
Copy Markdown
Member

As soon as this gets resolved I'll cut a release. If it doesn't get resolved by Friday the train will leave without it, but it's welcome on the next train.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kevinburkesegment and others added 2 commits January 21, 2026 15:48
@kevinburkesegment @claude
[fix] Add git worktree support for ratchet functionality
806426a
Git ratchet functionality failed in worktree directories with
"Cannot find git repository in any parent directory" because
JGit's RepositoryCache.FileKey.isGitRepository() doesn't properly
recognize worktree git directories.

Worktrees have a different structure where some files (objects,
refs, etc.) are shared via a commondir file pointing to the main
repository. This commit adds a custom isGitRepository() method
that detects worktrees by checking for the commondir file and
validates them appropriately.

Also adds comprehensive test coverage for worktree support.

Fixes diffplug#2728

Co-Authored-By: Claude <[email protected]>
@kevinburkesegment
changes.md: add changes
cdafb28
@kevinburkesegment
kevinburkesegment force-pushed the worktree-patch branch from a5eaa5d to cdafb28 Compare January 21, 2026 23:52
@kevinburkesegment

kevinburkesegment commented Jan 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Please DO NOT FORCE PUSH. Don't worry about messy history, it's easier to do code review if we can tell what happened after the review, and force pushing breaks that.

apologies, I just reread this after force pushing. I will do patches

The force push just rebased against what's currently on main and then resolved the conflicts in CHANGES.md, no changes to the code.

nedtwigg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kevinburkesegment

kevinburkesegment commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

Sorry @nedtwigg or others, I think I need your help to trigger a CI run for this build.

nedtwigg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jan 22, 2026

Copy link
Copy Markdown
Member

lol, needs a spotlessApply haha

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg
spotlessApply
c21049f
@kevinburkesegment

kevinburkesegment commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

I ran the tests on c21049f locally with Java 21 and got passes

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jan 22, 2026

Copy link
Copy Markdown
Member

sorry, looks like the maven is still failing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jan 22, 2026

Copy link
Copy Markdown
Member

spotless/.github/workflows/ci.yml

Line 69 in 4a59207

run: ./gradlew :plugin-maven:build -x spotlessCheck

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kevinburkesegment
update the test
c55693e
@nedtwigg
nedtwigg merged commit 5d802a8 into diffplug:main Jan 22, 2026
20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jan 22, 2026

Copy link
Copy Markdown
Member

Huzzah! Merged, release on the way!

mikelane reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kevinburkesegment
kevinburkesegment deleted the worktree-patch branch April 15, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Git ratcheting causes exception to be thrown when using git worktrees

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@kevinburkesegment @mikelane @Pankraz76 @Goooler @nedtwigg
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.