git.vger.kernel.org archive mirror
 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: Sun, 11 Apr 2010 10:06:00 -0400	[thread overview]
Message-ID: <y2s76c5b8581004110706p7b63900aqf90f9c1462a1f637@mail.gmail.com> (raw)
In-Reply-To: <20100411102255.GB20484@coredump.intra.peff.net>

I got your point about the HEAD which is by default get's added to the
end of the command, so it becomes

git rebase --onto master topic HEAD

I will think about it it more.

I'm pretty sure that i was surprised by the fact that i've got
different behavior in interactive and non-interactive variants, but i
will recheck.

I forgot to mention it was in windows version of git.
I will try to provide the printout of my actions tomorrow when i will
get to this machine.

Thanks a lot,
Eugene

On Sun, Apr 11, 2010 at 6:22 AM, Jeff King <peff@peff.net> wrote:
> On Sat, Apr 10, 2010 at 06:10:53PM -0400, Eugene Sajine wrote:
>
>> 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.
>
> But in "git rebase --onto master topic", the relationship between master
> and topic is irrelevant. It is the same as:
>
>  git rebase --onto master topic HEAD
>
> which will consider the range between topic and HEAD as the set of
> commits to rebase.
>
> Did you want to do:
>
>  git rebase --onto master next topic
>
> ? That would take the commits between next and topic (i.e., just "topic"
> in your example), and rebuild them on top of master.
>
>> 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.
>
> That's not the result I get. The non-interactive rebase _does_ do the
> same thing. Try this:
>
>  mkdir repo
>  cd repo
>  git init
>
>  echo content >>file && git add file && git commit -m one
>  git checkout -b next
>  echo content >>file && git add file && git commit -m two
>  git checkout -b topic
>  echo content >>file && git add file && git commit -m three
>
>  git rebase --onto master topic
>
> You will see that "topic" has been reset back to commit one, the same as
> master.
>
> If that was not happening before, it was likely because you were not
> actually on the "topic" branch before. So who knows what the implicit
> "HEAD" argument referred to.
>
>> The bug is in the fact that rebase works differently in interactive
>> and non-interactive variants.
>
> I don't think it does, as shown by my example above. If you still think
> so, please create a short test case that demonstrates the difference.
>
> -Peff
>

  reply	other threads:[~2010-04-11 14:06 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
2010-04-11 10:22     ` Jeff King
2010-04-11 14:06       ` Eugene Sajine [this message]
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=y2s76c5b8581004110706p7b63900aqf90f9c1462a1f637@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 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).