git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Haberman <stephen@exigencecorp.com>
To: Andreas Ericsson <ae@op5.se>
Cc: git@vger.kernel.org
Subject: Re: interactive rebase not rebasing
Date: Wed, 1 Oct 2008 01:03:06 -0500	[thread overview]
Message-ID: <20081001010306.01cc34eb.stephen@exigencecorp.com> (raw)
In-Reply-To: <48E078BF.5030806@op5.se>


> > # A --C------            <-- origin/stable
> > #  \  |      \
> > #   B -- D -- E -- F     <-- origin/topic2
> > #    \|
> > #     g -- h             <-- topic2
> > 
> > Nothing has changed. g & h haven't moved...I can keep executing this
> > operation and the commits never make it on top of origin/topic2's F. 
> > 
> > Frustratingly, if I run non-interactive rebase, it works perfectly.
> 
> I can imagine. Since you don't want to preserve the merges in this
> case, you shouldn't be using the -p flag.

No, I do want to preserve most merges. This "most" qualification is
because the merge "g", if rebased, would have been a no-op, so `rebase
-i -p` correctly kept it out of the TODO file.

Which is cool, except that later on, when rewriting the other TODO
commits, some of which were children of "g", it did not remember that
"g" had gone away, so did nothing to take "g" out of the rewritten
children's parent list.

> In fact, for this particular scenario (assuming "h" is really the only
> commit on topic2), you probably want to just cherry-pick that commit
> into origin/topic2:
> 
>    git checkout topic2
>    git reset --hard origin/topic2
>    git cherry-pick ORIG_HEAD

Agreed. This makes a lot of sense for me, who has been hacking around in
git-rebase--interactive fixing things, but I'd really like the other
people on my team to just have to run `git rebase -i -p`.

> I don't think you can have a single command that does all the things
> you want, because the possible differences in input makes it very
> nearly impossible to always do "the right thing".

Ah, you are too pessimistic. :-)

> Assuming you're passing a correct input file to rebase -i; yes. At the
> very least, "h" should be moved to the tip of origin/topic2.

Cool, agreed. I've got a patch that gets `rebase -i -p` to do this. I'll
send it to the list soon.

- Stephen

  reply	other threads:[~2008-10-01  6:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29  4:50 interactive rebase not rebasing Stephen Haberman
2008-09-29  6:42 ` Andreas Ericsson
2008-10-01  6:03   ` Stephen Haberman [this message]
2008-10-01  7:50     ` Andreas Ericsson
2008-10-01 14:52       ` Stephen Haberman
2008-10-01 15:26         ` Andreas Ericsson
2008-10-01 17:13           ` Stephen Haberman
2008-10-01 18:31             ` Shawn O. Pearce
2008-10-01 21:26             ` Andreas Ericsson

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=20081001010306.01cc34eb.stephen@exigencecorp.com \
    --to=stephen@exigencecorp.com \
    --cc=ae@op5.se \
    --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.
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).