Skip to content
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

ratchetFrom doesn't support merge conflicts #1504

Open
blacelle opened this issue Jan 19, 2023 · 2 comments
Open

ratchetFrom doesn't support merge conflicts #1504

blacelle opened this issue Jan 19, 2023 · 2 comments
Labels

Comments

@blacelle
Copy link
Contributor

This is an edge case.

I consider a local repository, during a merge conflict. I end with some files being removed locally, but in conflict with the remote head: during the conflict-management process, I end with something like:


cleanthat git status
On branch IntroduceSpotLess
Your branch is up to date with 'origin/IntroduceSpotLess'.

You have unmerged paths.
  (fix conflicts and run "git commit")
  (use "git merge --abort" to abort the merge)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   java/src/test/java/eu/solven/cleanthat/language/java/refactorer/test/ARefactorerCases.java
	modified:   java/src/test/java/eu/solven/cleanthat/language/java/refactorer/test/ATestCases.java

Here, I'm moving java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java into java/src/test/java/eu/solven/cleanthat/language/java/refactorer/test/ARefactorerCases.java

I end with an issue like:

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.30.0:apply (applySpotless) on project java: Unable to format file /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.30.0:apply (applySpotless) on project java: Unable to format file /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to format file /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java
    at com.diffplug.spotless.maven.SpotlessApplyMojo.process (SpotlessApplyMojo.java:51)
    at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:214)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
...
Caused by: java.nio.file.NoSuchFileException: /Users/blacelle/workspace3/cleanthat/java/src/test/java/eu/solven/cleanthat/language/java/rules/test/ATestCases.java
    at sun.nio.fs.UnixException.translateToIOException (UnixException.java:92)
    at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111)
    at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:116)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel (UnixFileSystemProvider.java:219)
    at java.nio.file.Files.newByteChannel (Files.java:370)
    at java.nio.file.Files.newByteChannel (Files.java:421)
    at java.nio.file.Files.readAllBytes (Files.java:3205)
    at com.diffplug.spotless.PaddedCell.calculateDirtyState (PaddedCell.java:189)
    at com.diffplug.spotless.maven.SpotlessApplyMojo.process (SpotlessApplyMojo.java:45)
    at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:214)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
...

where we try to clean a file whicle it does not exists.

I suppose it relates with the ratchetFrom feature (which is set to origin/main in my configuration).

@nedtwigg nedtwigg changed the title java.nio.file.NoSuchFileException on spotlessApply if repository is merging conflicts ratchetFrom doesn't support merge conflicts Jan 19, 2023
@nedtwigg nedtwigg added the bug label Jan 19, 2023
@nedtwigg
Copy link
Member

Fixing this will probably be related to #911

@blacelle
Copy link
Contributor Author

Also relates with #623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants