Thread (141 messages) 141 messages, 8 authors, 2026-03-04
STALE130d
Revisions (14)
  1. v12 [diff vs current]
  2. v13 [diff vs current]
  3. v14 [diff vs current]
  4. v15 [diff vs current]
  5. v16 [diff vs current]
  6. v17 [diff vs current]
  7. v18 [diff vs current]
  8. v19 [diff vs current]
  9. v20 current
  10. v21 [diff vs current]
  11. v22 [diff vs current]
  12. v23 [diff vs current]
  13. v24 [diff vs current]
  14. v25 [diff vs current]

[PATCH v20 0/2] status: show comparison with push remote tracking branch

From: Harald Nordgren via GitGitGadget <hidden>
Date: 2026-01-10 13:30:35

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                 | 183 ++++++++++++++++++++-------
 t/t6040-tracking-info.sh | 262 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 403 insertions(+), 42 deletions(-)


base-commit: d529f3a197364881746f558e5652f0236131eb86
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2138%2FHaraldNordgren%2Fahead_of_main_status-v20
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2138/HaraldNordgren/ahead_of_main_status-v20
Pull-Request: https://github.com/git/git/pull/2138

Range-diff vs v19:

 1:  451d7a4986 ! 1:  bb3e00863b refactor format_branch_comparison in preparation
     @@ remote.c: int format_tracking_info(struct branch *branch, struct strbuf *sb,
       		if (advice_enabled(ADVICE_STATUS_HINTS))
       			strbuf_addstr(sb,
       				_("  (use \"git pull\" to update your local branch)\n"));
     -@@ remote.c: int format_tracking_info(struct branch *branch, struct strbuf *sb,
     - 			       "and have %d and %d different commits each, "
     - 			       "respectively.\n",
     - 			   ours + theirs),
     + 	} else {
     + 		strbuf_addf(sb,
     +-			Q_("Your branch and '%s' have diverged,\n"
     +-			       "and have %d and %d different commit each, "
     +-			       "respectively.\n",
     +-			   "Your branch and '%s' have diverged,\n"
     +-			       "and have %d and %d different commits each, "
     +-			       "respectively.\n",
     +-			   ours + theirs),
      -			base, ours, theirs);
     ++			"Your branch and '%s' have diverged,\n"
     ++			       "and have %d and %d different commits each, respectively.\n",
      +			branch_name, ours, theirs);
       		if (show_divergence_advice &&
       		    advice_enabled(ADVICE_STATUS_HINTS))
 2:  dc8ab23158 ! 2:  050197eac3 status: show comparison with push remote tracking branch
     @@ remote.c: static void format_branch_comparison(struct strbuf *sb,
       				_("  (use \"git pull\" to update your local branch)\n"));
       	} else {
      @@ remote.c: static void format_branch_comparison(struct strbuf *sb,
     - 			       "respectively.\n",
     - 			   ours + theirs),
     + 			"Your branch and '%s' have diverged,\n"
     + 			       "and have %d and %d different commits each, respectively.\n",
       			branch_name, ours, theirs);
      -		if (show_divergence_advice &&
      -		    advice_enabled(ADVICE_STATUS_HINTS))

-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help