1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 15:28:21 +01:00
git/Documentation
Johannes Schindelin 8f6aed71d2 rebase: introduce the --rebase-merges option
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 move commits between branches or, deity forbid, to split topic branches
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 <label>`. And once this mode will
have become stable and universally accepted, we can deprecate the design
mistake that was `--preserve-merges`.

Link *1*:
https://github.com/msysgit/msysgit/blob/master/share/msysGit/shears.sh
Link *2*:
https://github.com/git-for-windows/build-extra/blob/master/shears.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-26 12:28:43 +09:00
..
howto t/helper: merge test-sha1 into test-tool 2018-03-27 08:45:47 -07:00
RelNotes The fourth batch for 2.18 2018-04-25 13:44:42 +09:00
technical Merge branch 'sb/filenames-with-dashes' 2018-04-25 13:29:05 +09:00
.gitattributes
.gitignore Documentation: convert SubmittingPatches to AsciiDoc 2017-11-13 13:25:19 +09:00
asciidoc.conf
asciidoctor-extensions.rb
blame-options.txt
build-docdep.perl
cat-texi.perl
cmd-list.perl
CodingGuidelines CodingGuidelines: mention "static" and "extern" 2018-02-08 14:20:43 -08:00
config.txt Merge branch 'lv/tls-1.3' 2018-04-11 13:09:57 +09:00
date-formats.txt
diff-config.txt
diff-format.txt
diff-generate-patch.txt
diff-options.txt Merge branch 'en/doc-typoes' 2018-04-25 13:28:58 +09:00
docbook-xsl.css
docbook.xsl
everyday.txto
fetch-options.txt fetch: add a --prune-tags option and fetch.pruneTags config 2018-02-09 13:10:13 -08:00
fix-texi.perl
fmt-merge-msg-config.txt
git-add.txt add: introduce "--renormalize" 2017-11-17 10:31:05 +09:00
git-am.txt Merge branch 'nd/rebase-show-current-patch' 2018-03-06 14:54:02 -08:00
git-annotate.txt diff: --indent-heuristic is no longer experimental 2017-11-02 14:51:24 +09:00
git-apply.txt
git-archimport.txt
git-archive.txt
git-bisect-lk2009.txt
git-bisect.txt Merge branch 'ak/bisect-doc-typofix' 2018-04-25 13:28:56 +09:00
git-blame.txt diff: --indent-heuristic is no longer experimental 2017-11-02 14:51:24 +09:00
git-branch.txt Merge branch 'tz/branch-doc-remove-set-upstream' 2017-12-06 09:23:36 -08:00
git-bundle.txt
git-cat-file.txt cat-file doc: document that -e will return some output 2018-01-10 15:08:14 -08:00
git-check-attr.txt
git-check-ignore.txt
git-check-mailmap.txt
git-check-ref-format.txt Doc/check-ref-format: clarify information about @{-N} syntax 2017-12-19 10:00:45 -08:00
git-checkout-index.txt
git-checkout.txt Merge branch 'ks/doc-checkout-previous' 2017-12-13 13:28:57 -08:00
git-cherry-pick.txt
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt Documentation/git-clone: improve description for submodule recursing 2017-12-05 11:30:38 -08:00
git-column.txt
git-commit-tree.txt
git-commit.txt commit: add support for --fixup <commit> -m"<extra message>" 2017-12-22 13:10:24 -08:00
git-config.txt config: change default of pager.config to "on" 2018-02-21 14:27:30 -08:00
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt
git-credential.txt
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt
git-daemon.txt daemon: add --log-destination=(stderr|syslog|none) 2018-02-05 10:30:44 -08:00
git-describe.txt builtin/describe.c: describe a blob 2017-12-19 11:17:16 -08:00
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt
git-fast-export.txt
git-fast-import.txt
git-fetch-pack.txt Documentation: fix several one-character-off spelling errors 2018-04-09 14:15:02 +09:00
git-fetch.txt fetch: make the --prune-tags work with <url> 2018-02-09 13:10:13 -08:00
git-filter-branch.txt filter-branch: return 2 when nothing to rewrite 2018-03-15 10:41:51 -07:00
git-fmt-merge-msg.txt
git-for-each-ref.txt Documentation: fix several one-character-off spelling errors 2018-04-09 14:15:02 +09:00
git-format-patch.txt
git-fsck-objects.txt
git-fsck.txt
git-gc.txt gc.txt: more details about what gc does 2018-03-15 12:37:45 -07:00
git-get-tar-commit-id.txt
git-grep.txt Merge branch 'mr/doc-negative-pathspec' into maint 2017-10-18 14:19:12 +09:00
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt index-pack: support checking objects but not links 2018-03-15 10:16:24 -07:00
git-init-db.txt
git-init.txt
git-instaweb.txt
git-interpret-trailers.txt Merge branch 'bc/doc-interpret-trailers-grammofix' into maint 2018-03-22 14:24:21 -07:00
git-log.txt log: add option to choose which refs to decorate 2017-11-22 13:18:59 +09:00
git-ls-files.txt fsmonitor: add documentation for the fsmonitor extension. 2017-10-01 17:23:05 +09:00
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt merge-base --fork-point doc: clarify the example and failure modes 2017-11-09 12:28:30 +09:00
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt Merge branch 'wk/pull-signoff' 2017-11-06 14:24:24 +09:00
git-mergetool--lib.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt Documentation: normalize spelling of 'normalised' 2018-04-09 14:15:07 +09:00
git-mv.txt
git-name-rev.txt
git-notes.txt Merge branch 'rd/doc-notes-prune-fix' 2017-12-06 09:23:40 -08:00
git-p4.txt git-p4: update multiple shelved change lists 2017-12-22 13:30:52 -08:00
git-pack-objects.txt gc: do not repack promisor packfiles 2017-12-08 09:52:42 -08:00
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt
git-prune-packed.txt
git-prune.txt prune: add "--progress" to man page and usage msg 2017-11-22 12:29:30 +09:00
git-pull.txt
git-push.txt builtin/push.c: add push.pushOption config 2017-10-24 09:57:54 +09:00
git-quiltimport.txt
git-read-tree.txt Merge branch 'as/read-tree-prefix-doc-fix' into maint 2018-02-15 15:18:14 -08:00
git-rebase.txt rebase: introduce the --rebase-merges option 2018-04-26 12:28:43 +09:00
git-receive-pack.txt
git-reflog.txt doc: add missing "-n" (dry-run) option to reflog man page 2017-11-22 12:24:47 +09:00
git-remote-ext.txt
git-remote-fd.txt
git-remote-helpers.txto
git-remote-testgit.txt
git-remote.txt git remote doc: correct dangerous lies about what prune does 2018-02-09 13:10:12 -08:00
git-repack.txt
git-replace.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt
git-rev-list.txt rev-list: add list-objects filtering support 2017-11-22 14:11:57 +09:00
git-rev-parse.txt Merge branch 'sb/rev-parse-show-superproject-root' 2017-10-28 10:18:40 +09:00
git-revert.txt
git-rm.txt
git-send-email.txt Merge branch 'en/doc-typoes' 2018-04-25 13:28:58 +09:00
git-send-pack.txt
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt shell: drop git-cvsserver support by default 2017-09-12 11:05:58 +09:00
git-shortlog.txt git-shortlog.txt: reorder usages 2018-03-13 12:20:03 -07:00
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt doc: mention 'git show' defaults to HEAD 2018-01-30 13:12:18 -08:00
git-stage.txt
git-stash.txt git-stash.txt: remove extra square bracket 2018-03-27 19:09:13 -07:00
git-status.txt Merge branch 'en/doc-typoes' 2018-04-25 13:28:58 +09:00
git-stripspace.txt
git-submodule.txt Doc/git-submodule: improve readability and grammar of a sentence 2018-01-16 11:34:36 -08:00
git-svn.txt git-svn: allow empty email-address using authors-prog and authors-file 2018-04-05 19:22:06 +00:00
git-symbolic-ref.txt
git-tag.txt tag: add --edit option 2018-02-07 12:46:48 -08:00
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt Merge branch 'bp/fsmonitor' into maint 2018-03-22 14:24:21 -07:00
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-commit.txt
git-verify-pack.txt
git-verify-tag.txt
git-web--browse.txt
git-whatchanged.txt
git-worktree.txt Merge branch 'es/worktree-docs' 2018-04-25 13:29:02 +09:00
git-write-tree.txt
git.txt Merge branch 'ab/man-sec-list' 2018-03-15 15:00:46 -07:00
gitattributes.txt Merge branch 'jk/attributes-path-doc' 2018-03-21 11:30:15 -07:00
gitcli.txt
gitcore-tutorial.txt
gitcredentials.txt
gitcvs-migration.txt
gitdiffcore.txt
giteveryday.txt
gitglossary.txt
githooks.txt Merge branch 'es/worktree-checkout-hook' 2017-12-27 11:16:21 -08:00
gitignore.txt gitignore.txt: elaborate shell glob syntax 2018-02-02 10:56:46 -08:00
gitk.txt
gitmodules.txt
gitnamespaces.txt
gitremote-helpers.txt introduce fetch-object: fetch one promisor object 2017-12-05 09:46:05 -08:00
gitrepository-layout.txt worktree: delete dead code 2018-03-15 12:37:47 -07:00
gitrevisions.txt
gitsubmodules.txt Merge branch 'ms/non-ascii-ticks' into maint 2018-03-22 14:24:26 -07:00
gittutorial-2.txt
gittutorial.txt
gitweb.conf.txt
gitweb.txt
gitworkflows.txt Merge branch 'db/doc-workflows-neuter-the-maintainer' 2017-12-27 11:16:25 -08:00
glossary-content.txt Merge branch 'mr/doc-negative-pathspec' into maint 2017-10-18 14:19:12 +09:00
howto-index.sh
i18n.txt
install-doc-quick.sh install-doc-quick: allow specifying what ref to install 2017-12-12 16:49:40 -08:00
install-webdoc.sh
line-range-format.txt
lint-gitlink.perl
mailmap.txt
Makefile Docs: split out long-running subprocess handshake 2018-01-25 11:24:32 -08:00
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt merge: add config option for verifySignatures 2017-12-12 10:51:38 -08:00
merge-options.txt merge: allow fast-forward when merging a tracked tag 2018-02-16 11:22:43 -08:00
merge-strategies.txt Merge branch 'dp/merge-strategy-doc-fix' 2018-03-21 11:30:13 -07:00
pretty-formats.txt Merge branch 'mk/doc-pretty-fill' 2018-03-08 12:36:29 -08:00
pretty-options.txt
pull-fetch-param.txt fetch doc: src side of refspec could be full SHA-1 2017-10-18 05:59:34 +09:00
rebase-config.txt rebase -i: learn to abbreviate command names 2017-12-05 10:20:51 -08:00
rev-list-options.txt Merge branch 'jh/fsck-promisors' 2018-02-13 13:39:03 -08:00
revisions.txt Documentation: revisions: fix typo: "three dot" ---> "three-dot" (in line with "two-dot"). 2017-12-04 08:25:06 -08:00
sequencer.txt
SubmittingPatches SubmittingPatches: mention the git contacts command 2018-04-12 11:34:34 +09:00
texi.xsl
transfer-data-leaks.txt
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt checkout: describe_detached_head: remove ellipsis after committish 2017-12-06 07:32:40 -08:00