Re: [BUG] - git rebase -i performs rebase when it shouldn't?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Sixt
Date: Monday, April 12, 2010 - 8:13 am

Am 4/12/2010 16:09, schrieb Eugene Sajine:

Why should rebase bother? The difference between master and topic are
*two* commits. Since these two are already on top of master in linear
history, you get no advantage by doing a rebase operation. Therefore, you
see "already up to date".

The fact that the second commit from the tip of topic is also labeled
"next" is absolutely irrelevant to rebase. rebase only looks at the refs
that you tell it about: master and topic (implicitly pointed to by HEAD),
nothing else.

What you really want to do, obviously, is:

   git rebase --onto master next topic

No, there is no shorter form to spell this operation.


Not a bug.

Your command is the same as

   git rebase -i --onto master topic topic

because you are already on branch topic. Since there are no commits in the
range topic..topic, rebase -i told you "noop". This word is perhaps poorly
chosen, because it does not mean "no operation"[*], but "there are no
commits to transfer". But branch 'topic' that you gave as the last
argument (or implicitly by being at branch 'topic') is still transferred
--onto master. This explains the result that you observed.

Of course, if you do not 'reset --hard topic@{1}' at this point, you will
ultimately lose the commits on branch topic.

[*] You can get "no operation" by deleting the line "noop".

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG] - git rebase -i performs rebase when it shouldn't?, Eugene Sajine, (Fri Apr 9, 12:35 pm)
Re: [BUG] - git rebase -i performs rebase when it shouldn't?, Johannes Sixt, (Mon Apr 12, 8:13 am)