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

Re: Git rebase no longer defaults to upstream after force push

From
Sergey Organov <sorganov@gmail.com>
Date
Apr 19, 2023, 17:03 UTC
Message-ID
<87ttxbztvl.fsf@osv.gnss.ru>
In-Reply-To
<CA+JQ7M_XP6fjdut10ry9db9M3pEhp3-+zToJ93gnbHo-4p_8uQ@mail.gmail.com>
Erik Cervin Edin <erik@cervined.in> writes:
Show 20 quoted lines
> On Tue, Apr 18, 2023 at 5:54 PM Cem Gündoğdu <cscallsign@gmail.com> wrote:
>> > If <upstream> is not specified, [...] and the --fork-point option is assumed.
>>
>> The --fork-point option does this:
>>
>> > Use reflog to find a better common ancestor between <upstream> and
>> > <branch> when calculating which commits have been introduced by
>> > <branch>.
>>
>> Since the parent of a is still in the reflog of origin/a, it is not
>> being rebased (the rationale being that the commit *was* in origin/a
>> at some point). If you want to disable this behavior, add
>> --no-fork-point option:
>
> Yes. That's it, thank you for pointing out --fork-point. That's indeed
> what's causing the unexpected behavior.
>
> Do you happen to know when such behavior is desirable? I'm tempted to
> change the default to --no-fork-point but usually when something is
> default there's a valid reason.. 🤔
$ git help merge-base
has a thorough discussion of --fork-point that might be helpful.

As far as I understand, it helps to DWYM when remote branch has been rewound, and causes nasty confusion when it fires unintentionally.

-- Sergey
Previous: Erik Cervin EdinNext: Felipe Contreras
Message 5 of 6 in “Git rebase no longer defaults to upstream after force push”
  1. Erik Cervin EdinApr 18, 2023
  2. Phillip WoodApr 18, 2023
  3. Cem GündoğduApr 18, 2023
  4. Erik Cervin EdinApr 19, 2023
  5. Sergey OrganovApr 19, 2023
  6. Felipe ContrerasApr 19, 2023

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.