diffplug / diffplug/spotless

`ratchetFrom 'origin/main'` can be broken in PR if the PR repo has `main` somewhere different than upstream

Open
#1,238 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
5.6k
Forks
559
Avg merge
1d 13h
Merged PRs (30d)
34

Description

https://github.com/diffplug/goomph/pull/191 is an interesting PR. spotless is failing, but it passes if you checkout the branch locally and clone.

The reason for the discrepancy is that `diffplug/goomph` had main at https://github.com/diffplug/goomph/commit/22f4e8d6c22366c4d9b041bec93cc42e1862d9e9, whereas `jmini/goomph` had main at https://github.com/jmini/goomph/commit/4c8da613a16f98155ee167239ced96a335ec1016. Because the PR came from `jmini`, from the PR point of view `origin/main` is `jmini/main`, whereas for most people who checkout the project, `origin/main` is `diffplug/main`.

The workaround is for the PR author to move their `main` to match the upstream project.

Ideally users wouldn't have to deal with this, maybe something like `ratchetFrom 'https://github.com/diffplug/spotless@main'`, and then Spotless can detect the correct remote or add it if missing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.