mirror of
https://github.com/git/git.git
synced 2024-11-02 15:28:21 +01:00
8f6aed71d2
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> |
||
---|---|---|
.. | ||
howto | ||
RelNotes | ||
technical | ||
.gitattributes | ||
.gitignore | ||
asciidoc.conf | ||
asciidoctor-extensions.rb | ||
blame-options.txt | ||
build-docdep.perl | ||
cat-texi.perl | ||
cmd-list.perl | ||
CodingGuidelines | ||
config.txt | ||
date-formats.txt | ||
diff-config.txt | ||
diff-format.txt | ||
diff-generate-patch.txt | ||
diff-options.txt | ||
docbook-xsl.css | ||
docbook.xsl | ||
everyday.txto | ||
fetch-options.txt | ||
fix-texi.perl | ||
fmt-merge-msg-config.txt | ||
git-add.txt | ||
git-am.txt | ||
git-annotate.txt | ||
git-apply.txt | ||
git-archimport.txt | ||
git-archive.txt | ||
git-bisect-lk2009.txt | ||
git-bisect.txt | ||
git-blame.txt | ||
git-branch.txt | ||
git-bundle.txt | ||
git-cat-file.txt | ||
git-check-attr.txt | ||
git-check-ignore.txt | ||
git-check-mailmap.txt | ||
git-check-ref-format.txt | ||
git-checkout-index.txt | ||
git-checkout.txt | ||
git-cherry-pick.txt | ||
git-cherry.txt | ||
git-citool.txt | ||
git-clean.txt | ||
git-clone.txt | ||
git-column.txt | ||
git-commit-tree.txt | ||
git-commit.txt | ||
git-config.txt | ||
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 | ||
git-describe.txt | ||
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 | ||
git-fetch.txt | ||
git-filter-branch.txt | ||
git-fmt-merge-msg.txt | ||
git-for-each-ref.txt | ||
git-format-patch.txt | ||
git-fsck-objects.txt | ||
git-fsck.txt | ||
git-gc.txt | ||
git-get-tar-commit-id.txt | ||
git-grep.txt | ||
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 | ||
git-init-db.txt | ||
git-init.txt | ||
git-instaweb.txt | ||
git-interpret-trailers.txt | ||
git-log.txt | ||
git-ls-files.txt | ||
git-ls-remote.txt | ||
git-ls-tree.txt | ||
git-mailinfo.txt | ||
git-mailsplit.txt | ||
git-merge-base.txt | ||
git-merge-file.txt | ||
git-merge-index.txt | ||
git-merge-one-file.txt | ||
git-merge-tree.txt | ||
git-merge.txt | ||
git-mergetool--lib.txt | ||
git-mergetool.txt | ||
git-mktag.txt | ||
git-mktree.txt | ||
git-mv.txt | ||
git-name-rev.txt | ||
git-notes.txt | ||
git-p4.txt | ||
git-pack-objects.txt | ||
git-pack-redundant.txt | ||
git-pack-refs.txt | ||
git-parse-remote.txt | ||
git-patch-id.txt | ||
git-prune-packed.txt | ||
git-prune.txt | ||
git-pull.txt | ||
git-push.txt | ||
git-quiltimport.txt | ||
git-read-tree.txt | ||
git-rebase.txt | ||
git-receive-pack.txt | ||
git-reflog.txt | ||
git-remote-ext.txt | ||
git-remote-fd.txt | ||
git-remote-helpers.txto | ||
git-remote-testgit.txt | ||
git-remote.txt | ||
git-repack.txt | ||
git-replace.txt | ||
git-request-pull.txt | ||
git-rerere.txt | ||
git-reset.txt | ||
git-rev-list.txt | ||
git-rev-parse.txt | ||
git-revert.txt | ||
git-rm.txt | ||
git-send-email.txt | ||
git-send-pack.txt | ||
git-sh-i18n--envsubst.txt | ||
git-sh-i18n.txt | ||
git-sh-setup.txt | ||
git-shell.txt | ||
git-shortlog.txt | ||
git-show-branch.txt | ||
git-show-index.txt | ||
git-show-ref.txt | ||
git-show.txt | ||
git-stage.txt | ||
git-stash.txt | ||
git-status.txt | ||
git-stripspace.txt | ||
git-submodule.txt | ||
git-svn.txt | ||
git-symbolic-ref.txt | ||
git-tag.txt | ||
git-tools.txt | ||
git-unpack-file.txt | ||
git-unpack-objects.txt | ||
git-update-index.txt | ||
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 | ||
git-write-tree.txt | ||
git.txt | ||
gitattributes.txt | ||
gitcli.txt | ||
gitcore-tutorial.txt | ||
gitcredentials.txt | ||
gitcvs-migration.txt | ||
gitdiffcore.txt | ||
giteveryday.txt | ||
gitglossary.txt | ||
githooks.txt | ||
gitignore.txt | ||
gitk.txt | ||
gitmodules.txt | ||
gitnamespaces.txt | ||
gitremote-helpers.txt | ||
gitrepository-layout.txt | ||
gitrevisions.txt | ||
gitsubmodules.txt | ||
gittutorial-2.txt | ||
gittutorial.txt | ||
gitweb.conf.txt | ||
gitweb.txt | ||
gitworkflows.txt | ||
glossary-content.txt | ||
howto-index.sh | ||
i18n.txt | ||
install-doc-quick.sh | ||
install-webdoc.sh | ||
line-range-format.txt | ||
lint-gitlink.perl | ||
mailmap.txt | ||
Makefile | ||
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-options.txt | ||
merge-strategies.txt | ||
pretty-formats.txt | ||
pretty-options.txt | ||
pull-fetch-param.txt | ||
rebase-config.txt | ||
rev-list-options.txt | ||
revisions.txt | ||
sequencer.txt | ||
SubmittingPatches | ||
texi.xsl | ||
transfer-data-leaks.txt | ||
urls-remotes.txt | ||
urls.txt | ||
user-manual.conf | ||
user-manual.txt |