Subject: [PATCH v6 6/6] Change config key to status.compareBranch

From: "Harald Nordgren via GitGitGadget" <[email-masked]>
Date: Wed, 24 Dec 2025 23:41:12 +0000

From: Harald Nordgren <[email-masked]>

Update from repo.settings.statusGoalBranch to follow standard
git config pattern status.compareBranch.

Signed-off-by: Harald Nordgren <[email-masked]>
---
 remote.c                 |  4 ++--
 t/t6040-tracking-info.sh | 34 +++++++++++++++++-----------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/remote.c b/remote.c
index 99c0e18df4..7e13c027b5 100644
--- a/remote.c
+++ b/remote.c
@@ -2246,7 +2246,7 @@ static char *get_goal_branch_ref(char **full_ref_out)
 	char *slash_pos;
 	char *ret = NULL;
 
-	if (repo_config_get_value(the_repository, "repo.settings.statusGoalBranch", &config_value))
+	if (repo_config_get_value(the_repository, "status.goalBranch", &config_value))
 		return NULL;
 
 	if (!config_value || !*config_value)
@@ -2254,7 +2254,7 @@ static char *get_goal_branch_ref(char **full_ref_out)
 
 	slash_pos = strchr(config_value, '/');
 	if (!slash_pos || slash_pos == config_value || !slash_pos[1]) {
-		warning(_("invalid value for repo.settings.statusGoalBranch: '%s' (expected format: remote/branch)"),
+		warning(_("invalid value for status.goalBranch: '%s' (expected format: remote/branch)"),
 			config_value);
 		return NULL;
 	}
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 598dd89483..fe34ddf0ab 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -309,7 +309,7 @@ test_expect_success 'status shows ahead of both tracked branch and origin/main'
 	(
 		cd test &&
 		git checkout work >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -328,7 +328,7 @@ test_expect_success 'checkout shows ahead of both tracked branch and origin/main
 	(
 		cd test &&
 		git checkout main >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git checkout work 2>&1
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -370,7 +370,7 @@ test_expect_success 'status shows ahead of tracked and diverged from origin/main
 	(
 		cd test &&
 		git checkout work2 >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -402,7 +402,7 @@ test_expect_success 'status shows diverged from tracked and behind origin/main'
 	(
 		cd test &&
 		git checkout work2b >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -437,7 +437,7 @@ test_expect_success 'status shows behind tracked and ahead of origin/main' '
 	(
 		cd test &&
 		git checkout work3 >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -465,7 +465,7 @@ test_expect_success 'status prefers upstream remote over origin for comparison'
 	(
 		cd test &&
 		git checkout work >/dev/null &&
-		git config repo.settings.statusGoalBranch upstream/main &&
+		git config status.goalBranch upstream/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -495,7 +495,7 @@ test_expect_success 'status shows up to date with tracked but diverged from defa
 	(
 		cd test &&
 		git checkout synced_feature >/dev/null &&
-		git config repo.settings.statusGoalBranch upstream/main &&
+		git config status.goalBranch upstream/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -525,7 +525,7 @@ test_expect_success 'status shows up to date with tracked but diverged from orig
 	(
 		cd test &&
 		git checkout synced_feature2 >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -551,7 +551,7 @@ test_expect_success 'status shows up to date with tracked but shows default bran
 	(
 		cd test &&
 		git checkout synced_feature3 >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -565,11 +565,11 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success 'status with repo.settings.statusGoalBranch unset shows no default comparison' '
+test_expect_success 'status with status.goalBranch unset shows no default comparison' '
 	(
 		cd test &&
 		git checkout synced_feature3 >/dev/null &&
-		git config --unset repo.settings.statusGoalBranch 2>/dev/null || true &&
+		git config --unset status.goalBranch 2>/dev/null || true &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -581,11 +581,11 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success 'status with repo.settings.statusGoalBranch set uses configured branch' '
+test_expect_success 'status with status.goalBranch set uses configured branch' '
 	(
 		cd test &&
 		git checkout synced_feature3 >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/main &&
+		git config status.goalBranch origin/main &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -599,11 +599,11 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success 'status with repo.settings.statusGoalBranch set to different remote/branch' '
+test_expect_success 'status with status.goalBranch set to different remote/branch' '
 	(
 		cd test &&
 		git checkout work >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/feature &&
+		git config status.goalBranch origin/feature &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
@@ -616,11 +616,11 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success 'status with repo.settings.statusGoalBranch set to non-existent branch' '
+test_expect_success 'status with status.goalBranch set to non-existent branch' '
 	(
 		cd test &&
 		git checkout synced_feature3 >/dev/null &&
-		git config repo.settings.statusGoalBranch origin/nonexistent &&
+		git config status.goalBranch origin/nonexistent &&
 		git status --long -b
 	) >actual &&
 	cat >expect <<-\EOF &&
-- 
gitgitgadget