git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:10 UTC

[PATCH v2 1/3] rebase.c: Make a distiction between rebase.forkpoint and --fork-point arguments

From
Wesley Schwengle <wesleys@opperschaap.net>
Date
Sep 2, 2023, 22:16 UTC
Message-ID
<20230902221641.1399624-2-wesleys@opperschaap.net>
In-Reply-To
<20230902221641.1399624-1-wesleys@opperschaap.net>

When you call `git rebase --root' we are not interested in the rebase.forkpoint configuration. The two options are not to be combined.

Because the implementation checks if the configured value for using a forkpoint > 0 I've opted to give the configured forkpoint the value 2. If the user supplies --fork-point on the command line this has a value of 1. Now we can make a distinction between user input and the configured value of rebase.forkpoint.

Signed-off-by: Wesley Schwengle <wesleys@opperschaap.net>
---
 builtin/rebase.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 50cb85751f..2108001600 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -824,7 +824,7 @@ static int rebase_config(const char *var, const char *value,
 	}
 
 	if (!strcmp(var, "rebase.forkpoint")) {
-		opts->fork_point = git_config_bool(var, value) ? -1 : 0;
+		opts->fork_point = git_config_bool(var, value) ? 2 : 0;
 		return 0;
 	}
 
@@ -1264,8 +1264,12 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 		if (options.fork_point < 0)
 			options.fork_point = 0;
 	}
-	if (options.root && options.fork_point > 0)
+	if (options.root && options.fork_point == 1) {
 		die(_("options '%s' and '%s' cannot be used together"), "--root", "--fork-point");
+	} else if (options.root && options.fork_point > 1) {
+	    options.fork_point = 0;
+	}
+
 
 	if (options.action != ACTION_NONE && !in_progress)
 		die(_("No rebase in progress?"));
-- 
2.42.0.103.g5622fd1409.dirty
Previous: Wesley SchwengleNext: Wesley Schwengle
Message 15 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. 2/2 git-rebase.txt: Add deprecation notice to the --fork-point optionsWesley Schwengle, Aug 19, 2023
  4. Wesley SchwengleAug 31, 2023
  5. Junio C HamanoAug 31, 2023
  6. Junio C HamanoAug 31, 2023
  7. Phillip WoodSep 1, 2023
  8. Phillip WoodSep 1, 2023
  9. Junio C HamanoSep 1, 2023
  10. WesleySep 1, 2023
  11. Junio C HamanoSep 1, 2023
  12. WesleySep 2, 2023
  13. Emit warning when rebasing without a forkpointWesley Schwengle, Sep 2, 2023
  14. 2/3 builtin/rebase.c: Emit warning when rebasing without a forkpointWesley Schwengle, Sep 2, 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. Junio C HamanoSep 2, 2023
  18. Junio C HamanoSep 2, 2023
  19. WesleySep 3, 2023
  20. Junio C HamanoSep 3, 2023
  21. Wesley SchwengleSep 3, 2023
  22. Phillip WoodSep 4, 2023
  23. Junio C HamanoSep 5, 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.