Rust-analyzer: Add a tests that forbids merge commits

Created on 24 Aug 2020  Â·  3Comments  Â·  Source: rust-analyzer/rust-analyzer

We use rebase workflow in rust-analyzer. That is, if master branch moves forward from under your PR, you should rebase the PR on top of master (rewriting the history), rather than merge master into your PR branch.

We should add a test to enforce this. The test should go here:

https://github.com/rust-analyzer/rust-analyzer/blob/master/xtask/tests/tidy.rs

It should run git (using not_bash), find the last 50 commits or so, and and check that all the merges are from bors.

E-has-instructions

Most helpful comment

The branch point for the current branch can be found using git merge-base HEAD master. Merges not made by bors since branching can be found using git rev-list --merges --invert-grep --author 'bors\[bot\]' $(git merge-base HEAD master)..

All 3 comments

The branch point for the current branch can be found using git merge-base HEAD master. Merges not made by bors since branching can be found using git rev-list --merges --invert-grep --author 'bors\[bot\]' $(git merge-base HEAD master)..

Let me give this a shot!

I guess specifying depth to be 50 in the appropriate YML

On Monday, 24 August 2020, Devajit Asem notifications@github.com wrote:

5862 https://github.com/rust-analyzer/rust-analyzer/pull/5862 failed

because CI checks out repository with no commit history. Since this repo
does not have a pre-push git hook to ensure that cargo test is executed.
What is the correct flow we are looking for here?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rust-analyzer/rust-analyzer/issues/5854#issuecomment-679385001,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AANB3M3L27EHYPCOH4IM62LSCLOHBANCNFSM4QJMMGZQ
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlseinX picture AlseinX  Â·  3Comments

mehmooda picture mehmooda  Â·  3Comments

Matelasse picture Matelasse  Â·  3Comments

yoshuawuyts picture yoshuawuyts  Â·  3Comments

matklad picture matklad  Â·  4Comments