[llvm-dev] Committing with git

Jacob Carlborg via llvm-dev llvm-dev at lists.llvm.org
Sun Nov 3 05:37:40 PST 2019


On 2019-10-29 01:21, Reid Kleckner via llvm-dev wrote:

> At the dev meeting I heard Doug Gregor say something like, "what kind of 
> dirty animals are you, you just push directly to master!?" Based on 
> that, I think other communities may set up workflows where they push 
> branches to places, and some automation rebases and updates master 
> asynchronously, optionally conditioned on some (light) testing or approval.

I think in most open source projects the workflow is to create a pull 
request. Then the CI infrastructure will build and test that PR which is 
hopefully up to date with the master branch. When that passes the tests 
and review it will be merged into master. Then the CI infrastructure 
builds and tests it again. In the mean time some changes might have been 
made to master. In my experience it's rare that a PR that passes breaks 
something when it gets merged. But most projects are not as large as LLVM.

So yes, one definitely needs to rely on the CI infrastructure. In my 
experience it's rare that a contributor will run the tests on another 
platforms than the contributor's main development platform.

The CI infrastructure for the D programming language works a bit 
different (a quite large project but not as large as LLVM). The CI 
infrastructure will pull down the PR and the latest master and merge 
that and then run all the builds and tests. If a commit has been made to 
master it will invalidate the test results of all existing PRs. If a PR 
is too old it won't be tested again (until someone makes a new commit to 
that PR). This is to avoid old inactive PRs to delay new active ones. 
But nothing will automatically rebase existing PRs.

With the monorepo there will be more traffic/commits but it will also be 
less likely that a new commit will break something because it might be 
to completely different project. For example, if you work on some 
changes to the compiler (LLVM or Clang) and someone else makes a commit 
to libc++. It's less likely that that commit will break my changes. 
After a while one gets a feeling on what's likely and less likely to 
break something.

-- 
/Jacob Carlborg



More information about the llvm-dev mailing list