git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Beyer <s-beyer@gmx.net>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: help reproduce fast-forward in rebase
Date: Wed, 20 May 2009 11:33:21 +0200	[thread overview]
Message-ID: <20090520093321.GF6169@leksak.fem-net> (raw)
In-Reply-To: <fcaeb9bf0905200113s43eb5693l24a1f8848bafabd2@mail.gmail.com>

Hi Nguyen,

Nguyen Thai Ngoc Duy wrote:
> Hi,
> 
> I'm rewriting rebase in C

Oh. First two remarks that may or may not affect you:

 1. rebase -i -p is reworked by Dscho:

    http://repo.or.cz/w/git/dscho.git?a=shortlog;h=refs/heads/rebase-i-p

 2. sequencer, a C backend for git am and git rebase -i, actually exists

    http://repo.or.cz/w/git/sbeyer.git?a=shortlog;h=refs/heads/seq-builtin-dev

    although to even more lack of time the missing/non-perfect parts are not
    getting fewer.


Both remarks regard "rebase -i" and not the am-based rebase, which means
you are not getting into some kind of conflict with these other developments
(or IOW: you are not doing already done work a second or third time) when you
keep your rebase rewrite close to the original in sh.

> and do not quite understand this code inside git-rebase.sh
> 
> # If the $onto is a proper descendant of the tip of the branch, then
> # we just fast forwarded.
> if test "$mb" = "$branch"
> then
> 	echo >&2 "Fast-forwarded $branch_name to $onto_name."
> 	move_to_original_branch
> 	exit 0
> fi
> 
> Anyone has an example how to make "git rebase" execute that code?

Yes, "if the $onto is a proper descendant of the tip of the branch",
then there are no commits that have to be rewritten. Rebasing can be
done by simple fast-forwarding, i.e. setting the branch to another,
yet existing commit.

Example:

   * onto                 * onto, mybranch
   |                      |
   *                      *
   |                      |
   * mybranch    =>       *
   |                      |
   *                      *
   |                      |


Regards,
  Stephan

  parent reply	other threads:[~2009-05-20  9:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20  8:13 help reproduce fast-forward in rebase Nguyen Thai Ngoc Duy
2009-05-20  9:26 ` Johannes Sixt
2009-05-20  9:33 ` Stephan Beyer [this message]
2009-05-20  9:37   ` Nguyen Thai Ngoc Duy

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=20090520093321.GF6169@leksak.fem-net \
    --to=s-beyer@gmx.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /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 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 NNTP newsgroup(s).