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

[PATCH v2] Emit warning when rebasing without a forkpoint

From
Wesley Schwengle <wesleys@opperschaap.net>
Date
Sep 2, 2023, 22:16 UTC
Message-ID
<20230902221641.1399624-1-wesleys@opperschaap.net>
In-Reply-To
<xmqq1qfiubg5.fsf@gitster.g>
This is the second version of the patch series.

Patch 1: Be able to use rebase.forkpoint and --root Patch 2: Adding the warning + tests Patch 3: Update documenation

I think I have covered most of your concerns and feedback in this second version.

On 8/31/23 16:57, Junio C Hamano wrote:
Show 11 quoted lines
> Wesley Schwengle <wesleys@opperschaap.net> writes:
> 
> Here is my attempt to rewrite the above:
> 
>      When 'git rebase' is run without specifying <upstream> on the
>      command line, the current default is to use the fork-point
>      heuristics, but this is expected to change in a future version
>      of Git, and you will have to explicitly give "--fork-point" from
>      the command line if you keep using the fork-point mode.  You can
>      run "git config rebase.forkpoint false" to adopt the new default
>      in advance and that will also squelch the message.
I agree. I'll change the text to your version.
Show 10 quoted lines
> Note that the parsing of "rebase.forkpoint" is a bit peculiar in
> that
> 
>   - By leaving it unspecified, the .fork_point = -1 in
>     REBASE_OPTIONS_INIT takes effect (which is unsurprising);
> 
>   - By setting it to false, .fork_point becomes 0; but
> 
>   - If you set the configuration variable to true, .fork_point
>     becomes -1, not 1.
I changed this in patch 1.
> And this is very much deliberate if I understand it correctly [*1*].
> By the time we get to this part of the code (i.e. .fork_point is
> -1), the user may already have rebase.forkpoint set to true.  IOW,
> setting it to 'true' is not a valid way to squelch this message.
So this works now with patch 2.
Show 5 quoted lines
> Another worrysome thing about rebase.forkpoint is that it will be
> inevitable for folks to start complaining that it does not work the
> way other configuration variables do.  Setting the variable to
> 'true' is not the same as passing '--fork-point=true' from the
> command line.
I think it is now with the current series.
Show 13 quoted lines
> I actually think it would be a lot larger behaviour change with a
> huge potential to be received as a regression if we start making the
> variable to mean the same thing as passing '--fork-point=true'.
> People may like the current "if you are rebuilding your branch on
> its usual upstream, pay attention to the rebase and rewind of the
> upstream itself, but if you are giving an explicit upstream from the
> command line, the tool does not second guess you with the fork-point
> heuristics" behaviour and prefer to set it to true.  We would be
> breaking them big time if suddenly the rebase.forkpoint=true they
> set previously starts triggering the fork-point heuristics when they
> run "git rebase upstream".  So that needs to be kept in mind when/if
> we fix the "setting the variable, even to 'true', will squelch the
> warning".

I get what you are saying. My solution is to make the --fork-point or --no-fork-point more explicit. People could use an alias for this?

It would mean a different approach to the problem and deprecating rebase.forkpoint as a boolean value. It could become one of three values: "true", "false" and "legacy". Where "legacy" can be "implicit" or "auto". Although you had some ideas on "auto" already. I'm not sure on how I would call it. "no-upstream"?

-- 
Wesley

Why not both?
Previous: Junio C HamanoNext: Wesley Schwengle
Message 7 of 23 in “builtin/rebase.c: Emit warning when rebasing without a forkpoint”
  1. 1/2 builtin/rebase.c: Emit warning when rebasing without a forkpointWesley Schwengle, Aug 19, 2023
  2. 1/2 builtin/rebase.c: Emit warning when rebasing without a forkpointWesley Schwengle, Aug 19, 2023
  3. Junio C HamanoAug 31, 2023
  4. Junio C HamanoAug 31, 2023
  5. Phillip WoodSep 1, 2023
  6. Junio C HamanoSep 1, 2023
  7. Emit warning when rebasing without a forkpointWesley Schwengle, Sep 2, 2023
  8. 2/3 builtin/rebase.c: Emit warning when rebasing without a forkpointWesley Schwengle, Sep 2, 2023
  9. Junio C HamanoSep 2, 2023
  10. WesleySep 3, 2023
  11. Junio C HamanoSep 3, 2023
  12. Wesley SchwengleSep 3, 2023
  13. Junio C HamanoSep 5, 2023
  14. Phillip WoodSep 4, 2023
  15. 1/3 rebase.c: Make a distiction between rebase.forkpoint and --fork-point argumentsWesley Schwengle, Sep 2, 2023
  16. 3/3 git-rebase.txt: Add deprecation notice to the --fork-point optionsWesley Schwengle, Sep 2, 2023
  17. Phillip WoodSep 1, 2023
  18. WesleySep 1, 2023
  19. Junio C HamanoSep 1, 2023
  20. WesleySep 2, 2023
  21. Junio C HamanoSep 2, 2023
  22. 2/2 git-rebase.txt: Add deprecation notice to the --fork-point optionsWesley Schwengle, Aug 19, 2023
  23. Wesley SchwengleAug 31, 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.