From b6f3da51322345a19c259b9359065aa54cda74ff Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Wed, 12 Jul 2023 22:41:13 -0600 Subject: wt-status: don't show divergence advice when committing When the user is in the middle of making a commit, they are not yet at the point where they are ready to think about integrating their local branch with the corresponding remote branch or force-pushing over the remote branch. Don't include advice on how to deal with divergent branches in the commit template, to avoid giving the impression that the divergence needs to be dealt with immediately. Similar advice will be printed when it is most relevant, that is, if the user does try to push without first reconciling the two branches. Signed-off-by: Alex Henrie Signed-off-by: Junio C Hamano --- remote.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index a81f2e2f17..d79aae0d76 100644 --- a/remote.c +++ b/remote.c @@ -2258,7 +2258,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs, * Return true when there is anything to report, otherwise false. */ int format_tracking_info(struct branch *branch, struct strbuf *sb, - enum ahead_behind_flags abf) + enum ahead_behind_flags abf, + int show_divergence_advice) { int ours, theirs, sti; const char *full_base; @@ -2321,7 +2322,8 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb, "respectively.\n", ours + theirs), base, ours, theirs); - if (advice_enabled(ADVICE_STATUS_HINTS)) + if (show_divergence_advice && + advice_enabled(ADVICE_STATUS_HINTS)) strbuf_addstr(sb, _(" (use \"git pull\" to merge the remote branch into yours)\n")); } -- cgit v1.2.3