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.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,T_DKIMWL_WL_MED 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 B62841F424 for ; Fri, 20 Apr 2018 09:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754267AbeDTJjp (ORCPT ); Fri, 20 Apr 2018 05:39:45 -0400 Received: from smtp-out-6.talktalk.net ([62.24.135.70]:8148 "EHLO smtp-out-6.talktalk.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754170AbeDTJjn (ORCPT ); Fri, 20 Apr 2018 05:39:43 -0400 Received: from [192.168.2.201] ([92.28.131.105]) by smtp.talktalk.net with SMTP id 9SW2flnpQLjjA9SW3fXOhM; Fri, 20 Apr 2018 10:39:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=talktalk.net; s=cmr1711; t=1524217180; bh=6eFsfOiH2UJV6tMLnJNh24c8ci65J++Umgft8JOgf0s=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To; b=dE+fkc2Hnmco683nNj2DrEHCDG25/59CzuYqhrdpLyGa7hg6W12+4/pOZacPj4i/u 8s765oaTjXJ3wbh9K8Km3QUYfheWXaqD771yHmaYNrJfANjij18QR0cmveGJXjwKcH UX5i6VAD0Zow0dgUsOiUn8l8pTNi+SmM266+KkXA= X-Originating-IP: [92.28.131.105] X-Spam: 0 X-OAuthority: v=2.3 cv=LZYSFAXi c=1 sm=1 tr=0 a=D1tPBkQZhJ8hQpCscnDOhQ==:117 a=D1tPBkQZhJ8hQpCscnDOhQ==:17 a=IkcTkHD0fZMA:10 a=k3s2tj-HojBvZ64-kRgA:9 a=uC8Rb-qEAlX2qMB0:21 a=VGRm5YqpI8qMmDyD:21 a=QEXdDO2ut3YA:10 Reply-To: phillip.wood@dunelm.org.uk Subject: Re: [PATCH v7 06/17] sequencer: introduce new commands to reset the revision To: Johannes Schindelin , git@vger.kernel.org Cc: Junio C Hamano , Jacob Keller , Stefan Beller , Philip Oakley , Eric Sunshine , Phillip Wood , Igor Djordjevic , Johannes Sixt , Sergey Organov , =?UTF-8?Q?Martin_=c3=85gren?= References: <77c08b61387057af1be57c2b50769651cc8ec898.1524139900.git.johannes.schindelin@gmx.de> From: Phillip Wood Message-ID: Date: Fri, 20 Apr 2018 10:39:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <77c08b61387057af1be57c2b50769651cc8ec898.1524139900.git.johannes.schindelin@gmx.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfE162cxVog4lYm6dug9KBcuT8PF40mlxrtgS50W14sw2hQqS3H4PHnxU1JicKFrqLVn2ZKrBg/qQBWJWWc/G00QrdGoR1rienxVedOG3/viqPT/uyaD+ JTF5AVlZJcyGlAsm1VzNGA/NTZKabUfrCcqLvGbYe4Toq8bqhHMaoKBQl1ynwNoHYYkya91hYwdM02z5mXwDxt4WiIccNI01aeEmeEo0xA/O6S0kb1hPcUDr chFO8N6LSRABh/Fd8n7XfhFssdeSOluQrQ5if1cWRqpz8bs1UjvtYNRIAumN/GnYsPyNyCEsfWUlfRK9YzELDldoAh1XFO9MpMedMsLtM01Lsv5m1liRCa8+ GGt3xDn8t0QvGjELUCWjyZADoMsZKATGPiQq9vahNFLam7PrDFwGqtr5HYbmMvsYirw3wq9HIwlOE7hAiou1s9Q6DQPnN4MHVUEbhMtbCmGMdE0MHS/fajSm K9bJpabCUqNpMAo63CFYTPjmdJ4Hes+OMH709XnADTyChHsfbeiw9vizkRwaR0WYjXJFH0qBoAJgCK/p Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 19/04/18 13:20, Johannes Schindelin wrote: > In the upcoming commits, we will teach the sequencer to rebase merges. > This will be done in a very different way from the unfortunate design of > `git rebase --preserve-merges` (which does not allow for reordering > commits, or changing the branch topology). > > The main idea is to introduce new todo list commands, to support > labeling the current revision with a given name, resetting the current > revision to a previous state, and merging labeled revisions. > > This idea was developed in Git for Windows' Git garden shears (that are > used to maintain Git for Windows' "thicket of branches" on top of > upstream Git), and this patch is part of the effort to make it available > to a wider audience, as well as to make the entire process more robust > (by implementing it in a safe and portable language rather than a Unix > shell script). > > This commit implements the commands to label, and to reset to, given > revisions. The syntax is: > > label > reset > > Internally, the `label ` command creates the ref > `refs/rewritten/`. This makes it possible to work with the labeled > revisions interactively, or in a scripted fashion (e.g. via the todo > list command `exec`). > > These temporary refs are removed upon sequencer_remove_state(), so that > even a `git rebase --abort` cleans them up. > > We disallow '#' as label because that character will be used as separator > in the upcoming `merge` command. > > Later in this patch series, we will mark the `refs/rewritten/` refs as > worktree-local, to allow for interactive rebases to be run in parallel in > worktrees linked to the same repository. > > As typos happen, a failed `label` or `reset` command will be rescheduled > immediately. Note that this needs a little change in the original code to > perform a reschedule: there is no commit from which to generate a patch > here (and we will simply fall through to the regular `return res`). We > keep that code path, though, because we will use it for the upcoming > `merge` command, too. > > Signed-off-by: Johannes Schindelin > --- > git-rebase--interactive.sh | 2 + > sequencer.c | 201 +++++++++++++++++++++++++++++++++++-- > 2 files changed, 196 insertions(+), 7 deletions(-) > > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh > index e1b865f43f2..e8d3a7d7588 100644 > --- a/git-rebase--interactive.sh > +++ b/git-rebase--interactive.sh > @@ -162,6 +162,8 @@ s, squash = use commit, but meld into previous commit > f, fixup = like \"squash\", but discard this commit's log message > x, exec = run command (the rest of the line) using shell > d, drop = remove commit > +l, label