{"thread":{"id":"66593","subject":"[PATCH] status: compare against both upstream and push branch by default","startedAt":"2026-10-19T19:23:18Z","lastAt":"2026-10-25T10:51:33Z","messageCount":16,"participants":["Harald Nordgren via GitGitGadget","Junio C Hamano","Harald Nordgren","Phillip Wood","Kristoffer Haugsbakk","D. Ben Knoble"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"555450","messageId":"pull.2458.git.git.1792437798463.gitgitgadget@gmail.com","threadId":"66593","inReplyTo":null,"subject":"[PATCH] status: compare against both upstream and push branch by default","fromName":"Harald Nordgren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-19T19:23:18Z","receivedAt":"2026-10-19T19:23:18Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"From: Harald Nordgren <haraldnordgren@gmail.com>\n\nIn a triangular workflow, where a branch is pulled from one place and\npushed to another, \"git status\" only compares the branch to its\nupstream. It says nothing about the branch it is pushed to unless\nstatus.compareBranches is configured.\n\nShow both comparisons by default. When the two resolve to the same\nbranch, which is the common case, only one comparison is shown, so the\noutput for most users does not change. Setting status.compareBranches\nto \"@{upstream}\" gives the previous output.\n\nSigned-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n---\n    status: compare against both upstream and push branch by default\n    \n    Make @{upstream} @{push} the default for status.compareBranches. When\n    both resolve to the same branch only one comparison is shown, so most\n    users see no change.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2458%2FHaraldNordgren%2Fstatus-compare-branches-default-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2458/HaraldNordgren/status-compare-branches-default-v1\nPull-Request: https://github.com/git/git/pull/2458\n\n Documentation/config/status.adoc | 11 ++++++-----\n remote.c                         |  1 +\n t/t5505-remote.sh                |  1 -\n t/t6040-tracking-info.sh         | 30 +++++++++++++++---------------\n 4 files changed, 22 insertions(+), 21 deletions(-)\n\ndiff --git a/Documentation/config/status.adoc b/Documentation/config/status.adoc\nindex b5dd85b761..1d847d3a8a 100644\n--- a/Documentation/config/status.adoc\n+++ b/Documentation/config/status.adoc\n@@ -23,8 +23,9 @@ status.compareBranches::\n \tare supported. They are interpreted as `branch@{upstream}` and\n \t`branch@{push}` for the current branch.\n +\n-If not set, the default behavior is equivalent to `@{upstream}`, which\n-compares against the configured upstream tracking branch.\n+If not set, the default behavior is equivalent to `@{upstream} @{push}`,\n+which compares against both the configured upstream and push tracking\n+branches.\n +\n The entries are shown in the order they appear in the configuration.\n Duplicate entries that resolve to the same ref are suppressed after\n@@ -36,11 +37,11 @@ Example:\n +\n ----\n [status]\n-\tcompareBranches = @{upstream} @{push}\n+\tcompareBranches = @{upstream}\n ----\n +\n-This would show comparisons against both the configured upstream and push\n-tracking branches for the current branch.\n+This would only show the comparison against the configured upstream\n+tracking branch for the current branch.\n \n status.displayCommentPrefix::\n \tIf set to true, linkgit:git-status[1] will insert a comment\ndiff --git a/remote.c b/remote.c\nindex 71170f36a9..6fdb4b84da 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -2465,6 +2465,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,\n \t\tstring_list_remove_empty_items(&branches, 0);\n \t} else {\n \t\tstring_list_append(&branches, \"@{upstream}\");\n+\t\tstring_list_append(&branches, \"@{push}\");\n \t}\n \n \tupstream_ref = branch_get_upstream(branch, NULL);\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex 5fbfcb0848..f77753605f 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -34,7 +34,6 @@ setup_url_pushremote () {\n \t\tgit checkout -b topic --track origin/main &&\n \t\tgit commit --allow-empty -m topic-change &&\n \t\tgit config push.default current &&\n-\t\tgit config status.compareBranches \"@{upstream} @{push}\" &&\n \t\tgit config branch.topic.pushRemote \"$fork_url\" &&\n \t\tgit push\n \t)\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex e95d420972..e10cde090d 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -331,19 +331,6 @@ test_expect_success 'status.compareBranches deduplicates when upstream and push\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n-\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n-\tgit -C test checkout main &&\n-\tgit -C test status >actual &&\n-\tcat >expect <<-EOF &&\n-\tOn branch main\n-\tYour branch is up to date with ${SQ}origin/main${SQ}.\n-\n-\tnothing to commit, working tree clean\n-\tEOF\n-\ttest_cmp expect actual\n-'\n-\n test_expect_success 'status.compareBranches with only push shows only push' '\n \ttest_config -C test push.default current &&\n \ttest_config -C test status.compareBranches \"@{push}\" &&\n@@ -361,9 +348,8 @@ test_expect_success 'status.compareBranches with only push shows only push' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'status.compareBranches shows ahead of both upstream and push branch' '\n+test_expect_success 'status shows ahead of both upstream and push branch by default' '\n \ttest_config -C test push.default current &&\n-\ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n \tgit -C test checkout -b feature3 origin/main &&\n \tgit -C test push origin HEAD &&\n \t(cd test && advance work) &&\n@@ -380,6 +366,20 @@ test_expect_success 'status.compareBranches shows ahead of both upstream and pus\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n+\ttest_config -C test push.default current &&\n+\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n+\tgit -C test checkout feature3 &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch feature3\n+\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'checkout with status.compareBranches shows both branches' '\n \ttest_config -C test push.default current &&\n \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n\nbase-commit: c51408889c3b372814bc20b9431c3b74d0d268eb\n-- \ngitgitgadget\n\n"},{"id":"555479","messageId":"xmqq33u11etp.fsf@gitster.g","threadId":"66593","inReplyTo":"pull.2458.git.git.1792437798463.gitgitgadget@gmail.com","subject":"Re: [PATCH] status: compare against both upstream and push branch by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-19T22:54:42Z","receivedAt":"2026-10-19T22:54:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Harald Nordgren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Harald Nordgren <haraldnordgren@gmail.com>\n>\n> In a triangular workflow, where a branch is pulled from one place and\n> pushed to another, \"git status\" only compares the branch to its\n> upstream. It says nothing about the branch it is pushed to unless\n> status.compareBranches is configured.\n\nI would have expected such an explanation to be on a commit that\nallowed this default change to be such a small code change (i.e.,\nthe commit that added support for status.compareBranches).  In other\nwords, shouldn't the first paragraph be more like this:\n\n    Commit XXXXX added status.compareBranches so that \"git status\"\n    can show comparison of the current branch with its upstream in\n    addition to where the branch is pushed to, which is great to\n    support the triangular workflow.  It however did not make it the\n    default to show both.\n\nIt would highlight that the primary task this commit wants to\nachieve is to change the default, which is explained next.\n\n> Show both comparisons by default. When the two resolve to the same\n> branch, which is the common case, only one comparison is shown, so the\n> output for most users does not change. Setting status.compareBranches\n> to \"@{upstream}\" gives the previous output.\n\nMost users not seeing any change is not a good excuse to make a\ndefault change.  Thinking through different use cases and see if\nthere are cases where negative impact is made relative to the\ncurrent one is how we should evaluate.\n\nIn this case, especially given that this is \"git status\" output\nthat is meant to shown to interactive end-users, I do not think\nof a reason why those who use triangular workflows would not want to\nsee both by default.\n\n> -test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n> -\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n> -\tgit -C test checkout main &&\n> -\tgit -C test status >actual &&\n> -\tcat >expect <<-EOF &&\n> -\tOn branch main\n> -\tYour branch is up to date with ${SQ}origin/main${SQ}.\n> -\n> -\tnothing to commit, working tree clean\n> -\tEOF\n> -\ttest_cmp expect actual\n> -'\n\nWhat's this deletion about?  Is this duplicated or something?\n\n> @@ -361,9 +348,8 @@ test_expect_success 'status.compareBranches with only push shows only push' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> -test_expect_success 'status.compareBranches shows ahead of both upstream and push branch' '\n> +test_expect_success 'status shows ahead of both upstream and push branch by default' '\n>  \ttest_config -C test push.default current &&\n> -\ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n>  \tgit -C test checkout -b feature3 origin/main &&\n>  \tgit -C test push origin HEAD &&\n>  \t(cd test && advance work) &&\n\nEven if the default changed, shouldn't we make sure that the\nconfiguration also work as expected?\n\nIn other words, the changes to the tests I would expect from a\nchange like this is (1) to update the tests that have been relying\non the old default to gain test_config to explicitly set the old\ndefault, and (2) new test that demonstrates the new behaviour\nwithout configuration.  That assumes that the test coverage before\nthe patch is adequate, which may not have been the case for this\ntest and further changes may be warranted.  It is not quite clear\nto me, but the addition we see below is such a case our existing\ntest failed to cover?\n\nOne large argument the proposed commit log message hangs its\ndecision to change the default on is that we won't see extra output\nwhen @{upstream} and @{push} happen to point at the same place, so\nnaturally I'd expect to have two tests that show the two cases\n(i.e., one with triangular, the other just pulling from where you\npush to).  With this test update, do we have adequate test coverage\nfor these cases?  If so, that is something we should explain in the\nproposed commit log message, too.\n\nThanks.\n\n> +test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n> +\ttest_config -C test push.default current &&\n> +\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n> +\tgit -C test checkout feature3 &&\n> +\tgit -C test status >actual &&\n> +\tcat >expect <<-EOF &&\n> +\tOn branch feature3\n> +\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n> +\n> +\tnothing to commit, working tree clean\n> +\tEOF\n> +\ttest_cmp expect actual\n> +'\n\n\n"},{"id":"555516","messageId":"CAHwyqnXab+JEG6i=31xEV9Xmm9fo=h0HsjunMsCBLZ0A4oOQzw@mail.gmail.com","threadId":"66593","inReplyTo":"xmqq33u11etp.fsf@gitster.g","subject":"Re: [PATCH] status: compare against both upstream and push branch by default","fromName":"Harald Nordgren","fromEmail":"haraldnordgren@gmail.com","sentAt":"2026-10-20T09:16:58Z","receivedAt":"2026-10-20T09:16:58Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"> > In a triangular workflow, where a branch is pulled from one place and\n> > pushed to another, \"git status\" only compares the branch to its\n> > upstream. It says nothing about the branch it is pushed to unless\n> > status.compareBranches is configured.\n>\n> I would have expected such an explanation to be on a commit that\n> allowed this default change to be such a small code change (i.e.,\n> the commit that added support for status.compareBranches).  In other\n> words, shouldn't the first paragraph be more like this:\n>\n>     Commit XXXXX added status.compareBranches so that \"git status\"\n>     can show comparison of the current branch with its upstream in\n>     addition to where the branch is pushed to, which is great to\n>     support the triangular workflow.  It however did not make it the\n>     default to show both.\n>\n> It would highlight that the primary task this commit wants to\n> achieve is to change the default, which is explained next.\n\nFair enough, thanks!\n\n> > -test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n> > -     test_config -C test status.compareBranches \"@{upstream}\" &&\n> > -     git -C test checkout main &&\n> > -     git -C test status >actual &&\n> > -     cat >expect <<-EOF &&\n> > -     On branch main\n> > -     Your branch is up to date with ${SQ}origin/main${SQ}.\n> > -\n> > -     nothing to commit, working tree clean\n> > -     EOF\n> > -     test_cmp expect actual\n> > -'\n>\n> What's this deletion about?  Is this duplicated or something?\n\nI adapted it into another test further down.\n\nBut I'll bring things back closer to the old coverage and add more instead.\n\n> > @@ -361,9 +348,8 @@ test_expect_success 'status.compareBranches with only push shows only push' '\n> >       test_cmp expect actual\n> >  '\n> >\n> > -test_expect_success 'status.compareBranches shows ahead of both upstream and push branch' '\n> > +test_expect_success 'status shows ahead of both upstream and push branch by default' '\n> >       test_config -C test push.default current &&\n> > -     test_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n> >       git -C test checkout -b feature3 origin/main &&\n> >       git -C test push origin HEAD &&\n> >       (cd test && advance work) &&\n>\n> Even if the default changed, shouldn't we make sure that the\n> configuration also work as expected?\n>\n> In other words, the changes to the tests I would expect from a\n> change like this is (1) to update the tests that have been relying\n> on the old default to gain test_config to explicitly set the old\n> default, and (2) new test that demonstrates the new behaviour\n> without configuration.  That assumes that the test coverage before\n> the patch is adequate, which may not have been the case for this\n> test and further changes may be warranted.  It is not quite clear\n> to me, but the addition we see below is such a case our existing\n> test failed to cover?\n>\n> One large argument the proposed commit log message hangs its\n> decision to change the default on is that we won't see extra output\n> when @{upstream} and @{push} happen to point at the same place, so\n> naturally I'd expect to have two tests that show the two cases\n> (i.e., one with triangular, the other just pulling from where you\n> push to).  With this test update, do we have adequate test coverage\n> for these cases?  If so, that is something we should explain in the\n> proposed commit log message, too.\n\nMake sense, yes.\n\n\nHarald\n\n"},{"id":"555518","messageId":"5030377b-58c8-4193-8d72-79955082269f@gmail.com","threadId":"66593","inReplyTo":"pull.2458.git.git.1792437798463.gitgitgadget@gmail.com","subject":"Re: [PATCH] status: compare against both upstream and push branch by default","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-20T09:33:42Z","receivedAt":"2026-10-20T09:33:42Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Harald\n\nOn 19/10/2026 20:23, Harald Nordgren via GitGitGadget wrote:\n> From: Harald Nordgren <haraldnordgren@gmail.com>\n> > In a triangular workflow, where a branch is pulled from one place and\n> pushed to another, \"git status\" only compares the branch to its\n> upstream. It says nothing about the branch it is pushed to unless\n> status.compareBranches is configured.\n> > Show both comparisons by default. When the two resolve to the same\n> branch, which is the common case, only one comparison is shown, so the\n> output for most users does not change. Setting status.compareBranches\n> to \"@{upstream}\" gives the previous output.\n> > Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n> ---\n>      status: compare against both upstream and push branch by default\n>      >      Make @{upstream} @{push} the default for status.compareBranches. When\n>      both resolve to the same branch only one comparison is shown, so most\n>      users see no change.\n\nIf you want to change the default value of a config variable it is helpful to explain why the current default was chosen as well as why you think the new default is better. In this case wasn't there some discussion about the default value when the variable was introduced? Providing that context would make it much easier for people to judge if this change is a good idea.\n\nThanks\n\nPhillip\n\n\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2458%2FHaraldNordgren%2Fstatus-compare-branches-default-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2458/HaraldNordgren/status-compare-branches-default-v1\n> Pull-Request: https://github.com/git/git/pull/2458\n> >   Documentation/config/status.adoc | 11 ++++++-----\n>   remote.c                         |  1 +\n>   t/t5505-remote.sh                |  1 -\n>   t/t6040-tracking-info.sh         | 30 +++++++++++++++---------------\n>   4 files changed, 22 insertions(+), 21 deletions(-)\n> > diff --git a/Documentation/config/status.adoc b/Documentation/config/status.adoc\n> index b5dd85b761..1d847d3a8a 100644\n> --- a/Documentation/config/status.adoc\n> +++ b/Documentation/config/status.adoc\n> @@ -23,8 +23,9 @@ status.compareBranches::\n>   \tare supported. They are interpreted as `branch@{upstream}` and\n>   \t`branch@{push}` for the current branch.\n>   +\n> -If not set, the default behavior is equivalent to `@{upstream}`, which\n> -compares against the configured upstream tracking branch.\n> +If not set, the default behavior is equivalent to `@{upstream} @{push}`,\n> +which compares against both the configured upstream and push tracking\n> +branches.\n>   +\n>   The entries are shown in the order they appear in the configuration.\n>   Duplicate entries that resolve to the same ref are suppressed after\n> @@ -36,11 +37,11 @@ Example:\n>   +\n>   ----\n>   [status]\n> -\tcompareBranches = @{upstream} @{push}\n> +\tcompareBranches = @{upstream}\n>   ----\n>   +\n> -This would show comparisons against both the configured upstream and push\n> -tracking branches for the current branch.\n> +This would only show the comparison against the configured upstream\n> +tracking branch for the current branch.\n>   >   status.displayCommentPrefix::\n>   \tIf set to true, linkgit:git-status[1] will insert a comment\n> diff --git a/remote.c b/remote.c\n> index 71170f36a9..6fdb4b84da 100644\n> --- a/remote.c\n> +++ b/remote.c\n> @@ -2465,6 +2465,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,\n>   \t\tstring_list_remove_empty_items(&branches, 0);\n>   \t} else {\n>   \t\tstring_list_append(&branches, \"@{upstream}\");\n> +\t\tstring_list_append(&branches, \"@{push}\");\n>   \t}\n>   >   \tupstream_ref = branch_get_upstream(branch, NULL);\n> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\n> index 5fbfcb0848..f77753605f 100755\n> --- a/t/t5505-remote.sh\n> +++ b/t/t5505-remote.sh\n> @@ -34,7 +34,6 @@ setup_url_pushremote () {\n>   \t\tgit checkout -b topic --track origin/main &&\n>   \t\tgit commit --allow-empty -m topic-change &&\n>   \t\tgit config push.default current &&\n> -\t\tgit config status.compareBranches \"@{upstream} @{push}\" &&\n>   \t\tgit config branch.topic.pushRemote \"$fork_url\" &&\n>   \t\tgit push\n>   \t)\n> diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\n> index e95d420972..e10cde090d 100755\n> --- a/t/t6040-tracking-info.sh\n> +++ b/t/t6040-tracking-info.sh\n> @@ -331,19 +331,6 @@ test_expect_success 'status.compareBranches deduplicates when upstream and push\n>   \ttest_cmp expect actual\n>   '\n>   > -test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n> -\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n> -\tgit -C test checkout main &&\n> -\tgit -C test status >actual &&\n> -\tcat >expect <<-EOF &&\n> -\tOn branch main\n> -\tYour branch is up to date with ${SQ}origin/main${SQ}.\n> -\n> -\tnothing to commit, working tree clean\n> -\tEOF\n> -\ttest_cmp expect actual\n> -'\n> -\n>   test_expect_success 'status.compareBranches with only push shows only push' '\n>   \ttest_config -C test push.default current &&\n>   \ttest_config -C test status.compareBranches \"@{push}\" &&\n> @@ -361,9 +348,8 @@ test_expect_success 'status.compareBranches with only push shows only push' '\n>   \ttest_cmp expect actual\n>   '\n>   > -test_expect_success 'status.compareBranches shows ahead of both upstream and push branch' '\n> +test_expect_success 'status shows ahead of both upstream and push branch by default' '\n>   \ttest_config -C test push.default current &&\n> -\ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n>   \tgit -C test checkout -b feature3 origin/main &&\n>   \tgit -C test push origin HEAD &&\n>   \t(cd test && advance work) &&\n> @@ -380,6 +366,20 @@ test_expect_success 'status.compareBranches shows ahead of both upstream and pus\n>   \ttest_cmp expect actual\n>   '\n>   > +test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n> +\ttest_config -C test push.default current &&\n> +\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n> +\tgit -C test checkout feature3 &&\n> +\tgit -C test status >actual &&\n> +\tcat >expect <<-EOF &&\n> +\tOn branch feature3\n> +\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n> +\n> +\tnothing to commit, working tree clean\n> +\tEOF\n> +\ttest_cmp expect actual\n> +'\n> +\n>   test_expect_success 'checkout with status.compareBranches shows both branches' '\n>   \ttest_config -C test push.default current &&\n>   \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n> > base-commit: c51408889c3b372814bc20b9431c3b74d0d268eb\n\n\n"},{"id":"555521","messageId":"CAHwyqnU1NPp3N7Qv3ChEPCo-mL=gASeG334YFg2tczzLomsm6A@mail.gmail.com","threadId":"66593","inReplyTo":"5030377b-58c8-4193-8d72-79955082269f@gmail.com","subject":"Re: [PATCH] status: compare against both upstream and push branch by default","fromName":"Harald Nordgren","fromEmail":"haraldnordgren@gmail.com","sentAt":"2026-10-20T10:19:33Z","receivedAt":"2026-10-20T10:19:33Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"> If you want to change the default value of a config variable it is\n> helpful to explain why the current default was chosen as well as why you\n> think the new default is better. In this case wasn't there some\n> discussion about the default value when the variable was introduced?\n> Providing that context would make it much easier for people to judge if\n> this change is a good idea.\n\nThat's fair.\n\n> > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2458%2FHaraldNordgren%2Fstatus-compare-branches-default-v1\n> > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2458/HaraldNordgren/status-compare-branches-default-v1\n> > Pull-Request: https://github.com/git/git/pull/2458\n> >\n> >   Documentation/config/status.adoc | 11 ++++++-----\n> >   remote.c                         |  1 +\n> >   t/t5505-remote.sh                |  1 -\n> >   t/t6040-tracking-info.sh         | 30 +++++++++++++++---------------\n> >   4 files changed, 22 insertions(+), 21 deletions(-)\n> >\n> > diff --git a/Documentation/config/status.adoc b/Documentation/config/status.adoc\n> > index b5dd85b761..1d847d3a8a 100644\n> > --- a/Documentation/config/status.adoc\n> > +++ b/Documentation/config/status.adoc\n> > @@ -23,8 +23,9 @@ status.compareBranches::\n> >       are supported. They are interpreted as `branch@{upstream}` and\n> >       `branch@{push}` for the current branch.\n> >   +\n> > -If not set, the default behavior is equivalent to `@{upstream}`, which\n> > -compares against the configured upstream tracking branch.\n> > +If not set, the default behavior is equivalent to `@{upstream} @{push}`,\n> > +which compares against both the configured upstream and push tracking\n> > +branches.\n> >   +\n> >   The entries are shown in the order they appear in the configuration.\n> >   Duplicate entries that resolve to the same ref are suppressed after\n> > @@ -36,11 +37,11 @@ Example:\n> >   +\n> >   ----\n> >   [status]\n> > -     compareBranches = @{upstream} @{push}\n> > +     compareBranches = @{upstream}\n> >   ----\n> >   +\n> > -This would show comparisons against both the configured upstream and push\n> > -tracking branches for the current branch.\n> > +This would only show the comparison against the configured upstream\n> > +tracking branch for the current branch.\n> >\n> >   status.displayCommentPrefix::\n> >       If set to true, linkgit:git-status[1] will insert a comment\n> > diff --git a/remote.c b/remote.c\n> > index 71170f36a9..6fdb4b84da 100644\n> > --- a/remote.c\n> > +++ b/remote.c\n> > @@ -2465,6 +2465,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,\n> >               string_list_remove_empty_items(&branches, 0);\n> >       } else {\n> >               string_list_append(&branches, \"@{upstream}\");\n> > +             string_list_append(&branches, \"@{push}\");\n> >       }\n> >\n> >       upstream_ref = branch_get_upstream(branch, NULL);\n> > diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\n> > index 5fbfcb0848..f77753605f 100755\n> > --- a/t/t5505-remote.sh\n> > +++ b/t/t5505-remote.sh\n> > @@ -34,7 +34,6 @@ setup_url_pushremote () {\n> >               git checkout -b topic --track origin/main &&\n> >               git commit --allow-empty -m topic-change &&\n> >               git config push.default current &&\n> > -             git config status.compareBranches \"@{upstream} @{push}\" &&\n> >               git config branch.topic.pushRemote \"$fork_url\" &&\n> >               git push\n> >       )\n> > diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\n> > index e95d420972..e10cde090d 100755\n> > --- a/t/t6040-tracking-info.sh\n> > +++ b/t/t6040-tracking-info.sh\n> > @@ -331,19 +331,6 @@ test_expect_success 'status.compareBranches deduplicates when upstream and push\n> >       test_cmp expect actual\n> >   '\n> >\n> > -test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n> > -     test_config -C test status.compareBranches \"@{upstream}\" &&\n> > -     git -C test checkout main &&\n> > -     git -C test status >actual &&\n> > -     cat >expect <<-EOF &&\n> > -     On branch main\n> > -     Your branch is up to date with ${SQ}origin/main${SQ}.\n> > -\n> > -     nothing to commit, working tree clean\n> > -     EOF\n> > -     test_cmp expect actual\n> > -'\n> > -\n> >   test_expect_success 'status.compareBranches with only push shows only push' '\n> >       test_config -C test push.default current &&\n> >       test_config -C test status.compareBranches \"@{push}\" &&\n> > @@ -361,9 +348,8 @@ test_expect_success 'status.compareBranches with only push shows only push' '\n> >       test_cmp expect actual\n> >   '\n> >\n> > -test_expect_success 'status.compareBranches shows ahead of both upstream and push branch' '\n> > +test_expect_success 'status shows ahead of both upstream and push branch by default' '\n> >       test_config -C test push.default current &&\n> > -     test_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n> >       git -C test checkout -b feature3 origin/main &&\n> >       git -C test push origin HEAD &&\n> >       (cd test && advance work) &&\n> > @@ -380,6 +366,20 @@ test_expect_success 'status.compareBranches shows ahead of both upstream and pus\n> >       test_cmp expect actual\n> >   '\n> >\n> > +test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n> > +     test_config -C test push.default current &&\n> > +     test_config -C test status.compareBranches \"@{upstream}\" &&\n> > +     git -C test checkout feature3 &&\n> > +     git -C test status >actual &&\n> > +     cat >expect <<-EOF &&\n> > +     On branch feature3\n> > +     Your branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n> > +\n> > +     nothing to commit, working tree clean\n> > +     EOF\n> > +     test_cmp expect actual\n> > +'\n> > +\n> >   test_expect_success 'checkout with status.compareBranches shows both branches' '\n> >       test_config -C test push.default current &&\n> >       test_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n> >\n> > base-commit: c51408889c3b372814bc20b9431c3b74d0d268eb\n\nAs a side note:\n\nI see that you include the whole message in replies, leaving\nresponders to clean it, so more work for multiple people instead of\nmore work for a single person. Isn't the convention to only include\nthe parts that you are responding to?\n\n\nHarald\n\n"},{"id":"555525","messageId":"d8ac05cc-54e8-4dca-8757-ca48acd600b9@app.fastmail.com","threadId":"66593","inReplyTo":"CAHwyqnU1NPp3N7Qv3ChEPCo-mL=gASeG334YFg2tczzLomsm6A@mail.gmail.com","subject":"Re: [PATCH] status: compare against both upstream and push branch by default","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-10-20T10:56:30Z","receivedAt":"2026-10-20T10:56:30Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Tue, Oct 20, 2026, at 12:19, Harald Nordgren wrote:\n>> >[snip]\n>\n> As a side note:\n>\n> I see that you include the whole message in replies, leaving\n> responders to clean it, so more work for multiple people instead of\n> more work for a single person. Isn't the convention to only include\n> the parts that you are responding to?\n\nThat’s generally recommended yes.\n\ne.g. https://lore.kernel.org/git/arz7CNEhQSoDwJ77@pks.im/#t\n\n"},{"id":"555533","messageId":"a5fa416c-da26-4f7d-8a66-3dd11ed7937c@gmail.com","threadId":"66593","inReplyTo":"CAHwyqnU1NPp3N7Qv3ChEPCo-mL=gASeG334YFg2tczzLomsm6A@mail.gmail.com","subject":"Re: [PATCH] status: compare against both upstream and push branch by default","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-20T13:22:35Z","receivedAt":"2026-10-20T13:22:35Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 20/10/2026 11:19, Harald Nordgren wrote:\n> > As a side note:\n> > I see that you include the whole message in replies, leaving\n> responders to clean it, so more work for multiple people instead of\n> more work for a single person. Isn't the convention to only include\n> the parts that you are responding to?\nI tend not to trim the message below my signature (which indicates the end of my comments), but I do trim the context above it. I aim to leave enough context that someone reading my reply can comprehend it without needing to read the message I'm replying to. In this case the original commit message was only a couple of paragraphs and I though it was relevant context for my reply so I left it in. As a thread gets longer I'll trim earlier discussions more aggressively.\n\nThanks\n\nPhillip\n\n"},{"id":"555728","messageId":"pull.2458.v2.git.git.1792585662669.gitgitgadget@gmail.com","threadId":"66593","inReplyTo":"pull.2458.git.git.1792437798463.gitgitgadget@gmail.com","subject":"[PATCH v2] status: compare against both upstream and push branch by default","fromName":"Harald Nordgren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-21T12:27:42Z","receivedAt":"2026-10-21T12:27:42Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"From: Harald Nordgren <haraldnordgren@gmail.com>\n\nCommit 3ea95ac9c5 (status: add status.compareBranches config for\nmultiple branch comparisons, 2026-02-26) added status.compareBranches\nso that \"git status\" can show comparison of the current branch with\nits upstream in addition to where the branch is pushed to, which is\ngreat to support the triangular workflow. It however did not make it\nthe default to show both.\n\nShowing both without any configuration was the original proposal for\nthat commit. But some found the comparison with the push branch to be\nnoise. So the comparison was made opt in [1], with the idea of\nflipping the default later if people like the option.\n\nMake \"@{upstream} @{push}\" the default. With push.default left at\n\"simple\", @{push} is either the same as @{upstream} or does not\nresolve at all, so the output stays the same. It only changes for\nthose who set push.default to \"current\" or \"matching\", or configure a\npush refspec, in two cases:\n\n  - In a triangular workflow, a comparison with the push branch is\n    shown after the one with the upstream.\n\n  - A branch without an upstream is compared with the branch it is\n    pushed to, where nothing was shown before.\n\nThose who find the comparison with the push branch to be noise can\nset status.compareBranches to \"@{upstream}\" to get the old output\nback. Having configured push.default and a push remote to get there,\nthey are the users best placed to find that setting. Those who are\njust starting to push somewhere other than where they pull from\nbenefit the most from seeing both comparisons without having to\ndiscover the variable first.\n\nNo existing test relied on the old default, since none of them had a\npush branch different from the upstream without also setting\nstatus.compareBranches. Add tests for the new default on a branch\nwhose upstream and push branch are the same, on a branch in a\ntriangular workflow, and on a branch without an upstream. The existing\ntest that sets the variable to \"@{upstream}\" uses a branch where both\nare the same, so it passes with either default. Add one on a\ntriangular branch to show that it restores the old output.\n\n[1] https://lore.kernel.org/git/xmqq8qe0f2iq.fsf@gitster.g/\n\nSigned-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n---\n    status: compare against both upstream and push branch by default\n    \n    Make @{upstream} @{push} the default for status.compareBranches. With\n    the default push.default of simple the output does not change. With\n    current or matching, a branch pushed somewhere other than its upstream\n    now shows both comparisons.\n    \n    Changes in v2:\n    \n     * Kept the existing tests unchanged, including the explicit\n       \"@{upstream} @{push}\" config and the \"@{upstream}\" test on main\n     * Added tests for the new default with the same upstream and push\n       branch, in a triangular workflow, and without an upstream\n     * Added a test showing that \"@{upstream}\" restores the old output on a\n       triangular branch\n     * Reworded the commit message to point to 3ea95ac9c5 and explain which\n       setups see a change\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2458%2FHaraldNordgren%2Fstatus-compare-branches-default-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2458/HaraldNordgren/status-compare-branches-default-v2\nPull-Request: https://github.com/git/git/pull/2458\n\nRange-diff vs v1:\n\n 1:  2de975c175 ! 1:  39512b9ea1 status: compare against both upstream and push branch by default\n     @@ Metadata\n       ## Commit message ##\n          status: compare against both upstream and push branch by default\n      \n     -    In a triangular workflow, where a branch is pulled from one place and\n     -    pushed to another, \"git status\" only compares the branch to its\n     -    upstream. It says nothing about the branch it is pushed to unless\n     -    status.compareBranches is configured.\n     +    Commit 3ea95ac9c5 (status: add status.compareBranches config for\n     +    multiple branch comparisons, 2026-02-26) added status.compareBranches\n     +    so that \"git status\" can show comparison of the current branch with\n     +    its upstream in addition to where the branch is pushed to, which is\n     +    great to support the triangular workflow. It however did not make it\n     +    the default to show both.\n      \n     -    Show both comparisons by default. When the two resolve to the same\n     -    branch, which is the common case, only one comparison is shown, so the\n     -    output for most users does not change. Setting status.compareBranches\n     -    to \"@{upstream}\" gives the previous output.\n     +    Showing both without any configuration was the original proposal for\n     +    that commit. But some found the comparison with the push branch to be\n     +    noise. So the comparison was made opt in [1], with the idea of\n     +    flipping the default later if people like the option.\n     +\n     +    Make \"@{upstream} @{push}\" the default. With push.default left at\n     +    \"simple\", @{push} is either the same as @{upstream} or does not\n     +    resolve at all, so the output stays the same. It only changes for\n     +    those who set push.default to \"current\" or \"matching\", or configure a\n     +    push refspec, in two cases:\n     +\n     +      - In a triangular workflow, a comparison with the push branch is\n     +        shown after the one with the upstream.\n     +\n     +      - A branch without an upstream is compared with the branch it is\n     +        pushed to, where nothing was shown before.\n     +\n     +    Those who find the comparison with the push branch to be noise can\n     +    set status.compareBranches to \"@{upstream}\" to get the old output\n     +    back. Having configured push.default and a push remote to get there,\n     +    they are the users best placed to find that setting. Those who are\n     +    just starting to push somewhere other than where they pull from\n     +    benefit the most from seeing both comparisons without having to\n     +    discover the variable first.\n     +\n     +    No existing test relied on the old default, since none of them had a\n     +    push branch different from the upstream without also setting\n     +    status.compareBranches. Add tests for the new default on a branch\n     +    whose upstream and push branch are the same, on a branch in a\n     +    triangular workflow, and on a branch without an upstream. The existing\n     +    test that sets the variable to \"@{upstream}\" uses a branch where both\n     +    are the same, so it passes with either default. Add one on a\n     +    triangular branch to show that it restores the old output.\n     +\n     +    [1] https://lore.kernel.org/git/xmqq8qe0f2iq.fsf@gitster.g/\n      \n          Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n      \n     @@ remote.c: int format_tracking_info(struct branch *branch, struct strbuf *sb,\n       \n       \tupstream_ref = branch_get_upstream(branch, NULL);\n      \n     - ## t/t5505-remote.sh ##\n     -@@ t/t5505-remote.sh: setup_url_pushremote () {\n     - \t\tgit checkout -b topic --track origin/main &&\n     - \t\tgit commit --allow-empty -m topic-change &&\n     - \t\tgit config push.default current &&\n     --\t\tgit config status.compareBranches \"@{upstream} @{push}\" &&\n     - \t\tgit config branch.topic.pushRemote \"$fork_url\" &&\n     - \t\tgit push\n     - \t)\n     -\n       ## t/t6040-tracking-info.sh ##\n      @@ t/t6040-tracking-info.sh: test_expect_success 'status.compareBranches deduplicates when upstream and push\n       \ttest_cmp expect actual\n       '\n       \n     --test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n     --\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n     --\tgit -C test checkout main &&\n     --\tgit -C test status >actual &&\n     --\tcat >expect <<-EOF &&\n     --\tOn branch main\n     --\tYour branch is up to date with ${SQ}origin/main${SQ}.\n     --\n     --\tnothing to commit, working tree clean\n     --\tEOF\n     --\ttest_cmp expect actual\n     --'\n     --\n     - test_expect_success 'status.compareBranches with only push shows only push' '\n     - \ttest_config -C test push.default current &&\n     - \ttest_config -C test status.compareBranches \"@{push}\" &&\n     -@@ t/t6040-tracking-info.sh: test_expect_success 'status.compareBranches with only push shows only push' '\n     - \ttest_cmp expect actual\n     - '\n     - \n     --test_expect_success 'status.compareBranches shows ahead of both upstream and push branch' '\n     -+test_expect_success 'status shows ahead of both upstream and push branch by default' '\n     - \ttest_config -C test push.default current &&\n     --\ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n     - \tgit -C test checkout -b feature3 origin/main &&\n     - \tgit -C test push origin HEAD &&\n     - \t(cd test && advance work) &&\n     ++test_expect_success 'status shows one comparison by default when upstream and push are the same' '\n     ++\tgit -C test checkout main &&\n     ++\tgit -C test status >actual &&\n     ++\tcat >expect <<-EOF &&\n     ++\tOn branch main\n     ++\tYour branch is up to date with ${SQ}origin/main${SQ}.\n     ++\n     ++\tnothing to commit, working tree clean\n     ++\tEOF\n     ++\ttest_cmp expect actual\n     ++'\n     ++\n     + test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n     + \ttest_config -C test status.compareBranches \"@{upstream}\" &&\n     + \tgit -C test checkout main &&\n      @@ t/t6040-tracking-info.sh: test_expect_success 'status.compareBranches shows ahead of both upstream and pus\n       \ttest_cmp expect actual\n       '\n       \n     -+test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n     ++test_expect_success 'status shows ahead of both upstream and push branch by default' '\n     ++\ttest_config -C test push.default current &&\n     ++\tgit -C test checkout feature3 &&\n     ++\tgit -C test status >actual &&\n     ++\tcat >expect <<-EOF &&\n     ++\tOn branch feature3\n     ++\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n     ++\n     ++\tYour branch is ahead of ${SQ}origin/feature3${SQ} by 1 commit.\n     ++\t  (use \"git push\" to publish your local commits)\n     ++\n     ++\tnothing to commit, working tree clean\n     ++\tEOF\n     ++\ttest_cmp expect actual\n     ++'\n     ++\n     ++test_expect_success 'status.compareBranches with only upstream hides a different push branch' '\n      +\ttest_config -C test push.default current &&\n      +\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n      +\tgit -C test checkout feature3 &&\n     @@ t/t6040-tracking-info.sh: test_expect_success 'status.compareBranches shows ahea\n       test_expect_success 'checkout with status.compareBranches shows both branches' '\n       \ttest_config -C test push.default current &&\n       \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n     +@@ t/t6040-tracking-info.sh: test_expect_success 'status.compareBranches with behind push branch and no upstr\n     + \ttest_cmp expect actual\n     + '\n     + \n     ++test_expect_success 'status shows push branch by default without upstream' '\n     ++\ttest_config -C test push.default current &&\n     ++\ttest_config -C test remote.pushDefault origin &&\n     ++\tgit -C test checkout feature15 &&\n     ++\tgit -C test status >actual &&\n     ++\tcat >expect <<-EOF &&\n     ++\tOn branch feature15\n     ++\tYour branch is behind ${SQ}origin/feature15${SQ} by 1 commit, and can be fast-forwarded.\n     ++\t  (use \"git pull origin feature15\" to update your local branch)\n     ++\n     ++\tnothing to commit, working tree clean\n     ++\tEOF\n     ++\ttest_cmp expect actual\n     ++'\n     ++\n     + test_expect_success 'status.compareBranches behind upstream-equals-push suggests plain pull' '\n     + \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n     + \tgit -C test checkout -b feature16 origin/main &&\n\n\n Documentation/config/status.adoc | 11 +++---\n remote.c                         |  1 +\n t/t6040-tracking-info.sh         | 57 ++++++++++++++++++++++++++++++++\n 3 files changed, 64 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/config/status.adoc b/Documentation/config/status.adoc\nindex b5dd85b761..1d847d3a8a 100644\n--- a/Documentation/config/status.adoc\n+++ b/Documentation/config/status.adoc\n@@ -23,8 +23,9 @@ status.compareBranches::\n \tare supported. They are interpreted as `branch@{upstream}` and\n \t`branch@{push}` for the current branch.\n +\n-If not set, the default behavior is equivalent to `@{upstream}`, which\n-compares against the configured upstream tracking branch.\n+If not set, the default behavior is equivalent to `@{upstream} @{push}`,\n+which compares against both the configured upstream and push tracking\n+branches.\n +\n The entries are shown in the order they appear in the configuration.\n Duplicate entries that resolve to the same ref are suppressed after\n@@ -36,11 +37,11 @@ Example:\n +\n ----\n [status]\n-\tcompareBranches = @{upstream} @{push}\n+\tcompareBranches = @{upstream}\n ----\n +\n-This would show comparisons against both the configured upstream and push\n-tracking branches for the current branch.\n+This would only show the comparison against the configured upstream\n+tracking branch for the current branch.\n \n status.displayCommentPrefix::\n \tIf set to true, linkgit:git-status[1] will insert a comment\ndiff --git a/remote.c b/remote.c\nindex 49ee2ea318..0d97cb9100 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -2472,6 +2472,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,\n \t\tstring_list_remove_empty_items(&branches, 0);\n \t} else {\n \t\tstring_list_append(&branches, \"@{upstream}\");\n+\t\tstring_list_append(&branches, \"@{push}\");\n \t}\n \n \tupstream_ref = branch_get_upstream(branch, NULL);\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex e95d420972..3d61297c37 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -331,6 +331,18 @@ test_expect_success 'status.compareBranches deduplicates when upstream and push\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'status shows one comparison by default when upstream and push are the same' '\n+\tgit -C test checkout main &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch main\n+\tYour branch is up to date with ${SQ}origin/main${SQ}.\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n \ttest_config -C test status.compareBranches \"@{upstream}\" &&\n \tgit -C test checkout main &&\n@@ -380,6 +392,36 @@ test_expect_success 'status.compareBranches shows ahead of both upstream and pus\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'status shows ahead of both upstream and push branch by default' '\n+\ttest_config -C test push.default current &&\n+\tgit -C test checkout feature3 &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch feature3\n+\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n+\n+\tYour branch is ahead of ${SQ}origin/feature3${SQ} by 1 commit.\n+\t  (use \"git push\" to publish your local commits)\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'status.compareBranches with only upstream hides a different push branch' '\n+\ttest_config -C test push.default current &&\n+\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n+\tgit -C test checkout feature3 &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch feature3\n+\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'checkout with status.compareBranches shows both branches' '\n \ttest_config -C test push.default current &&\n \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n@@ -707,6 +749,21 @@ test_expect_success 'status.compareBranches with behind push branch and no upstr\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'status shows push branch by default without upstream' '\n+\ttest_config -C test push.default current &&\n+\ttest_config -C test remote.pushDefault origin &&\n+\tgit -C test checkout feature15 &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch feature15\n+\tYour branch is behind ${SQ}origin/feature15${SQ} by 1 commit, and can be fast-forwarded.\n+\t  (use \"git pull origin feature15\" to update your local branch)\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'status.compareBranches behind upstream-equals-push suggests plain pull' '\n \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n \tgit -C test checkout -b feature16 origin/main &&\n\nbase-commit: 47fdf2208c5b94c8cc01c106b8f7c85efb91c926\n-- \ngitgitgadget\n\n"},{"id":"556084","messageId":"xmqqld7o71ot.fsf@gitster.g","threadId":"66593","inReplyTo":"pull.2458.v2.git.git.1792585662669.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] status: compare against both upstream and push branch by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-23T17:43:14Z","receivedAt":"2026-10-23T17:43:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Harald Nordgren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Showing both without any configuration was the original proposal for\n> that commit. But some found the comparison with the push branch to be\n> noise. So the comparison was made opt in [1], with the idea of\n> flipping the default later if people like the option.\n\nThe key phrase here is \"if people like the option\".\n\n> Those who find the comparison with the push branch to be noise can\n> set status.compareBranches to \"@{upstream}\" to get the old output\n> back.\n\nThe presence of an escape hatch is described here.  But its\nexistence is not a valid excuse to force people to use it, nor does\nit answer the question \"if people like the option\" posed above.\n\nThe paragraph above (and below) also assumes that comparing with\n@{push} is not noise for many people.  We have not yet heard a\nconvincing argument supporting that assumption in the proposed log\nmessage.  In a triangular workflow, @{upstream} is not under your\ncontrol, so you may want to monitor its progress closely.  But isn't\nyour @{push} destination typically owned solely by you?  In other\nwords, aren't you the only one who pushes to it?  If so, whatever\nyou did locally would be the only change that could go on top of\n@{push}, and unlike @{upstream} you would not see any unexpected\nwork over there appearing without your control.\n\n> Having configured push.default and a push remote to get there,\n> they are the users best placed to find that setting. Those who are\n> just starting to push somewhere other than where they pull from\n> benefit the most from seeing both comparisons without having to\n> discover the variable first.\n\nI do not think I follow.  Those who are just starting to push to a\ndestination other than @{upstream} would have changed their\nconfiguration to do so, wouldn't they?  Aren't they equally well\nplaced, if not more, to find the same setting?\n\nOverall, I still do not find it convincing that we should change the\ndefault to surprise existing users.\n\nThanks.\n\n"},{"id":"556098","messageId":"CAHwyqnVMgAhyHrevXOJ0sBKkaPPzSmCcCPSSeqm6dm-MRX65cQ@mail.gmail.com","threadId":"66593","inReplyTo":"xmqqld7o71ot.fsf@gitster.g","subject":"Re: [PATCH v2] status: compare against both upstream and push branch by default","fromName":"Harald Nordgren","fromEmail":"haraldnordgren@gmail.com","sentAt":"2026-10-23T18:48:30Z","receivedAt":"2026-10-23T18:48:30Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"> I do not think I follow.  Those who are just starting to push to a\n> destination other than @{upstream} would have changed their\n> configuration to do so, wouldn't they?  Aren't they equally well\n> placed, if not more, to find the same setting?\n\nMost users (from my experience) have their *push* branch as upstream,\nstemming from the `git push -u` behavior that is recommended by\nGitHub. Meaning they are already missing the info about what upstream\nis doing and how it’s changing.\n\nThis is limiting their understanding of triangular workflows.\n\nWhen using `--set-upstream-to`, now they get upstream status, a big\nimprovement, but this scares many users because the connection to push\nbranch is now seemingly lost.\n\nThis is the point behind this: To ease users into triangular thinking.\nWe should not assume our users are git experts, many of my them never\nread the git docs.\n\n\nHarald\n\n"},{"id":"556120","messageId":"xmqqtsmc2hmn.fsf@gitster.g","threadId":"66593","inReplyTo":"CAHwyqnVMgAhyHrevXOJ0sBKkaPPzSmCcCPSSeqm6dm-MRX65cQ@mail.gmail.com","subject":"Re: [PATCH v2] status: compare against both upstream and push branch by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-23T22:10:08Z","receivedAt":"2026-10-23T22:10:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Harald Nordgren <haraldnordgren@gmail.com> writes:\n\n> This is the point behind this: To ease users into triangular thinking.\n> We should not assume our users are git experts, many of my them never\n> read the git docs.\n\nSo instead we should assume that they start from mental model that\nwas destroyed by use of GitHub?  The need to do so somehow makes it\nsmell like a sad world.\n\n"},{"id":"556123","messageId":"CAHwyqnXwFwJYSA-ktNuDKk6RfXjyvFiYka-K13-9wq=qFgKnjQ@mail.gmail.com","threadId":"66593","inReplyTo":"xmqqtsmc2hmn.fsf@gitster.g","subject":"Re: [PATCH v2] status: compare against both upstream and push branch by default","fromName":"Harald Nordgren","fromEmail":"haraldnordgren@gmail.com","sentAt":"2026-10-23T22:54:01Z","receivedAt":"2026-10-23T22:54:01Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"> > This is the point behind this: To ease users into triangular thinking.\n> > We should not assume our users are git experts, many of my them never\n> > read the git docs.\n>\n> So instead we should assume that they start from mental model that\n> was destroyed by use of GitHub?  The need to do so somehow makes it\n> smell like a sad world.\n\nI think it's better to accept the world as it is rather than engaging\nin wishful thinking :)\n\n\nHarald\n\n"},{"id":"556127","messageId":"xmqqh5ic2eyr.fsf@gitster.g","threadId":"66593","inReplyTo":"CAHwyqnXwFwJYSA-ktNuDKk6RfXjyvFiYka-K13-9wq=qFgKnjQ@mail.gmail.com","subject":"Re: [PATCH v2] status: compare against both upstream and push branch by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-23T23:07:40Z","receivedAt":"2026-10-23T23:07:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Harald Nordgren <haraldnordgren@gmail.com> writes:\n\n>> > This is the point behind this: To ease users into triangular thinking.\n>> > We should not assume our users are git experts, many of my them never\n>> > read the git docs.\n>>\n>> So instead we should assume that they start from mental model that\n>> was destroyed by use of GitHub?  The need to do so somehow makes it\n>> smell like a sad world.\n>\n> I think it's better to accept the world as it is rather than engaging\n> in wishful thinking :)\n\nAt least you could push whatever is encouraging the use of \"-u\" to\nbreak their mental model into also suggesting to set the necessary\nconfiguration, which would make _them_ internally consistent, without\nbreaking existing users (and without bothering me).\n\n\n\n"},{"id":"556155","messageId":"CALnO6CBD2aGg_wDZZsT-mWJ99MXYUycx32JfsK8zJXfcmjTBDw@mail.gmail.com","threadId":"66593","inReplyTo":"xmqqld7o71ot.fsf@gitster.g","subject":"Re: [PATCH v2] status: compare against both upstream and push branch by default","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-10-24T13:49:26Z","receivedAt":"2026-10-24T13:49:26Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Fri, Oct 23, 2026 at 1:45 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Harald Nordgren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > Showing both without any configuration was the original proposal for\n> > that commit. But some found the comparison with the push branch to be\n> > noise. So the comparison was made opt in [1], with the idea of\n> > flipping the default later if people like the option.\n>\n> The key phrase here is \"if people like the option\".\n>\n> > Those who find the comparison with the push branch to be noise can\n> > set status.compareBranches to \"@{upstream}\" to get the old output\n> > back.\n>\n> The presence of an escape hatch is described here.  But its\n> existence is not a valid excuse to force people to use it, nor does\n> it answer the question \"if people like the option\" posed above.\n\nI agree, though I still support changing the default. I think we need\nto make a stronger case.\n\n> The paragraph above (and below) also assumes that comparing with\n> @{push} is not noise for many people.  We have not yet heard a\n> convincing argument supporting that assumption in the proposed log\n> message.  In a triangular workflow, @{upstream} is not under your\n> control, so you may want to monitor its progress closely.  But isn't\n> your @{push} destination typically owned solely by you?  In other\n> words, aren't you the only one who pushes to it?  If so, whatever\n> you did locally would be the only change that could go on top of\n> @{push}, and unlike @{upstream} you would not see any unexpected\n> work over there appearing without your control.\n\nI think this paragraph assumes that either\n\n* I'm only pushing new commits to @{push}, or\n* I remember what the current state of @{push} is without checking.\n\nI may not see \"unexpected\" work appearing there in most cases, but I\ncertainly appreciate the reminder when returning to a topic after\nworking on something else. Have I rebased/amended/git-history'd lately\nand need to force-push? Do I care about the differences? Sometimes I\nalready know the answer and want to validate what I'm about to send\nout, kind of like \"git send-email\" with sendemail.annotate (and\nmultiedit, for me) configured.\n\nI have a number of ways of helping answer this question, personally:\n\n* git status: only ahead-behind count, but lets me know if there's\nanything to do. I don't actually check this output too often myself\nbecause I built the below prior the config under discussion, and they\nare focused + finger memory---I almost always run short status when I\ndo look at status, but that's because I don't normally need the\nverbose output these days ;) That's not the case for most of our\nusers.\n* \"git sbup\" = show-branch HEAD HEAD@{push} HEAD@{upstream}: a quick\ndivergence check\n* \"git rdup\" = range-diff HEAD@{upstream} HEAD@{push} HEAD: a detailed\ncomparison\n* \"git div\" [1] runs a triple-dot graph log (with more options)\ncomparing HEAD against @{push} (if they differ) or @{upstream} (if\nthey're the same), omitting some other inferences and ways to supply\nwhich topic to inspect.\n\n[1]: https://github.com/benknoble/Dotfiles/blob/master/links/bin/git-div\n\nSo, I suppose my point is: as someone who almost exclusively has\ntriangular workflows, I'm already checking this push--local divergence\non a regular basis. I just built my own extensions to do so prior to\nHarald's welcome addition to status. Perhaps that can help Harald\nargue the case more convincingly in a proposed log message?\n\n(Julia and I discussed briefly off-list whether \"git-div\"/\"git-vee\"\nshould be part of Git, and I'm noodling on whether such a thing might\nmake sense as \"git log --divergence\" or something.)\n\n-- \nD. Ben Knoble\n\n"},{"id":"556174","messageId":"xmqq1p9f123v.fsf@gitster.g","threadId":"66593","inReplyTo":"CALnO6CBD2aGg_wDZZsT-mWJ99MXYUycx32JfsK8zJXfcmjTBDw@mail.gmail.com","subject":"Re: [PATCH v2] status: compare against both upstream and push branch by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-24T16:43:00Z","receivedAt":"2026-10-24T16:43:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n\n>> control, so you may want to monitor its progress closely.  But isn't\n>> your @{push} destination typically owned solely by you?  In other\n>> words, aren't you the only one who pushes to it?  If so, whatever\n>> you did locally would be the only change that could go on top of\n>> @{push}, and unlike @{upstream} you would not see any unexpected\n>> work over there appearing without your control.\n>\n> I think this paragraph assumes that either\n>\n> * I'm only pushing new commits to @{push}, or\n> * I remember what the current state of @{push} is without checking.\n\nI do strongly assume the former (I count revert in \"new commits\" in\nthis context, by the way), but not necessarily the latter.  But\nunlike what appears in @{upstream}, I expect you would recognise\nthem when you see them.\n\n\n"},{"id":"556209","messageId":"pull.2458.v3.git.git.1792925493844.gitgitgadget@gmail.com","threadId":"66593","inReplyTo":"pull.2458.git.git.1792437798463.gitgitgadget@gmail.com","subject":"[PATCH v3] status: compare against both upstream and push branch by default","fromName":"Harald Nordgren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-25T10:51:33Z","receivedAt":"2026-10-25T10:51:33Z","isPatch":true,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"From: Harald Nordgren <haraldnordgren@gmail.com>\n\nCommit 3ea95ac9c5 (status: add status.compareBranches config for\nmultiple branch comparisons, 2026-02-26) added status.compareBranches\nso that \"git status\" can show comparison of the current branch with\nits upstream in addition to where the branch is pushed to, which is\ngreat to support the triangular workflow. It however did not make it\nthe default to show both.\n\nShowing both without any configuration was the original proposal for\nthat commit. But some found the comparison with the push branch to be\nnoise. So the comparison was made opt in [1], with the idea of\nflipping the default later if people like the option.\n\nEven when nobody else pushes to the push branch, the comparison with it\nis useful:\n\n  - When returning to a topic after working on something else, it is\n    a reminder of how the branch differs from what was last pushed.\n\n  - It tells whether the branch was rebased or rewritten locally since\n    the last push, and needs a forced push.\n\n  - When the answer is already known, it is a quick way to validate\n    what is about to be pushed out, much like sendemail.annotate lets\n    one review each patch before \"git send-email\" sends it.\n\nSome who work mostly in triangular workflows check this regularly, and\nhave built their own aliases for that: a quick check of how the branch\nhas diverged from its push and upstream branches, a detailed comparison\nof what was pushed with the local version, and a graph of where the\nbranch and its push branch diverged. Most users have no such aliases\nand only see what plain \"git status\" tells them. Showing both by\ndefault gives them that check without having to discover the variable\nfirst.\n\nMake \"@{upstream} @{push}\" the default. With push.default left at\n\"simple\", @{push} is either the same as @{upstream} or does not\nresolve at all, so the output stays the same. It only changes for\nthose who set push.default to \"current\" or \"matching\", or configure a\npush refspec, in two cases:\n\n  - In a triangular workflow, a comparison with the push branch is\n    shown after the one with the upstream.\n\n  - A branch without an upstream is compared with the branch it is\n    pushed to, where nothing was shown before.\n\nNo existing test relied on the old default, since none of them had a\npush branch different from the upstream without also setting\nstatus.compareBranches. Add tests for the new default on a branch\nwhose upstream and push branch are the same, on a branch in a\ntriangular workflow, and on a branch without an upstream. The existing\ntest that sets the variable to \"@{upstream}\" uses a branch where both\nare the same, so it passes with either default. Add one on a\ntriangular branch to show that it restores the old output.\n\n[1] https://lore.kernel.org/git/xmqq8qe0f2iq.fsf@gitster.g/\n\nSigned-off-by: Harald Nordgren <haraldnordgren@gmail.com>\n---\n    status: compare against both upstream and push branch by default\n    \n    Make @{upstream} @{push} the default for status.compareBranches. With\n    the default push.default of simple the output does not change. With\n    current or matching, a branch pushed somewhere other than its upstream\n    now shows both comparisons.\n    \n    Changes in v3:\n    \n     * Try to make a stronger case in commit message.\n    \n    Changes in v2:\n    \n     * Kept the existing tests unchanged, including the explicit\n       \"@{upstream} @{push}\" config and the \"@{upstream}\" test on main\n     * Added tests for the new default with the same upstream and push\n       branch, in a triangular workflow, and without an upstream\n     * Added a test showing that \"@{upstream}\" restores the old output on a\n       triangular branch\n     * Reworded the commit message to point to 3ea95ac9c5 and explain which\n       setups see a change\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2458%2FHaraldNordgren%2Fstatus-compare-branches-default-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2458/HaraldNordgren/status-compare-branches-default-v3\nPull-Request: https://github.com/git/git/pull/2458\n\nRange-diff vs v2:\n\n 1:  39512b9ea1 ! 1:  ae9063c16a status: compare against both upstream and push branch by default\n     @@ Commit message\n          noise. So the comparison was made opt in [1], with the idea of\n          flipping the default later if people like the option.\n      \n     +    Even when nobody else pushes to the push branch, the comparison with it\n     +    is useful:\n     +\n     +      - When returning to a topic after working on something else, it is\n     +        a reminder of how the branch differs from what was last pushed.\n     +\n     +      - It tells whether the branch was rebased or rewritten locally since\n     +        the last push, and needs a forced push.\n     +\n     +      - When the answer is already known, it is a quick way to validate\n     +        what is about to be pushed out, much like sendemail.annotate lets\n     +        one review each patch before \"git send-email\" sends it.\n     +\n     +    Some who work mostly in triangular workflows check this regularly, and\n     +    have built their own aliases for that: a quick check of how the branch\n     +    has diverged from its push and upstream branches, a detailed comparison\n     +    of what was pushed with the local version, and a graph of where the\n     +    branch and its push branch diverged. Most users have no such aliases\n     +    and only see what plain \"git status\" tells them. Showing both by\n     +    default gives them that check without having to discover the variable\n     +    first.\n     +\n          Make \"@{upstream} @{push}\" the default. With push.default left at\n          \"simple\", @{push} is either the same as @{upstream} or does not\n          resolve at all, so the output stays the same. It only changes for\n     @@ Commit message\n            - A branch without an upstream is compared with the branch it is\n              pushed to, where nothing was shown before.\n      \n     -    Those who find the comparison with the push branch to be noise can\n     -    set status.compareBranches to \"@{upstream}\" to get the old output\n     -    back. Having configured push.default and a push remote to get there,\n     -    they are the users best placed to find that setting. Those who are\n     -    just starting to push somewhere other than where they pull from\n     -    benefit the most from seeing both comparisons without having to\n     -    discover the variable first.\n     -\n          No existing test relied on the old default, since none of them had a\n          push branch different from the upstream without also setting\n          status.compareBranches. Add tests for the new default on a branch\n\n\n Documentation/config/status.adoc | 11 +++---\n remote.c                         |  1 +\n t/t6040-tracking-info.sh         | 57 ++++++++++++++++++++++++++++++++\n 3 files changed, 64 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/config/status.adoc b/Documentation/config/status.adoc\nindex b5dd85b761..1d847d3a8a 100644\n--- a/Documentation/config/status.adoc\n+++ b/Documentation/config/status.adoc\n@@ -23,8 +23,9 @@ status.compareBranches::\n \tare supported. They are interpreted as `branch@{upstream}` and\n \t`branch@{push}` for the current branch.\n +\n-If not set, the default behavior is equivalent to `@{upstream}`, which\n-compares against the configured upstream tracking branch.\n+If not set, the default behavior is equivalent to `@{upstream} @{push}`,\n+which compares against both the configured upstream and push tracking\n+branches.\n +\n The entries are shown in the order they appear in the configuration.\n Duplicate entries that resolve to the same ref are suppressed after\n@@ -36,11 +37,11 @@ Example:\n +\n ----\n [status]\n-\tcompareBranches = @{upstream} @{push}\n+\tcompareBranches = @{upstream}\n ----\n +\n-This would show comparisons against both the configured upstream and push\n-tracking branches for the current branch.\n+This would only show the comparison against the configured upstream\n+tracking branch for the current branch.\n \n status.displayCommentPrefix::\n \tIf set to true, linkgit:git-status[1] will insert a comment\ndiff --git a/remote.c b/remote.c\nindex 49ee2ea318..0d97cb9100 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -2472,6 +2472,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,\n \t\tstring_list_remove_empty_items(&branches, 0);\n \t} else {\n \t\tstring_list_append(&branches, \"@{upstream}\");\n+\t\tstring_list_append(&branches, \"@{push}\");\n \t}\n \n \tupstream_ref = branch_get_upstream(branch, NULL);\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex e95d420972..3d61297c37 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -331,6 +331,18 @@ test_expect_success 'status.compareBranches deduplicates when upstream and push\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'status shows one comparison by default when upstream and push are the same' '\n+\tgit -C test checkout main &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch main\n+\tYour branch is up to date with ${SQ}origin/main${SQ}.\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'status.compareBranches with only upstream shows only upstream' '\n \ttest_config -C test status.compareBranches \"@{upstream}\" &&\n \tgit -C test checkout main &&\n@@ -380,6 +392,36 @@ test_expect_success 'status.compareBranches shows ahead of both upstream and pus\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'status shows ahead of both upstream and push branch by default' '\n+\ttest_config -C test push.default current &&\n+\tgit -C test checkout feature3 &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch feature3\n+\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n+\n+\tYour branch is ahead of ${SQ}origin/feature3${SQ} by 1 commit.\n+\t  (use \"git push\" to publish your local commits)\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'status.compareBranches with only upstream hides a different push branch' '\n+\ttest_config -C test push.default current &&\n+\ttest_config -C test status.compareBranches \"@{upstream}\" &&\n+\tgit -C test checkout feature3 &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch feature3\n+\tYour branch is ahead of ${SQ}origin/main${SQ} by 1 commit.\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'checkout with status.compareBranches shows both branches' '\n \ttest_config -C test push.default current &&\n \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n@@ -707,6 +749,21 @@ test_expect_success 'status.compareBranches with behind push branch and no upstr\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'status shows push branch by default without upstream' '\n+\ttest_config -C test push.default current &&\n+\ttest_config -C test remote.pushDefault origin &&\n+\tgit -C test checkout feature15 &&\n+\tgit -C test status >actual &&\n+\tcat >expect <<-EOF &&\n+\tOn branch feature15\n+\tYour branch is behind ${SQ}origin/feature15${SQ} by 1 commit, and can be fast-forwarded.\n+\t  (use \"git pull origin feature15\" to update your local branch)\n+\n+\tnothing to commit, working tree clean\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'status.compareBranches behind upstream-equals-push suggests plain pull' '\n \ttest_config -C test status.compareBranches \"@{upstream} @{push}\" &&\n \tgit -C test checkout -b feature16 origin/main &&\n\nbase-commit: 7e34d8174dcda3435d1404c9a30bef46afe6c13e\n-- \ngitgitgadget\n\n"}]}