spotless icon indicating copy to clipboard operation
spotless copied to clipboard

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

Open nedtwigg opened this issue 3 years ago • 0 comments

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.

nedtwigg avatar Jun 16 '22 21:06 nedtwigg