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

Re: [PATCH v2 01/15] rebase -i: handle NULL value for rebase.missingCommitsCheck

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Nov 10, 2026, 11:15 UTC
Message-ID
<fa01c0c6-bd7d-48cf-bcaf-48a516053ebf@gmail.com>
In-Reply-To
<47224a9893e9cf87c0ee16bd1a79cf1355694175.1794296205.git.gitgitgadget@gmail.com>
Hi Thomas
On 10/11/2026 07:36, Thomas Bachem via GitGitGadget wrote:
Show 10 quoted lines
> From: Thomas Bachem <mail@thomasbachem.com>
> > A rebase.missingCommitsCheck without a value, as in
> >    [rebase]
>    missingCommitsCheck
> > or "git -c rebase.missingCommitsCheck", makes "git rebase -i"
> segfault as it writes the todo list: get_missing_commit_check_level()
> passes the NULL value to strcasecmp().
> > The setting takes "ignore", "warn" or "error". An unrecognized value,
> perhaps one meant for a newer version of Git, gets a warning and is
> treated as "ignore". Treat a missing value the same way.
Sounds good
Show 16 quoted lines
> diff --git a/rebase-interactive.c b/rebase-interactive.c
> index 809f76a87b..9eb70b09b3 100644
> --- a/rebase-interactive.c
> +++ b/rebase-interactive.c
> @@ -30,8 +30,14 @@ static enum missing_commit_check_level get_missing_commit_check_level(void)
>   {
>   	const char *value;
>   > -	if (repo_config_get_value(the_repository, "rebase.missingcommitscheck", &value) ||
> -			!strcasecmp("ignore", value))
> +	if (repo_config_get_value(the_repository, "rebase.missingcommitscheck", &value))
> +		return MISSING_COMMIT_CHECK_IGNORE;
> +	if (!value) {
> +		warning(_("missing value for option "
> +			  "rebase.missingCommitsCheck. Ignoring."));
> +		return MISSING_COMMIT_CHECK_IGNORE;
> +	}
If "value" is NULL  we print a warning and continue as if the user had said "ignore" - good
Show 17 quoted lines
> +	if (!strcasecmp("ignore", value))
>   		return MISSING_COMMIT_CHECK_IGNORE;
>   	if (!strcasecmp("warn", value))
>   		return MISSING_COMMIT_CHECK_WARN;
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index b3ee96f560..5b9fc67c19 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -1562,6 +1562,18 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
>   	test B = $(git cat-file commit HEAD^ | sed -ne \$p)
>   '
>   > +test_expect_success 'rebase -i warns about and ignores rebase.missingCommitsCheck without a value' '
> +	rebase_setup_and_clean missing-commit &&
> +	(
> +		set_fake_editor &&
> +		FAKE_LINES="1 2 3 4" \
> +			git -c rebase.missingCommitsCheck rebase -i --root 2>actual
Because this uses "--root", it is hard to tell if it is dropping any commits or not. Using something like
	FAKE_LINES=1 \
		git -c rebase.missingCommitCheck rebase -i HEAD~3
makes it easier to see we're dropping a commit by looking at FAKE_LINES and the upstream commit passed to rebase.
> +	) &&
> +	test D = $(git cat-file commit HEAD | sed -ne \$p) &&
This is quite common in our older tests, but makes it very hard to diagnose test failures because it does not print anything if there is an error. These days we can use
	test_commit_message HEAD -m D
> +	test_grep "missing value for option rebase.missingCommitsCheck" actual &&
> +	test_grep ! "commits may have been dropped" actual
We check for the error message caused by a missing config value and also check we don't complain about the missing commits - good.
Thanks
Phillip
Show 5 quoted lines
> +'
> +
>   test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ignore' '
>   	test_config rebase.missingCommitsCheck ignore &&
>   	rebase_setup_and_clean missing-commit &&
Previous: Thomas Bachem via GitGitGadgetNext: Thomas Bachem via GitGitGadget
Message 33 of 70 in “Fix segfaults on settings given without a value”
  1. 00/15 Fix segfaults on settings given without a valueThomas Bachem via GitGitGadget, Nov 7, 2026
  2. 01/15 rebase -i: handle NULL value for rebase.missingCommitsCheckThomas Bachem via GitGitGadget, Nov 7, 2026
  3. Phillip WoodNov 9, 2026
  4. Junio C HamanoNov 9, 2026
  5. Thomas BachemNov 9, 2026
  6. 02/15 odb: handle NULL values for core.alternateRefs* configThomas Bachem via GitGitGadget, Nov 7, 2026
  7. 03/15 add-patch: handle NULL value for color slotsThomas Bachem via GitGitGadget, Nov 7, 2026
  8. 04/15 bundle-uri: handle NULL value for fetch.bundleCreationTokenThomas Bachem via GitGitGadget, Nov 7, 2026
  9. Derrick StoleeNov 9, 2026
  10. 05/15 grep: handle NULL value for grep.patternTypeThomas Bachem via GitGitGadget, Nov 7, 2026
  11. 06/15 remote: handle NULL value for remote.<name>.tagOptThomas Bachem via GitGitGadget, Nov 7, 2026
  12. Phillip WoodNov 10, 2026
  13. 07/15 blame: handle NULL values for color.blame.* configThomas Bachem via GitGitGadget, Nov 7, 2026
  14. Phillip WoodNov 10, 2026
  15. 08/15 merge: handle NULL value for branch.<name>.mergeOptionsThomas Bachem via GitGitGadget, Nov 7, 2026
  16. Phillip WoodNov 10, 2026
  17. Junio C HamanoNov 10, 2026
  18. Phillip WoodNov 11, 2026
  19. Ben KnobleNov 11, 2026
  20. Junio C HamanoNov 11, 2026
  21. 09/15 remote: handle NULL value for remotes.<group>Thomas Bachem via GitGitGadget, Nov 7, 2026
  22. 10/15 setup: handle NULL value for safe.bareRepositoryThomas Bachem via GitGitGadget, Nov 7, 2026
  23. 11/15 pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.patternThomas Bachem via GitGitGadget, Nov 7, 2026
  24. 12/15 scalar: handle NULL value for scalar.repoThomas Bachem via GitGitGadget, Nov 7, 2026
  25. Derrick StoleeNov 9, 2026
  26. 13/15 config: handle NULL value for remote URLs in hasconfig includesThomas Bachem via GitGitGadget, Nov 7, 2026
  27. 14/15 bundle-uri: handle NULL values in bundle listsThomas Bachem via GitGitGadget, Nov 7, 2026
  28. Derrick StoleeNov 9, 2026
  29. 15/15 config: handle NULL values when listing colors and expiry datesThomas Bachem via GitGitGadget, Nov 7, 2026
  30. Derrick StoleeNov 9, 2026
  31. 00/15 Fix segfaults on settings given without a valueThomas Bachem via GitGitGadget, Nov 10, 2026
  32. 01/15 rebase -i: handle NULL value for rebase.missingCommitsCheckThomas Bachem via GitGitGadget, Nov 10, 2026
  33. Phillip WoodNov 10, 2026
  34. 02/15 odb: handle NULL values for core.alternateRefs* configThomas Bachem via GitGitGadget, Nov 10, 2026
  35. 03/15 add-patch: handle NULL value for color slotsThomas Bachem via GitGitGadget, Nov 10, 2026
  36. 04/15 bundle-uri: handle NULL value for fetch.bundleCreationTokenThomas Bachem via GitGitGadget, Nov 10, 2026
  37. 05/15 grep: handle NULL value for grep.patternTypeThomas Bachem via GitGitGadget, Nov 10, 2026
  38. 06/15 remote: handle NULL value for remote.<name>.tagOptThomas Bachem via GitGitGadget, Nov 10, 2026
  39. 07/15 blame: handle NULL values for color.blame.* configThomas Bachem via GitGitGadget, Nov 10, 2026
  40. 08/15 merge: handle NULL value for branch.<name>.mergeOptionsThomas Bachem via GitGitGadget, Nov 10, 2026
  41. 09/15 remote: handle NULL value for remotes.<group>Thomas Bachem via GitGitGadget, Nov 10, 2026
  42. 10/15 setup: handle NULL value for safe.bareRepositoryThomas Bachem via GitGitGadget, Nov 10, 2026
  43. 11/15 pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.patternThomas Bachem via GitGitGadget, Nov 10, 2026
  44. 12/15 scalar: handle NULL value for scalar.repoThomas Bachem via GitGitGadget, Nov 10, 2026
  45. 13/15 config: handle NULL value for remote URLs in hasconfig includesThomas Bachem via GitGitGadget, Nov 10, 2026
  46. 14/15 bundle-uri: handle NULL values in bundle listsThomas Bachem via GitGitGadget, Nov 10, 2026
  47. Phillip WoodNov 10, 2026
  48. Derrick StoleeNov 10, 2026
  49. 15/15 config: handle NULL values when listing colors and expiry datesThomas Bachem via GitGitGadget, Nov 10, 2026
  50. Phillip WoodNov 10, 2026
  51. Thomas BachemNov 10, 2026
  52. 00/15 Fix segfaults on settings given without a valueThomas Bachem via GitGitGadget, Nov 11, 2026
  53. 01/15 rebase -i: handle NULL value for rebase.missingCommitsCheckThomas Bachem via GitGitGadget, Nov 11, 2026
  54. 02/15 odb: handle NULL values for core.alternateRefs* configThomas Bachem via GitGitGadget, Nov 11, 2026
  55. 03/15 add-patch: handle NULL value for color slotsThomas Bachem via GitGitGadget, Nov 11, 2026
  56. 04/15 bundle-uri: handle NULL value for fetch.bundleCreationTokenThomas Bachem via GitGitGadget, Nov 11, 2026
  57. 05/15 grep: handle NULL value for grep.patternTypeThomas Bachem via GitGitGadget, Nov 11, 2026
  58. 06/15 remote: handle NULL value for remote.<name>.tagOptThomas Bachem via GitGitGadget, Nov 11, 2026
  59. 07/15 blame: handle NULL values for color.blame.* configThomas Bachem via GitGitGadget, Nov 11, 2026
  60. 08/15 merge: handle NULL value for branch.<name>.mergeOptionsThomas Bachem via GitGitGadget, Nov 11, 2026
  61. 09/15 remote: handle NULL value for remotes.<group>Thomas Bachem via GitGitGadget, Nov 11, 2026
  62. 10/15 setup: handle NULL value for safe.bareRepositoryThomas Bachem via GitGitGadget, Nov 11, 2026
  63. 11/15 pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.patternThomas Bachem via GitGitGadget, Nov 11, 2026
  64. 12/15 scalar: handle NULL value for scalar.repoThomas Bachem via GitGitGadget, Nov 11, 2026
  65. 13/15 config: handle NULL value for remote URLs in hasconfig includesThomas Bachem via GitGitGadget, Nov 11, 2026
  66. 14/15 bundle-uri: handle NULL values in bundle listsThomas Bachem via GitGitGadget, Nov 11, 2026
  67. 15/15 config: handle NULL values when listing colors and expiry datesThomas Bachem via GitGitGadget, Nov 11, 2026
  68. Phillip WoodNov 12, 2026
  69. Derrick StoleeNov 12, 2026
  70. Junio C HamanoNov 12, 2026

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.