From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, STOX_REPLY_TYPE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id ACB7D1F424 for ; Sun, 22 Apr 2018 14:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756245AbeDVOt1 (ORCPT ); Sun, 22 Apr 2018 10:49:27 -0400 Received: from smtp-out-1.talktalk.net ([62.24.135.65]:32463 "EHLO smtp-out-1.talktalk.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757117AbeDVOPn (ORCPT ); Sun, 22 Apr 2018 10:15:43 -0400 Received: from PhilipOakley ([92.29.14.162]) by smtp.talktalk.net with SMTP id AFlyf1zdt4ZqzAFlyflNgl; Sun, 22 Apr 2018 15:15:41 +0100 X-Originating-IP: [92.29.14.162] X-Spam: 0 X-OAuthority: v=2.3 cv=E/fjW5Vl c=1 sm=1 tr=0 a=NXc+vVEgz70gitWznrz3ig==:117 a=NXc+vVEgz70gitWznrz3ig==:17 a=8nJEP1OIZ-IA:10 a=NEAV23lmAAAA:8 a=UhTQcNhz9eT0pPCKhZ4A:9 a=wPNLvfGTeEIA:10 Message-ID: Reply-To: "Philip Oakley" From: "Philip Oakley" To: "Johannes Schindelin" , "Git List" Cc: "Junio C Hamano" , "Jacob Keller" , "Stefan Beller" , "Eric Sunshine" , "Phillip Wood" , "Igor Djordjevic" , "Johannes Sixt" , "Sergey Organov" , =?iso-8859-1?Q?Martin_=C5gren?= References: <0c92bdd1829328544269722cbbd3edcd169bb148.1524306547.git.johannes.schindelin@gmx.de> Subject: Re: [PATCH v8 09/16] rebase: introduce the --rebase-merges option Date: Sun, 22 Apr 2018 15:15:27 +0100 Organization: OPDS MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Antivirus: AVG (VPS 180422-0, 22/04/2018), Outbound message X-Antivirus-Status: Clean X-CMAE-Envelope: MS4wfDALFtyGOjEHnw5rD712VbrpYzBGm/joEQWbsgWr1YOXn2qtNROpZfTGNUx29/CZZFc6LnN52UDaj823lPLDa290FsplVPQhgBDfpIJbwPkC0mL3s+2Y EWFff7128UTHayQOBWa0fbw3kbWj0tpriyGzsk64wSYeaJITMdWzgNUb9EYTQ3lNDkpvcz6/IF0MV1UjMg4Uh2v0Z6dsAeVHsPsRQnv+Brjv7pDwH26T2MRM +gxXHjXPWnL7QPu5veXiAPyKTjunHyZRbibCtBNyKG5Gbm5YgR84CBdHuKWX/NdDqPdf+DEuwZ0+XvTnFN8CfocnSoHd97xHaVrR7GL4DyWUXBkltqmNJL0P +D6cUcxScThBCJ4gh9sV2ALNUC/AxpF3iVPpsvJtXy62Qx6Hz9fM4+reX9YfN98SoPFPYcPel1mViIfJbx7868gj7Z1gQvSP6taMABN0vvKg9kxiCpXhuLR6 1hN2nbzOHNhFtE5JbtKUcyx+K/6K/LYkfFcJbw== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: "Johannes Schindelin" > Once upon a time, this here developer thought: wouldn't it be nice if, > say, Git for Windows' patches on top of core Git could be represented as > a thicket of branches, and be rebased on top of core Git in order to > maintain a cherry-pick'able set of patch series? > > The original attempt to answer this was: git rebase --preserve-merges. > > However, that experiment was never intended as an interactive option, > and it only piggy-backed on git rebase --interactive because that > command's implementation looked already very, very familiar: it was > designed by the same person who designed --preserve-merges: yours truly. > > Some time later, some other developer (I am looking at you, Andreas! > ;-)) decided that it would be a good idea to allow --preserve-merges to > be combined with --interactive (with caveats!) and the Git maintainer > (well, the interim Git maintainer during Junio's absence, that is) > agreed, and that is when the glamor of the --preserve-merges design > started to fall apart rather quickly and unglamorously. > > The reason? In --preserve-merges mode, the parents of a merge commit (or > for that matter, of *any* commit) were not stated explicitly, but were > *implied* by the commit name passed to the `pick` command. > > This made it impossible, for example, to reorder commits. Not to mention > to flatten the branch topology or, deity forbid, to split topic branches Aside: The idea of a "flattened" topology is, to my mind, not actually defined though may be understood by devs working in the area. Hopefully it's going away as a term, though the new 'cousins' will need clarification (there's no dot notation for that area of topology). > into two. > > Alas, these shortcomings also prevented that mode (whose original > purpose was to serve Git for Windows' needs, with the additional hope > that it may be useful to others, too) from serving Git for Windows' > needs. > > Five years later, when it became really untenable to have one unwieldy, > big hodge-podge patch series of partly related, partly unrelated patches > in Git for Windows that was rebased onto core Git's tags from time to > time (earning the undeserved wrath of the developer of the ill-fated > git-remote-hg series that first obsoleted Git for Windows' competing > approach, only to be abandoned without maintainer later) was really > untenable, the "Git garden shears" were born [*1*/*2*]: a script, > piggy-backing on top of the interactive rebase, that would first > determine the branch topology of the patches to be rebased, create a > pseudo todo list for further editing, transform the result into a real > todo list (making heavy use of the `exec` command to "implement" the > missing todo list commands) and finally recreate the patch series on > top of the new base commit. > > That was in 2013. And it took about three weeks to come up with the > design and implement it as an out-of-tree script. Needless to say, the > implementation needed quite a few years to stabilize, all the while the > design itself proved itself sound. > > With this patch, the goodness of the Git garden shears comes to `git > rebase -i` itself. Passing the `--rebase-merges` option will generate > a todo list that can be understood readily, and where it is obvious > how to reorder commits. New branches can be introduced by inserting > `label` commands and calling `merge