Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please disable the "Allow rebase merging" merge button #2726

Closed
bartlettroscoe opened this issue May 10, 2018 · 7 comments
Closed

Please disable the "Allow rebase merging" merge button #2726

bartlettroscoe opened this issue May 10, 2018 · 7 comments
Labels
Framework tasks Framework tasks (used internally by Framework team)

Comments

@bartlettroscoe
Copy link
Member

@trilinos/framework

Can someone with the GitHub permissions please uncheck the "Allow rebase merging" option under the "Merge button" section at the page:

?

That will stop people from rebasing and then fast-forward merging a bunch of commits on the 'develop' branch. For example, currently, someone with 30 commits on their topic branch could rebase all of these commits and fast-forward merge them to 'develop'. If those commits badly broke an ATDM build for example, then we would have to back out 30 commits, one git revert <sha1> at a time.

By disabling this option, the options of "Merge" and "Squash" are still available, which is all we want/need.

If the topic branch has more than one commit, and they are well-formed "Separate Changes" (see workflows(7)), then you really should select the "Merge" option. But if you have multiple commits, and they are kind of a mess, then you might as well select the "Squash" option. (But people really should be cleaning up their topic branches before their final topic branch push as described here).

If you only have one commit on your topic branch, then it is silly to create a merge commit for this. In that case, you should select "Squash". When you select "Squash" with a single commit, GitHub populates the squash commit summary and log text the same as for the single commit. Therefore, it is equivalent to rebasing a single commit in this case. And a single squashed commit is as easy to revert as a single merge commit. In fact, a single squash commit is easier to revert because you don't need to provide the parent index with git revert -m <sha>. You can just call git revert <sha1>.

Definition of Done

Possible Solution

@bartlettroscoe bartlettroscoe added Framework tasks Framework tasks (used internally by Framework team) client: ATDM Any issue primarily impacting the ATDM project labels May 10, 2018
@jmgate
Copy link
Contributor

jmgate commented May 10, 2018

If you're concerned about having to use revert, you can git revert <first>^..<second> to revert a range of commits. That was added to git back in 1.7.2.

I can think of scenarios in which you'd want to squash down to a small number of logically separate commits, but you'd want to keep them separate in the log. For instance, say you're refactoring a class, and in the process you decide to make some performance tweaks. Before a PR is merged you use rebase -i such that all the refactoring happens in a first commit, and all the performance tweaks happen in a second commit, just in case you might want to revert those separately later. The performance tweaks are tangential to the refactor, but they're on the same branch because the work was done at the same time. In my mind it makes more sense to "Rebase and merge" the two commits in the PR, because the performance tweaks don't necessarily have anything to do with the class refactor. If you disable the "Rebase and merge" option, what would make the most sense for the history would be to create two separate PRs, make sure the refactor one gets "Squash and merge"d first, and then accept the second one.

All that being said, the frequency with which such scenarios arise for me is minimal. ~95% of the time I'm rebase-merging a single commit. And how you get people to only push logically separate, compilable, testable commits to a main development branch without mechanically preventing them from doing so is very much an open question.

@bartlettroscoe
Copy link
Member Author

All that being said, the frequency with which such scenarios arise for me is minimal. ~95% of the time I'm rebase-merging a single commit. And how you get people to only push logically separate, compilable, testable commits to a main development branch without mechanically preventing them from doing so is very much an open question.

"Squash and merge" is identical to "Rebase and merge" when there is just one commit.

I have never used git revert <first>^..<second> but it is more complex than a single revert. Also, the git history is, arguably, cleaner when you have each topic branch explicitly merged it. That is especially try if you do a git rebase -i github/develop before your final topic branch push. That gives the best possible git history.

@bartlettroscoe bartlettroscoe removed the client: ATDM Any issue primarily impacting the ATDM project label May 22, 2018
@bartlettroscoe
Copy link
Member Author

@trilinos/framework,

There are people that are rebasing and pushing multiple commits with the option "Rebase and merge" button as seen recently in the example #3055 (comment). Note that GitHub appears not to let you revert these types of rebase and merges with the "revert" button. Also, git bisection that happens to hit one of these intermediate (untested) commits may have a false failure because it may not be a "complete" commit.

Can we please uncheck the box "Allow rebase merging"?

@bartlettroscoe
Copy link
Member Author

@trilinos/framework,

Related to this Issue, I think people need some guidance about how to effectively do git bisection with Trilinos by bisecting only first-parent history on the 'develop' branch. It seems that even experienced developers who know git well have trouble effectively bisecting Trilinos. One example is #3438 (comment). To make bisection with Trilinos robust, we should disable rebasing commits for PRs (which this issue is about) and provide guidelines for how to effectively bisect Trilinos (e.g. along the lines described here).

@bartlettroscoe
Copy link
Member Author

FYI:

