As part of the migration of LLVM's source code to github, we need to update
our developer policy with instructions about how to interact with the new git
repository. There are a lot of different topics we will need to discuss, but
I would like to start by initiating a discussion about our merge commit
policy. Should we:
1. Disallow merge commits and enforce a linear history by requiring a
rebase before push.
2. Allow merge commits.
3. Require merge commits and disallow rebase before push.
I'm going to propose that if we cannot reach a consensus that we
adopt policy #1, because this is essentially what we have now
with SVN.
What does everyone think?
Thanks,
Tom
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-- adrian
> As part of the migration of LLVM's source code to github, we need to update
> our developer policy with instructions about how to interact with the new git
> repository. There are a lot of different topics we will need to discuss, but
> I would like to start by initiating a discussion about our merge commit
> policy. Should we:
>
> 1. Disallow merge commits and enforce a linear history by requiring a
> rebase before push.
>
> 2. Allow merge commits.
>
> 3. Require merge commits and disallow rebase before push.
>
> I'm going to propose that if we cannot reach a consensus that we
> adopt policy #1, because this is essentially what we have now
> with SVN.
I agree with proposing #1 in general. It results in a nice clean
history and will be familiar to everyone working on the project.
However, there is a place for merge commits. If there's a bug in a
release and we want to make a point release, it might make sense to make
a commit on the release branch and then merge the release branch to
master in order to ensure the fix lands there as well. Another option
is to commit to master first and then cherry-pick to release. A third
option is to use the "hotfix branch" method of git flow [1], which would
result in a merge commit to the release branch and another merge commit
to master.
I've seen projects that commit to release first and then merge release
to master and also projects that commit to master and cherry-pick to
release. I personally haven't seen projects employ the git flow hotfix
branch method rigorously.
But GitHub is read-only for almost a year, right? So we really don't
have to decide this for a while. I have not tried using the monorepo
and committing to SVN with it. How does that work? What would it do
with merge commits?
-David
[1] https://nvie.com/posts/a-successful-git-branching-model
As part of the migration of LLVM's source code to github, we need to update
our developer policy with instructions about how to interact with the new git
repository. There are a lot of different topics we will need to discuss, but
I would like to start by initiating a discussion about our merge commit
policy. Should we:
1. Disallow merge commits and enforce a linear history by requiring a
rebase before push.
2. Allow merge commits.
3. Require merge commits and disallow rebase before push.
Require a rebase, followed by git merge --no-ff
This creates a linear history, but with extra null merge commits
delimiting each related series of patches.
I believe it is compatible with bisect.
https://linuxhint.com/git_merge_noff_option/
How about:
Require a rebase, followed by git merge --no-ff
I'm strongly in favour of #1: no merges allowed, enforced by the
upstream repository, and that for release branches we use cherry-picks
like we do currently.
Thanks,
Hans
> On Jan 29, 2019, at 4:55 PM, Jeremy Lakeman via llvm-dev <llvm...@lists.llvm.org> wrote:
>
> 5. When a new feature is broken up into a patch series, the series should be rebased then immediately merged to help identify the individual patches in the history graph.
Typically the LLVM development model discourages merging big features in one go and instead gravitates towards breaking patches up into small, easy to reason about patches that gradually morph the code towards the goal. This makes it easier for reviewers and to track down regressions after each patch landed. For this reason we rarely have series of connected patches coming in at once.
-- adrian
If we decide to move away from #1, I strongly believe it should be done
well after the github migration. (i.e. lets not change everything at once!)
Philip
On 1/29/19 2:33 PM, Tom Stellard via cfe-dev wrote:
> Hi,
>
> As part of the migration of LLVM's source code to github, we need to update
> our developer policy with instructions about how to interact with the new git
> repository. There are a lot of different topics we will need to discuss, but
> I would like to start by initiating a discussion about our merge commit
> policy. Should we:
>
> 1. Disallow merge commits and enforce a linear history by requiring a
> rebase before push.
>
> 2. Allow merge commits.
>
> 3. Require merge commits and disallow rebase before push.
>
> I'm going to propose that if we cannot reach a consensus that we
> adopt policy #1, because this is essentially what we have now
> with SVN.
>
> What does everyone think?
>
> Thanks,
> Tom
> _______________________________________________
> cfe-dev mailing list
> cfe...@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
> How about:
>
> Require a rebase, followed by git merge --no-ff
>
> This creates a linear history, but with extra null merge commits
> delimiting each related series of patches.
>
> I believe it is compatible with bisect.
>
> https://linuxhint.com/git_merge_noff_option/
We've done both and I personally prefer the strict linear history by a
lot. It's just much easier to understand a linear history.
-David
> 4. Each reviewed bug / feature must be rebased onto the current "known
> good" commit, merged into a "probably good" commit, tested by build
> bots, and only then pushed to trunk. Keeping trunk's history more
> usable, with most bad patches reworked and resubmitted instead of
> reverted.
If you mean having a submitted PR trigger builds and only allow merging
if all builds pass, that may be doable. Of course by the time it's
merged it will be against some later commit (so it should be rebased)
and there's no guarantee it will build against *that* commit. But it
will tend to filter out most problems.
Trying to keep a branch buildable at all times is a hard problem, but
the above is probably a 90% solution.
-David
Agreed. Let's go with option #1.
-eric
On Wed, Jan 30, 2019 at 12:42 PM David Greene via cfe-dev
<cfe...@lists.llvm.org> wrote:
>
> Bruce Hoult via llvm-dev <llvm...@lists.llvm.org> writes:
>
> > How about:
> >
> > Require a rebase, followed by git merge --no-ff
> >
> > This creates a linear history, but with extra null merge commits
> > delimiting each related series of patches.
> >
> > I believe it is compatible with bisect.
> >
> > https://linuxhint.com/git_merge_noff_option/
>
> We've done both and I personally prefer the strict linear history by a
> lot. It's just much easier to understand a linear history.
>
Agreed. Let's go with option #1.
I'm very much in favor of this option.
-Krzysztof
> What is the practical plan to enforce the lack of merges? When we
> looked into this GitHub would not support this unless also forcing
> every change to go through a pull request (i.e. no pre-receive hooks
> on direct push to master were possible). Did this change? Are we
> hoping to get support from GitHub on this?
>
> We may write this rule in the developer guide, but I fear it'll be
> hard to enforce in practice.
Again, changes aren't going through git yet, right? Not until SVN is
decommissioned late this year (or early next). SVN requires a strict
linear history so it handles the enforcement for now.
My personal opinion is that when SVN is decomissioned we should use pull
requests, simply because that's what's familiar to the very large
development community outside LLVM. It will lower the bar to entry for
new contributors. This has all sorts of implications we need to discuss
of course, but we have some time to do that.
If we don't use PRs, then we're pretty much on the honor system to
disallow merges AFAIK.
-David
> Systems that I've seen will funnel all submitted PRs into a single queue
> which *does* guarantee that the trial builds are against HEAD and there
> are no "later commits" that can screw it up. If the trial build passes,
> the PR goes in and becomes the new HEAD.
The downside of a system like this is that when changes are going in
rapidly, the queue grows very large and it takes forever to get your
change merged. PR builds are serialized and if a "build" means "make
sure it builds on all the Buildbots" then it takes a very long time
indeed.
There are ways to parallelize builds by speculating that PRs will build
cleanly but it gets pretty complicated quickly.
> But this would be a radical redesign of the LLVM bot system, and would
> have to wait until we're done with the GitHub migration and can spend
> a couple of years debating the use of PRs. :-)
Heh. Fully guaranteeing buildability of a branch is not a trivial task
and will take a LOT of thought and discussion.
-David
> My personal opinion is that when SVN is decomissioned we should use pull
> requests, simply because that's what's familiar to the very large
> development community outside LLVM. It will lower the bar to entry for
> new contributors. This has all sorts of implications we need to discuss
> of course, but we have some time to do that.
My personal opinion is an opposite of that one.
*Does* LLVM want to switch from phabricator to github pr's?
I personally don't recall previous discussions.
Personally, i hope not, i hope phabricator should/will stay.
Low bar for entry is good, but not at the cost of raising the bar
for the existing development community.
In particular, i'm saying that github's ui/workflow/feature set
is inferior to that one of phabricator.
Is the low entry bar the only benefit?
While it is good, it should not be the only factor.
The contributors will already need to know how to build LLVM,
write tests, make meaningful changes to the code.
Additionally having to know how to work with phabricator
isn't that much to ask for, considering the other prerequisites..
> If we don't use PRs, then we're pretty much on the honor system to
> disallow merges AFAIK.
>
> -David
Roman.
> _______________________________________________
> cfe-dev mailing list
> cfe...@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
> *Does* LLVM want to switch from phabricator to github pr's?
> I personally don't recall previous discussions.
> Personally, i hope not, i hope phabricator should/will stay.
I find Phab pretty unintuitive. I just started using it in earnest
about four months ago, so that's one datapoint from people new to it.
-David
Roman Lebedev <lebed...@gmail.com> writes:
> *Does* LLVM want to switch from phabricator to github pr's?
> I personally don't recall previous discussions.
> Personally, i hope not, i hope phabricator should/will stay.
I find Phab pretty unintuitive. I just started using it in earnest
about four months ago, so that's one datapoint from people new to it.
-David
Jeremy Lakeman <Jeremy....@gmail.com> writes:
Our current bug-fix fix process is to commit to master first and then
cherry-pick to release branches.
> I've seen projects that commit to release first and then merge release
> to master and also projects that commit to master and cherry-pick to
> release. I personally haven't seen projects employ the git flow hotfix
> branch method rigorously.
>
> But GitHub is read-only for almost a year, right? So we really don't
> have to decide this for a while. I have not tried using the monorepo
> and committing to SVN with it. How does that work? What would it do
> with merge commits?
>
It will be read-only until October 2019, but I think it's important to decide
on this issue early so we have time to research and implement ways to
automatically enforce our policy to make things as smooth as possible
when we do switch. I really want us to be able to keep our current migration
schedule.
The GettingStarted patch has been updated with instructions for how to use
the new repo: https://llvm.org/docs/GettingStarted.html#checkout-llvm-from-git
-Tom
> -David
>
> [1] https://nvie.com/posts/a-successful-git-branching-model
No enforcement plan at this point, but I was planning to contact github about this to
see what options we had. Last time you looked into it, did you talk to anyone at github
support?
This is also why I think it's important to decide early so we have time to look at
what our options are to enforce these policies. If pull requests are our only
option for enforcement, then I think it would be good to know that before we
have a large debate about Phabricator vs Pull Requests.
-Tom
> We may write this rule in the developer guide, but I fear it'll be hard to enforce in practice.
>
--
> Mehdi
>
>
>
This hasn't been decided yet, but this is a whole other discussion
that deserves it own thread (not saying we need to decide this now though).
-Tom
On 01/30/2019 10:53 PM, Mehdi AMINI via llvm-dev wrote:
>
>
> On Wed, Jan 30, 2019 at 1:19 PM Eric Christopher via cfe-dev <cfe...@lists.llvm.org <mailto:cfe...@lists.llvm.org>> wrote:
>
> On Wed, Jan 30, 2019 at 12:42 PM David Greene via cfe-dev
> <cfe...@lists.llvm.org <mailto:cfe...@lists.llvm.org>> wrote:
> >
> > Bruce Hoult via llvm-dev <llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>> writes:
> >
> > > How about:
> > >
> > > Require a rebase, followed by git merge --no-ff
> > >
> > > This creates a linear history, but with extra null merge commits
> > > delimiting each related series of patches.
> > >
> > > I believe it is compatible with bisect.
> > >
> > > https://linuxhint.com/git_merge_noff_option/
> >
> > We've done both and I personally prefer the strict linear history by a
> > lot. It's just much easier to understand a linear history.
> >
>
> Agreed. Let's go with option #1.
>
>
> What is the practical plan to enforce the lack of merges? When we looked into this GitHub would not support this unless also forcing every change to go through a pull request (i.e. no pre-receive hooks on direct push to master were possible). Did this change? Are we hoping to get support from GitHub on this?
>
No enforcement plan at this point, but I was planning to contact github about this to
see what options we had. Last time you looked into it, did you talk to anyone at github
support?
This is also why I think it's important to decide early so we have time to look at
what our options are to enforce these policies. If pull requests are our only
option for enforcement, then I think it would be good to know that before we
have a large debate about Phabricator vs Pull Requests.
Definitely not that convenient than a pre-receive check, but at least
something...
regards,
Fedor.
>
> --
> Mehdi
>
>
>
>
> -Tom
>
>
> > We may write this rule in the developer guide, but I fear it'll
> be hard to enforce in practice.
> >
> --
> > Mehdi
> >
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm...@lists.llvm.org <mailto:llvm...@lists.llvm.org>
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
GitHub does let you block merges (by anyone who isn’t an administrator) of PRs that don’t meet certain requirements. For one project, we have it set up so that you need to have at least one reviewer saying approved, you have to have signed the CLA, and you have to pass all of the CI checks. It’s then easy to set up automatic merging when all of the prerequisites are met (you can get a notification and process it automatically). We allow self approval for small changes (not automatically enforced, this is a judgement call, but you can remove people who abuse it from the team quite easily and then they can’t approve changes).
I’ve found it leads to a very nice workflow: developers aren’t in the loop for merges, they just prepare something that they think works, submit it, and get on with something else. If you’re lucky, someone approves it and you pass CI first go, then everything is fine. Reviewers can wait until CI is finished and not bother looking for things that are going to break. If the change introduces new tests, reviewers know that those tests are passing. If you broke a platform that you don’t test on locally, you get notified but no one else is spammed with breakage reports. Once you’ve fixed it, you get a review, and make any changes. The master branch is always buildable and passing CI. If your changes break CI, you don’t have a race to fix things before someone reverts your change, you just fix things in the PR and wait for it to be automatically merged.
Anyone with admin permissions in a repo can add "branch protection
rules" that prevent force pushes, there is no need to contact Github
support for that.
> - GitHub PRs have Travis integration so the reviewer can see if a
> particular patch is actually compileable at all, before spending time
> looking at it. I wish Phab had this feature (or maybe it exists and LLVM
> doesn't use it?).
This kind of pre-merge testing is very valuable, it could potentially
prevent some unnecessary reverts by catching issues early.
On caveat is that the test coverage would be limited or else the build
times would be very long. There are quite some builders for various
projects (llvm, cfe, compiler-rt, etc.) on a lot of different platforms
and targets (Linux, macOS, Windows, Android, etc.).
With limited resources, Arthur's suggestion seems workable to me:
- Enable pre-commit testing of few configurations (in parallel).
- Encourage developers to wait for tests to pass before pushing changes.
- Do not block hard to avoid a situation where unrelated changes
(commits or build environment) cause failures.
I would also be in favor of linear history for reasons mentioned before
_______________________________________________
_______________________________________________