Re: [PATCH] Give better 'pull' advice when pushing non-ff updates to current branch

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Give better 'pull' advice when pushing non-ff updates to current branch

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:53:39

Christopher Tiwald [off-list ref] writes:
+		/* Branches configured for octopus merges should advise
+		 * just 'git pull' */
Style: Git usually writes these comments 

/*
 * like this
 */
+		if (branch->remote_name &&
+		    branch->merge &&
+		    branch->merge_nr == 1 &&
+		    !strcmp(transport->remote->name, branch->remote_name) &&
+		    !strcmp(strbuf_detach(&buf, NULL),
+			    prettify_refname(branch->merge[0]->dst))) {
+			advise_tracked_pull_before_push();
+		}
+		else
+			advise_untracked_pull_before_push();
Isn't this doing the opposite of what the comment is saying about
octopus merge, i.e. if branch->merge_nr > 1, call
advise_untracked_pull_before_push() which will advise 'git pull <remote>
<branch>'?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

Re: [PATCH] Give better 'pull' advice when pushing non-ff updates to current branch

From: Christopher Tiwald <hidden>
Date: 2016-06-15 22:53:39

On Tue, Apr 24, 2012 at 09:04:07AM +0200, Matthieu Moy wrote:
quoted
+		if (branch->remote_name &&
+		    branch->merge &&
+		    branch->merge_nr == 1 &&
+		    !strcmp(transport->remote->name, branch->remote_name) &&
+		    !strcmp(strbuf_detach(&buf, NULL),
+			    prettify_refname(branch->merge[0]->dst))) {
+			advise_tracked_pull_before_push();
+		}
+		else
+			advise_untracked_pull_before_push();
Isn't this doing the opposite of what the comment is saying about
octopus merge, i.e. if branch->merge_nr > 1, call
advise_untracked_pull_before_push() which will advise 'git pull <remote>
<branch>'?
Ah yes. The logic is wrong for the octopus case. That's easy to fix, but
I'm considering ditching the matching entirely per my response to
Junio's concerns. I think it might do more harm then good.

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