Here is an example of multiple commits for a topic branch rebased onto 'develop' instead of merged:

* 227fdd4 "Fixed the recursive call to use `haveSameValuesSorted`. Created unit test to test for equality in sublists."
| Author: Daniel Jensen <dsjense@sandia.gov>
| Date:   Tue Aug 28 10:35:11 2018 -0600 (4 days ago)
| 
| M     packages/teuchos/parameterlist/src/Teuchos_ParameterList.cpp
| M     packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp
|  
* f49eff8 "Moved length check to beginning of function and changed "test" to "function" in documentation."
| Author: Daniel Jensen <dsjense@sandia.gov>
| Date:   Tue Aug 21 12:44:42 2018 -0600 (4 days ago)
| 
| M     packages/teuchos/parameterlist/src/Teuchos_ParameterList.cpp
| M     packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp
|  
* 0291b81 "Created function to compare ParameterLists independent of ordering. Created unit test to test ParameterLists with the same entries but different orderings. Added extra P
| Author: Daniel Jensen <dsjense@sandia.gov>
| Date:   Mon Aug 20 14:48:56 2018 -0600 (4 days ago)
| 
| M     packages/teuchos/parameterlist/src/Teuchos_ParameterList.cpp
| M     packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp
| M     packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp
|  

It looks like these commits are from PR #3325 which got merged 4 days ago. If you look at the commits for this PR:

you can see that the SHA1s for the commits are different.

This issue is, is that if you try to bisection on --first-parent commits on 'develop' then git bisect will consider the later two commits f49eff8 and 0291b81 which (on their own) never passed PR testing. Therefore, they may fail to build or pass tests.

@jmgate, did you select the "rebase" option or the "merge" option? If you only select the "squash" or the "merge" options, then this will not happen.

@bartlettroscoe
Copy link
Member Author

@jwillenbring and @william76,

Here are some examples of where people clicked the GitHub PR "Rebase" button for their PRs:

