From: Johannes Schindelin Date: Mon, 29 Jan 2018 22:54:46 GMT Subject: [PATCH v2 03/10] sequencer: introduce the `merge` command Message-ID: <42839735d7aa3e56411cb68fd645349e09239777.1517266437.git.johannes.schindelin@gmx.de> In-Reply-To: This patch is part of the effort to reimplement `--preserve-merges` with a substantially improved design, a design that has been developed in the Git for Windows project to maintain the dozens of Windows-specific patch series on top of upstream Git. The previous patch implemented the `label` and `reset` commands to label commits and to reset to a labeled commits. This patch adds the `merge` command, with the following syntax: merge The parameter in this instance is the *original* merge commit, whose author and message will be used for the to-be-created merge commit. The parameter refers to the (possibly rewritten) revision to merge. Let's see an example of a todo list: label onto # Branch abc reset onto pick deadbeef Hello, world! label abc reset onto pick cafecafe And now for something completely different merge baaabaaa abc Merge the branch 'abc' into master To support creating *new* merges, i.e. without copying the commit message from an existing commit, use the special value `-` as parameter (in which case the text after the parameter is used as commit message): merge - abc This will be the actual commit message of the merge This comes in handy when splitting a branch into two or more branches. Note: this patch only adds support for recursive merges, to keep things simple. Support for octopus merges will be added later in a separate patch series, support for merges using strategies other than the recursive merge is left for the future. Signed-off-by: Johannes Schindelin --- git-rebase--interactive.sh | 4 ++ sequencer.c | 146 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 146 insertions(+), 4 deletions(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 7e5281e74aa..d6fd30f6c09 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -164,6 +164,10 @@ x, exec = run command (the rest of the line) using shell d, drop = remove commit l, label