git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] Teach rebase to rebase even if upstream is up to date with -f

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2009, 01:32 UTC
Message-ID
<7vhc2zglz4.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<bd6139dc0902121524o776703bdw1bb199caecbc9c21@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
Show 11 quoted lines
> On Fri, Feb 13, 2009 at 00:22, Junio C Hamano <gitster@pobox.com> wrote:
>> No, because I didn't read the patch text; I don't read patches that are
>> larger than 20 lines during the day-job hours.
>
> Hehe, that sounds like a fair policy.
>
>> I was only commenting on your "rebase does not work if I am up to date
>> with respect to origin and here is my workaround".
>
> Ok, thanks for the comment then, I'll wait for more comment and maybe
> write some tests tomorrow.
Ok, now it is past 5pm, I've read the patch.

I wonder if we can (and if so should) make this a bit more automatic without having to say "rebase -f --whitespace=fix".

When you say "git rebase --whitespace=fix origin" from the command line, you are explicitly saying "I want to *fix* breakages in the commits since 'origin'", and at that point, it stops mattering if origin stayed dormant since you forked from it. I'd say that the current behaviour is a bug introduced by the commit that added --whitespace=fix option.

The logic is the same as "git rebase --interactive origin" that does not refuse to work even if you are already ahead of the origin.

So my suggestion would be to add --force (or -f) like your patch does, and also detect --whitespace=$option given from the command line, and if it is fix (or its synonym "strip"), automatically enable --force, perhaps as a follow up patch, or in the same patch.

Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 10 of 14 in “Teach rebase to rebase even if upstream is up to date with -f”
  1. Teach rebase to rebase even if upstream is up to date with -fSverre Rabbelier, Feb 12, 2009
  2. Johannes SchindelinFeb 12, 2009
  3. Sverre RabbelierFeb 12, 2009
  4. Johannes SchindelinFeb 12, 2009
  5. Sverre RabbelierFeb 12, 2009
  6. Junio C HamanoFeb 12, 2009
  7. Sverre RabbelierFeb 12, 2009
  8. Junio C HamanoFeb 12, 2009
  9. Sverre RabbelierFeb 12, 2009
  10. Junio C HamanoFeb 13, 2009
  11. Sverre RabbelierFeb 13, 2009
  12. Junio C HamanoFeb 13, 2009
  13. Sverre RabbelierFeb 13, 2009
  14. Junio C HamanoFeb 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.