$ git log-oneline --first-parent --graph develop
.
.
.
* a88bfb1 "MueLu: fixing issues related to MueLu framework" <lberge@sandia.gov> [Fri Jun 22 11:03:35 2018 -0600] (4 months ago)
* 2e1b4f6f "MueLu: small edits after pohm push" <lberge@sandia.gov> [Thu Jun 21 17:59:51 2018 -0600] (4 months ago)
* 0d291f2 "MueLu: small style modification removing a warning at compile time." <lberge@sandia.gov> [Tue Jun 19 08:01:38 2018 -0600] (4 months ago)
* e237d83 "MueLu: Implementation of hybrid aggregation, allowing structured and unstructured aggregation on different ranks" <pohm@enigma.sandia.gov> [Thu Jun 21 16:30:44 2018 -0600] (4 months ago)
* 7e1868f "MueLu: making calculation of global number of coarse nodes optional in UncoupledIndexManager" <lberge@sandia.gov> [Wed Jun 13 13:35:12 2018 -0600] (4 months ago)
* ffe2fff "MueLu: modifying Index Manager interface" <lberge@sandia.gov> [Tue Jun 12 09:05:38 2018 -0600] (4 months ago)
* 7ce34fe "MueLu: adding hybrid aggregation to list of classes that need .hpp created" <lberge@sandia.gov> [Mon Jun 11 16:00:00 2018 -0600] (4 months ago)
* 10c4c51 "MueLu: fix in StructuredAggregationFactory for short name definition" <lberge@sandia.gov> [Mon Jun 11 15:02:58 2018 -0600] (4 months ago)
* 6d8ca19 "MueLu: Typo change in MueLu_AggregationStructuredAlgorithm_decl.hpp" <pohm@enigma.sandia.gov> [Mon Jun 11 14:23:31 2018 -0600] (4 months ago)
* 9228616 "MueLu: creating AggregationStructuredAlgorithm" <lberge@sandia.gov> [Fri Jun 8 17:28:05 2018 -0600] (4 months ago)
* a508ae0 "MueLu: adding stub for HybridAggregationFactory" <lberge@sandia.gov> [Thu Jun 7 17:44:11 2018 -0600] (4 months ago)
* 595eb74 "MueLu: Unit test for interface aggregation" <pohm@enigma.sandia.gov> [Tue Jun 5 15:24:25 2018 -0600] (4 months ago)
* 0b04ee8 "MueLu: Interface aggregation update" <pohm@enigma.sandia.gov> [Tue Jun 5 15:20:56 2018 -0600] (4 months ago)
* 807064f "MueLu: adding interface aggregation algorithm part of #2687" <lberge@sandia.gov> [Mon May 7 13:23:59 2018 -0600] (4 months ago)
.
.
.
* b33186e "Tpetra::CrsMatrix: {left,right}Scale now permit scaling by zero" <mhoemme@sandia.gov> [Wed May 30 22:58:13 2018 -0600] (5 months ago)
* 9fc5a05 "Ifpack2: Add example that will later demonstrate equilibration" <mhoemme@sandia.gov> [Wed May 30 22:54:56 2018 -0600] (5 months ago)
* 63f3598 "Tpetra::leftAndOrRightScaleCrsMatrix: Add Tpetra::Vector interface" <mhoemme@sandia.gov> [Wed May 30 12:28:21 2018 -0600] (5 months ago)
* f0325a9 "Tpetra::leftAndOrRightScaleCrsMatrix: Refactor interface" <mhoemme@sandia.gov> [Wed May 30 11:39:46 2018 -0600] (5 months ago)
* 81a20c4 "Tpetra::CrsMatrix::rightScale: Thread-parallelize" <mhoemme@sandia.gov> [Wed May 30 11:22:31 2018 -0600] (5 months ago)
* d8db4e2 "Tpetra::CrsMatrix: Fix #2844 (bug in rightScale)" <mhoemme@sandia.gov> [Wed May 30 11:18:08 2018 -0600] (5 months ago)
* 0441e06 "Tpetra::CrsMatrix::leftScale: Thread-parallelize" <mhoemme@sandia.gov> [Wed May 30 09:55:44 2018 -0600] (5 months ago)
* 6394e72 "Tpetra,Ifpack2: Move equilibration test from Tpetra to Ifpack2" <mhoemme@sandia.gov> [Tue May 29 17:45:12 2018 -0600] (5 months ago)
* d16fc06 "Tpetra: Add equilibration functions (see PR #2820) to Tpetra" <mhoemme@sandia.gov> [Tue May 29 17:17:01 2018 -0600] (5 months ago)
* 33f68d0 "Tpetra: Fix build warning (unused typedef) in MultiVector test" <mhoemme@sandia.gov> [Tue May 29 17:34:53 2018 -0600] (5 months ago)
* 8ce6207 "Tpetra: Fix build warning (unused typedef) in FixedHashTable test" <mhoemme@sandia.gov> [Tue May 29 17:34:12 2018 -0600] (5 months ago)
* 8c4f4fd "Tpetra: Fix build warnings (unused typedefs) in BlockCrs tests" <mhoemme@sandia.gov> [Tue May 29 17:32:26 2018 -0600] (5 months ago)
.
.
.
* b8c7184 "Tpetra: Improve CrsGraph, CrsMatrix, and RowMatrix documentation" <mhoemme@sandia.gov> [Wed May 16 11:59:02 2018 -0600] (5 months ago)
* 7c7a68a "Tpetra: Deprecate is{Lower,Upper}Triangular per #2630" <mhoemme@sandia.gov> [Wed May 16 11:43:27 2018 -0600] (5 months ago)
* 7740b0d "Tpetra: Remove spurious deprecation warnings due to #2630" <mhoemme@sandia.gov> [Wed May 16 10:53:37 2018 -0600] (5 months ago)
* 9c72494 "Tpetra: Remove all localSolve calls from tests (part of #581)" <mhoemme@sandia.gov> [Wed May 16 10:47:33 2018 -0600] (5 months ago)
* 741802f "Tpetra: Deprecate CrsMatrixSolveOp (part of #581)" <mhoemme@sandia.gov> [Wed May 16 10:46:59 2018 -0600] (5 months ago)
* 513c660 "Tempus: adding embedded dirk" <sconde@sandia.gov> [Tue Feb 20 13:24:19 2018 -0700] (5 months ago)
.
.
.
* 6b0f557 "Set Teko_DISABLE_LSCSTABALIZED_TPETRA_ALPAH_INV_D=TRUE for GCC 4.8.4 + OpenMP build (#2712) (#2715)" <rabartl@sandia.gov> [Thu May 10 16:54:57 2018 -0400] (6 months ago)
* ea50776 "WIP (#2262): remove aggregate-based strategy" <mmayr@sandia.gov> [Wed Apr 18 12:46:09 2018 -0700] (6 months ago)
* f261497 "HHG: do not build outdated code by Max" <mmayr@sandia.gov> [Wed May 9 11:34:58 2018 -0700] (6 months ago)
* 2e7475e "add new testcase" <mmayr@sandia.gov> [Wed Apr 18 12:45:41 2018 -0700] (6 months ago)
* 891c638 "WIP (#2305): add comments and documentation" <mmayr@sandia.gov> [Thu Apr 12 10:24:27 2018 -0700] (6 months ago)
* 4dee48e "WIP (#2305): remove outdated code" <mmayr@sandia.gov> [Thu Apr 12 08:28:43 2018 -0700] (6 months ago)
* 9918fa0 "WIP (#2305): fixed coarse level quasiRegional map" <mmayr@sandia.gov> [Wed Apr 11 15:52:35 2018 -0700] (6 months ago)
* 17a5e42 "WIP (#2305): enhance plotting of solution" <mmayr@sandia.gov> [Fri Mar 23 12:39:08 2018 -0700] (6 months ago)
* ac6e16a "WIP (#2305): fix quasiReg map on coarse level" <mmayr@sandia.gov> [Fri Mar 23 12:36:59 2018 -0700] (6 months ago)
* ecdbe09 "xml: add missing 'CoarseMap' factory" <mmayr@sandia.gov> [Thu Mar 22 09:55:54 2018 -0700] (6 months ago)
* bab45ef "WIP (#2305): add 2D test with 3h coarsening" <mmayr@sandia.gov> [Wed Mar 21 07:12:35 2018 -0700] (6 months ago)
* 326c4b6 "WIP (#2262): use struct. agg. and P for coarse GIDs" <mmayr@sandia.gov> [Thu Mar 15 12:32:24 2018 -0700] (6 months ago)
* 27e265f "WIP (#2262): fix compiler warnings" <mmayr@sandia.gov> [Mon Feb 26 11:05:37 2018 -0800] (6 months ago)
* dec93fb "WIP (#2262): recursive V-cycle for regions MG" <mmayr@sandia.gov> [Sat Feb 24 01:10:16 2018 -0800] (6 months ago)
* 5c6bcf6 "WIP (#2262): find coarse maps for 2-level scheme" <mmayr@sandia.gov> [Thu Feb 22 09:14:35 2018 -0800] (6 months ago)
* 7bd03d4 "Epetra: adding parallel check after local change in IntMultiVectorDistributed test" <lberge@sandia.gov> [Wed May 9 09:22:27 2018 -0600] (6 months ago)
* 4e30385 "Epetra: adding distributed test for IntMultiVector" <lberge@sandia.gov> [Tue May 8 11:50:52 2018 -0600] (6 months ago)
* 1c691be "Epetra: adding distributed test for IntMultiVector" <lberge@sandia.gov> [Wed May 2 08:46:56 2018 -0600] (6 months ago)
* 157cbbf "Epetra: cleaning up IntMultiVector test" <lberge@sandia.gov> [Fri Apr 20 10:33:59 2018 -0600] (6 months ago)
* 128630b "Epetra: adding IntMultiVector class" <lberge@sandia.gov> [Thu Apr 19 17:37:14 2018 -0600] (6 months ago)
* f3daf35 "MueLu: Remove use of deprecated Kokkos::View::ptr_on_device" <mhoemme@sandia.gov> [Wed May 9 15:58:55 2018 -0600] (6 months ago)
* 81695d0 "Teuchos: Purge calls to deprecated Kokkos::View methods" <mhoemme@sandia.gov> [Wed May 9 12:29:00 2018 -0600] (6 months ago)
* 074b921 "TrilinosCouplings: Purge calls to deprecated Kokkos::View methods" <mhoemme@sandia.gov> [Wed May 9 12:25:18 2018 -0600] (6 months ago)
* a9fbae8 "Xpetra: Purge calls to deprecated Kokkos::View methods" <mhoemme@sandia.gov> [Wed May 9 12:21:16 2018 -0600] (6 months ago)
* 145f8b3 "Ifpack2: Purge calls to deprecated Kokkos::View methods" <mhoemme@sandia.gov> [Wed May 9 12:07:50 2018 -0600] (6 months ago)
* 52211ec "Panzer: cleanup for #2697" <rppawlo@sandia.gov> [Wed May 9 12:03:13 2018 -0600] (6 months ago)
* e4341e1 "Panzer: cuda warnings" <rppawlo@sandia.gov> [Wed May 9 09:25:27 2018 -0600] (6 months ago)
* 3086c45 "Panzer: kokkosify blocked tpetra dirichlet scatter Jacobian #2697" <rppawlo@sandia.gov> [Wed May 9 08:08:39 2018 -0600] (6 months ago)
* e5010d3 "Panzer: kokkosify blocked tpetra dirichlet scatter residual #2697" <rppawlo@sandia.gov> [Tue May 8 14:51:04 2018 -0600] (6 months ago)
,
.
.

For that last set of commits directly rebased on top of 'develop', good luck getting a successful build if git rebase would happen to hit on those "WIP" commits! And that is a lot of commits to revert on the 'develop' branch in case that PR needed to be reverted.

@jwillenbring,

It looks like you disabled the "Rebase and merge" button for Trilinos? So should we close this Issue?

@bartlettroscoe
Copy link
Member Author

@jwillenbring just presented this at the TUG developer meeting and explained this to people. This is important to the ROL subteam workflow.

Therefore, I think we can close this now.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework tasks Framework tasks (used internally by Framework team)
Projects
None yet
Development

No branches or pull requests

2 participants