git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Is XDL_MERGE_ZEALOUS too zealous (or maybe not zealous enough)?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 20, 2008, 16:17 UTC
Message-ID
<alpine.DEB.1.00.0810201809100.22125@pacific.mpi-cbg.de.mpi-cbg.de>
In-Reply-To
<7v3ais5hb3.fsf_-_@gitster.siamese.dyndns.org>
Hi,
On Sun, 19 Oct 2008, Junio C Hamano wrote:
Show 19 quoted lines
> <<<<<<< ours
> 	/* --track without -b should DWIM */
> 	if (0 < opts.track && !opts.new_branch) {
> 		const char *argv0 = argv[0];
> 	...
> 		opts.new_branch = argv0 + 1;
> 	}
> 
> 	if (opts.track == BRANCH_TRACK_UNSPECIFIED)
> 		opts.track = git_branch_track;
> =======
> 	if (conflict_style) {
> 		opts.merge = 1; /* implied */
> 		git_xmerge_config("merge.conflictstyle", conflict_style, NULL);
> 	}
> 
> 	if (!opts.new_branch && (opts.track != git_branch_track))
> 		die("git checkout: --track and --no-track require -b");
> >>>>>>> theirs

This is that case that adjacent blocks A and B are changed to A' B and A B' in the to-be-merged branches.

I could imagine that you would have this automerged to A' B', but I actually advise against that.

My gut feeling tells me that a "for" statement as block "A" and some change ("B") in the _body_ of the "for" loop that takes advantage of the original version of the "for" statement would be _real_ hard to detect.

Better have trivial conflicts reported, but catch more non-trivial ones (instead of mismerging them).

(Another possibility would be that block "B" is actually an "else". Also in this case it is easy to think of cases that would wreak havoc; OTOH we would mismerge them _already_ if at least 1 common line is unchanged between the blocks. Tough.)

But I might be completely wrong.

Ciao, Dscho "who is a little jet-lagged, so you should trust him even less than normally"

Previous: Matt McCutchen
Message 5 of 5 in “"git checkout: --track and --no-track require -b" check accidentally resurrected?”
  1. Matt McCutchenOct 19, 2008
  2. Junio C HamanoOct 19, 2008
  3. Is XDL_MERGE_ZEALOUS too zealous (or maybe not zealous enough)?Junio C Hamano, Oct 19, 2008
  4. Matt McCutchenOct 20, 2008
  5. Johannes SchindelinOct 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.