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

Usability issue with rebase fork-point option

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Dec 18, 2017, 15:47 UTC
Message-ID
<CAHd499BwrEAxoGX++xRJz_p-_7Uh7vm=+FstRbCv1+wqeCiYbw@mail.gmail.com>

When upstream is not specified for the rebase command (e.g. I just do `git rebase`), `--fork-point` is assumed which results in commits regenerating SHA1 even if the merge-base would otherwise be identical.

Here's my scenario:
I set my remote tracking branch to my parent branch:
$ git branch -u origin
I do a status to see that I'm 1 ahead:

$ git status -sb ## feature/foo...origin/master [ahead 1]

I then execute `git rebase`:
$ git rebase
First, rewinding head to replay your work on top of it...
Applying: Fix state machine hang after integrity checking

Since my merge-base is already the tip of `origin/master`, I expected it to say it was up-to-date, as it would if I disabled fork point:

$ git rebase --no-fork-point Current branch feature/foo is up to date.

The expected behavior is that if merge-base does not change, even with --fork-point enabled, that SHA1's do not get rewritten.

As a workaround, I've created an alias that always assumes --no-fork-point:
[alias]
    rb = rebase --no-fork-point
Possible long term solutions I'd be happy with:
1. A config option to disable fork point completely, something like
`rebase.forkPoint` and I can set it to `false`.
2. Change rebase to always assume `--no-fork-point` as a default,
which is opposite of the current behavior.
3. Assuming the behavior I'm observing is a bug, put more priority on
a matching merge-base instead of the reflogs, not sure of the
internals of how this fork-point behavior is implemented, but this
feels like the issue to me. The most ideal outcome is that this is a
bug and no interface or config changes are needed.
Would love to get feedback from the Git community on this. Thanks for reading!!
Next: Junio C Hamano
Message 1 of 2 in “Usability issue with rebase fork-point option”
  1. Robert DaileyDec 18, 2017
  2. Junio C HamanoDec 18, 2017

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.