All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugene Sajine <euguess@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [BUG] - git rebase -i performs rebase when it shouldn't?
Date: Sat, 10 Apr 2010 18:10:53 -0400	[thread overview]
Message-ID: <h2x76c5b8581004101510hc1d15f42u7e48dafbc275c998@mail.gmail.com> (raw)
In-Reply-To: <20100410042609.GA24295@coredump.intra.peff.net>

On Sat, Apr 10, 2010 at 12:26 AM, Jeff King <peff@peff.net> wrote:
> On Fri, Apr 09, 2010 at 03:35:42PM -0400, Eugene Sajine wrote:
>
>> In case of this situation
>>
>>        A  master
>>         \
>>          B  next
>>           \
>>            C  topic
>>
>>
>> $ git rebase --onto master topic
>> First, rewinding head to replay your work on top of it...
>> fatal: Not a range.
>> Nothing to do.
>>
>> Which is OK.
>
> I think this doesn't do quite what you thought. It's true there is
> "nothing to do" as in "nothing to apply", but it _did_ in fact rewind
> topic back to "master".
>
> You seem to be thinking that
>
>  git rebase --onto master topic
>
> means "rebase everything from master to topic onto master". It doesn't.
> That would be:
>
>  git rebase master topic
>
> or, if you are already on topic, just
>
>  git rebase master.
>
> The "--onto" option takes an argument, which says "put the commits on
> top of here, even though it was not the upstream base otherwise
> specified". So what your command does is say "using the current branch
> (which is topic), take everything built on top of topic (which is
> nothing), and rebuild it on top of master".

Actually no, i was not thinking about what you think i was;). What i
was trying to understand with this command (git rebase --onto master
topic) is the
behavior of the system when the topic branch is indirect descendant of
the master and the direct parent of topic (next) is omitted, skipped.

In this situatiion

git rebase master topic

does not work (see thread "git rebase command and docs questions") p1.

So, once again i think that the interface in this case worked properly:

as topic is not direct descendant, master option value goes to --onto
and there is no range defined properly.
Therefore the command worked ok, when it refused to do anything.

Now the problem i have is that:

git rebase -i --onto master topic

actually worked and did something, what i would not expect it to do.

So, the problem is: non-interactive rebase DOES NOT execute the
command, interactive DOES execute.

>
> So no, it's not a bug. Yes, it's a terrible interface. There is really
> no reason IMHO for rebase to take a "which branch to operate on"
> argument at all. It should just operate on HEAD, like merge does. If you
> want to merge on a different branch, you "git checkout" that branch
> first.

The bug is in the fact that rebase works differently in interactive
and non-interactive variants.

Thanks,
Eugene

  parent reply	other threads:[~2010-04-10 22:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 19:35 [BUG] - git rebase -i performs rebase when it shouldn't? Eugene Sajine
2010-04-10  4:26 ` Jeff King
2010-04-10  4:39   ` Junio C Hamano
2010-04-10  4:47     ` Jeff King
2010-04-10 19:58     ` Johannes Sixt
2010-04-11 10:15       ` Jeff King
2010-04-11 17:54         ` Johannes Sixt
2010-04-12  1:01           ` Jeff King
2010-04-12 10:50       ` Michal Vitecek
2010-04-12 17:39         ` Johannes Sixt
2010-04-10 22:10   ` Eugene Sajine [this message]
2010-04-11 10:22     ` Jeff King
2010-04-11 14:06       ` Eugene Sajine
2010-04-12 14:09         ` Eugene Sajine
2010-04-12 15:13           ` Johannes Sixt
2010-04-12 15:28             ` Eugene Sajine
2010-04-12 15:47               ` Johannes Sixt
2010-04-13 16:30                 ` Eugene Sajine
2010-04-14  6:08                   ` Johannes Sixt

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=h2x76c5b8581004101510hc1d15f42u7e48dafbc275c998@mail.gmail.com \
    --to=euguess@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.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.