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

Re: [PATCH] Fix segfault in merge-recursive

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 9, 2009, 07:48 UTC
Message-ID
<alpine.DEB.1.00.0905090947120.27348@pacific.mpi-cbg.de>
In-Reply-To
<7vocu3p3pr.fsf@alter.siamese.dyndns.org>
Hi,
On Fri, 8 May 2009, Junio C Hamano wrote:
Show 9 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > When there is no "common" tree (for whatever reason), we must not
> > throw a segmentation fault.
> 
> You described why the old code was wrong (i.e. "init_tree_desc_from_tree 
> is called with common == NULL"), but there is no mention why the new 
> code is correct.  For the purpose of satisfying the above statement, you 
> could have just exit(0) as well ;-)

Yes, I should have marked this patch as "please test if the result is what you think it should be", because I was running out of time and therefore could not properly think things through.

Show 13 quoted lines
> > +	else {
> > +		opts.merge = 0;
> > +		opts.head_idx = 1;
> > +		init_tree_desc_from_tree(t+0, head);
> > +		init_tree_desc_from_tree(t+1, merge);
> > +		rc = unpack_trees(2, t, &opts);
> > +	}
> 
> This looks more like a half of branch-switch from HEAD to MERGE, not a
> merge between HEAD and MERGE as two equal histories.  Shouldn't it be
> doing a three-way tree merge using an empty tree object as the common
> ancestor instead, just like merge_recursive.c::merge_recursive() itself
> does?
But of course!

Thanks, Dscho

Previous: Junio C HamanoNext: Jakub Narebski
Message 12 of 13 in “Segfault during merge”
  1. Dave OMay 7, 2009
  2. Johannes SchindelinMay 7, 2009
  3. Dave OMay 8, 2009
  4. Fix segfault in merge-recursiveJohannes Schindelin, May 8, 2009
  5. Dave OMay 8, 2009
  6. Johannes SchindelinMay 8, 2009
  7. Dave OMay 8, 2009
  8. Don't update index while recursing (was Re: Segfault during merge)Dave O, May 9, 2009
  9. Johannes SchindelinMay 9, 2009
  10. Junio C HamanoMay 9, 2009
  11. Junio C HamanoMay 8, 2009
  12. Johannes SchindelinMay 9, 2009
  13. Jakub NarebskiMay 7, 2009

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.