[PATCH v23 0/2] status: show comparison with push remote tracking branch
- From
Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jan 12, 2026, 20:26 UTC
- Message-ID
- <pull.2138.v23.git.git.1768249586.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2138.v22.git.git.1768074976.gitgitgadget@gmail.com>
cc: Chris Torek chris.torek@gmail.com cc: Yee Cheng Chin ychin.macvim@gmail.com cc: "brian m. carlson" sandals@crustytoothpaste.net cc: Ben Knoble ben.knoble@gmail.com cc: "Kristoffer Haugsbakk" kristofferhaugsbakk@fastmail.com cc: Phillip Wood phillip.wood123@gmail.com cc: Nico Williams nico@cryptonector.com cc: Patrick Steinhardt ps@pks.im
Harald Nordgren (2): refactor format_branch_comparison in preparation status: show comparison with push remote tracking branch
remote.c | 173 ++++++++++++++++++++------ t/t6040-tracking-info.sh | 262 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 400 insertions(+), 35 deletions(-)
base-commit: 8745eae506f700657882b9e32b2aa00f234a6fb6 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2138%2FHaraldNordgren%2Fahead_of_main_status-v23 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2138/HaraldNordgren/ahead_of_main_status-v23 Pull-Request: https://github.com/git/git/pull/2138
Range-diff vs v22:
1: 4aa4f1abc8 = 1: fd05c7b778 refactor format_branch_comparison in preparation
2: b7e29887d9 ! 2: f1ad7a1b6f status: show comparison with push remote tracking branch
@@ remote.c: int stat_tracking_info(struct branch *branch, int *num_ours, int *num_
+ advice_enabled(ADVICE_STATUS_HINTS);
+ bool want_pull_advice = (flags & BRANCH_MODE_PULL) &&
+ advice_enabled(ADVICE_STATUS_HINTS);
-+ bool want_divergence_advice = (flags & BRANCH_MODE_PULL) &&
-+ show_divergence_advice &&
++ bool want_divergence_advice = show_divergence_advice &&
+ advice_enabled(ADVICE_STATUS_HINTS);
+
if (up_to_date) {
@@ remote.c: int format_tracking_info(struct branch *branch, struct strbuf *sb,
+ if (push_branch_modes & BRANCH_MODE_PUSH) {
+ strbuf_addstr(sb, "\n");
+ format_branch_comparison(sb, !push_cmp_fetch, push_ours, push_theirs, push, abf,
-+ push_branch_modes, show_divergence_advice);
++ push_branch_modes, 0);
}
free(base);-- gitgitgadget