git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Adam Spiers <git@adamspiers.org>
To: git mailing list <git@vger.kernel.org>
Subject: RFC: new git-transplant subcommand for non-interactively moving commits between branches
Date: Mon, 30 May 2016 01:34:48 +0100	[thread overview]
Message-ID: <20160530003448.GF11256@pacific.linksys.moosehall> (raw)
In-Reply-To: <20160527140811.GB11256@pacific.linksys.moosehall>

On Fri, May 27, 2016 at 03:08:11PM +0100, Adam Spiers wrote:
> Hi all,
>
> I finally got around to implementing a new git subcommand which I've
> wanted for quite a while.  I've called it git-splice.

[snipped]

> Next steps, and the future
> --------------------------
>
> Obviously, I'd welcome thoughts on whether it would make sense to
> include this in the git distribution.
>
> In the longer term however, I'd like to write two more subcommands:
>
>   - git-transplant(1) which wraps around git-splice(1) and enables
>     easy non-interactive transplanting of a range of commits from
>     one branch to another.  This should be pretty straightforward
>     to implement.

I've now written git-transplant too (and in the process of doing so,
made many more enhancements to git-splice).


Usage
-----

Examples:

    # Move commits A..B from the current branch onto branch X
    git transplant A..B X

    # Move commits A..B from the current branch into branch X after commit C
    git transplant --after=C A..B X

    # Create a new branch X starting at ref Y, then
    # move commits A..B from the current branch onto X
    git transplant --new-from=Y C A..B X

    # Abort a transplant which failed during cherry-pick or rebase
    git transplant --abort

    # Resume a transplant after manually fixing conflicts caused by
    # cherry-pick or rebase
    git transplant --continue

N.B. this command rewrites history, since after splicing the commits
into the target branch, it removes them from the current branch.  As
with git rebase, you should be aware of all the implications of
history rewriting before using it.


Motivation
----------

See the rest of this mail thread.


Code
----

> Currently this is in alpha state:
>
>   https://github.com/git/git/compare/master...aspiers:splice
>
> and I reserve the right to rewrite the history of that branch in the
> near future ;-)

This still holds for git-splice, but also now for git-transplant too:
the same branch now contains git-transplant and its test suite.


Next steps
----------

- Wait for feedback.  (Ideally I hope people will actually try both tools.)

- If there is any appetite for eventually moving this into the
  distribution, it will still need quite a few things cleaning up first,
  e.g. making the coding style consistent with git's, getting rid of
  bashisms ...

- (Eventually) write git-explode, as explained elsewhere in this thread.


Cheers!
Adam

      parent reply	other threads:[~2016-05-30  0:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 14:08 RFC: new git-splice subcommand for non-interactive branch splicing Adam Spiers
2016-05-27 15:27 ` Johannes Schindelin
2016-05-27 16:36   ` Adam Spiers
2016-05-28  7:06     ` Johannes Schindelin
2016-05-28 11:24       ` Adam Spiers
2016-05-30  0:34 ` Adam Spiers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160530003448.GF11256@pacific.linksys.moosehall \
    --to=git@adamspiers.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).