From: Stefan Beller Date: Tue, 30 Jan 2018 20:17:01 GMT Subject: Re: [PATCH v2 02/10] sequencer: introduce new commands to reset the revision Message-ID: In-Reply-To: <36281a14bc9f9a53e6c1bead561e3c93744047a8.1517266437.git.johannes.schindelin@gmx.de> On Mon, Jan 29, 2018 at 2:54 PM, Johannes Schindelin wrote: > In the upcoming commits, we will teach the sequencer to recreate 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, merging labeled revisions. > > This idea was developed in Git for Windows' Git garden shears (that are > used to maintain the "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`). > > 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. > > Signed-off-by: Johannes Schindelin > --- > git-rebase--interactive.sh | 2 + > sequencer.c | 180 ++++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 179 insertions(+), 3 deletions(-) > > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh > index fcedece1860..7e5281e74aa 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