From: Paolo Bonzini <bonzini@gnu.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>, s-beyer@gmx.net
Subject: Re: [PATCH] provide a new "theirs" strategy, useful for rebase --onto
Date: Sun, 08 Jun 2008 16:06:33 -0700 [thread overview]
Message-ID: <484C65F9.10007@gnu.org> (raw)
In-Reply-To: <7vk5gziqxn.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
> Paolo Bonzini <bonzini@gnu.org> writes:
>
>> #! /bin/sh
>> # git-merge-after-amend <branch>
>> #
>> # Makes it possible to do a fast-forward merge of <branch>
>> # into HEAD, assuming that the first diverging commit of <branch>
>> # is an --amend'ed version of the first diverging commit of HEAD.
>
> Can this strong special case limitation "only the first one can be the
> amend" somehow be loosened?
Well, the point of the exercise is to split a *single* commit into a
"base" commit (already available, possibly on another branch) and a
"delta" (the amending, transformed into an independent commit whose
parent is the "base"). Indeed you can do that for any commit.
The script uses the "git-merge-base" to compute the "base", and takes
the following commit (on the path to HEAD) as the "delta". That's what
add the restriction. You can definitely make a two-argument variation
that, given arguments "B C" and history
o--B (it is irrelevant if B and C have common parents)
o--o--C--D--E HEAD
makes
A--B--C'--D--E
Even in that case, I would make the script (which anyway is obviously
not meant to be included in git, it's a commodity script) accept both
variations: one-argument to do the special case, and two-arguments to
generically split a commit into a base provided by the user + a delta.
Paolo
prev parent reply other threads:[~2008-06-08 23:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 10:59 [PATCH] provide a new "theirs" strategy, useful for rebase --onto Paolo Bonzini
2008-06-06 11:27 ` Peter Karlsson
2008-06-06 11:28 ` Paolo Bonzini
2008-06-06 14:14 ` Miklos Vajna
2008-06-06 23:08 ` Junio C Hamano
2008-06-08 2:54 ` Paolo Bonzini
2008-06-08 8:16 ` Junio C Hamano
2008-06-08 13:38 ` Paolo Bonzini
2008-06-08 20:59 ` Junio C Hamano
2008-06-08 23:06 ` Paolo Bonzini [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=484C65F9.10007@gnu.org \
--to=bonzini@gnu.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=s-beyer@gmx.net \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.