From: Sergei Organov <osv@javad•com>
To: Jonathan Nieder <jrnieder@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: rebase flattens history when it shouldn't?
Date: Wed, 23 Jul 2014 23:33:11 +0400 [thread overview]
Message-ID: <8738drj2fc.fsf@osv.gnss.ru> (raw)
In-Reply-To: <20140723175218.GB12427@google.com> (Jonathan Nieder's message of "Wed, 23 Jul 2014 10:52:18 -0700")
Jonathan Nieder <jrnieder@gmail•com> writes:
> Hi Sergei,
>
> Sergei Organov wrote:
>
>> --C--
>> / \
>> / ----M topic,HEAD
>> / /
>> A---B master
>>
>> shouldn't
>>
>> $ git rebase master
>>
>> be a no-op here?
> [...]
>> I'd expect --force-rebase to be required for this to happen:
>>
>> -f, --force-rebase
>> Force the rebase even if the current branch is a descendant of the
>> commit you are rebasing onto. Normally non-interactive rebase will
>> exit with the message "Current branch is up to date" in such a
>> situation.
> [...]
>> Do you think it's worth fixing?
>
> Thanks for a clear report.
>
> After a successful 'git rebase master', the current branch is always a
> linear string of patches on top of 'master'. The "already up to date"
> behavior when -f is not passed is in a certain sense an optimization
> --- it is about git noticing that 'git rebase' wouldn't have anything
> to do (except for touching timestamps) and therefore doing nothing.
>
> So I don't think requiring -f for this case would be an improvement.
What actually bothers me is the unfortunate consequence that "git pull"
is not always a no-op when nothing was changed at the origin since the
last "git pull". THIS is really surprising and probably should better be
fixed. Requiring -f is just one (obvious) way to fix this.
> I do agree that the documentation is misleading. Any ideas for
> wording that could make it clearer?
I can't suggest anything as I don't see why -f is there in the first
place. What are use cases?
--
Sergey.
next prev parent reply other threads:[~2014-07-23 19:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 13:34 rebase flattens history when it shouldn't? Sergei Organov
2014-07-23 17:52 ` Jonathan Nieder
2014-07-23 19:33 ` Sergei Organov [this message]
2014-08-06 15:09 ` Holger Hellmuth
2014-08-06 15:34 ` Sergey Organov
2014-08-06 11:36 ` Sergey Organov
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=8738drj2fc.fsf@osv.gnss.ru \
--to=osv@javad$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jrnieder@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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