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

Re: question about a merge result

From
Daniel Barkalow <barkalow@iabervon.org>
Date
May 1, 2009, 16:27 UTC
Message-ID
<alpine.LNX.2.00.0905011210140.2147@iabervon.org>
In-Reply-To
<38b2ab8a0904300805j5ce19617mdda3254c37d06d38@mail.gmail.com>
On Thu, 30 Apr 2009, Francis Moreau wrote:
Show 7 quoted lines
> But the question was more about if the cortectness of the end result:
> should 'B' removed after the merge.
> 
> IOW if someone works on its own branch remove B file and thought it
> was a bad idea and restore it whereas another person remove B file but
> miss the fact that it was a bad idea, does the merge should silently
> remove B file ?

Consider that deciding to remove a file can happen for a variety of reasons. Maybe one branch wiped it out accidentally and restored it, while the other did a bunch of work to make it obsolete and then removed it intentionally. There's no reason to think that the reason behind reverting the delete on one branch applies to the other delete.

Now, if the "b1" branch had gotten the delete from "master" by merging the same commit, and had reverted the commit that deleted the file, then git should (and does) include the file in the merge result, because then some user saw that particular deletion and decided it was wrong and reverted it. (Of course, git doesn't actually consider this in its merge algorithm, but, for clever mathematical reasons, what it does is equivalent.)

	-Daniel
*This .sig left intentionally blank*
Previous: Jeff King
Message 7 of 7 in “question about a merge result”
  1. Francis MoreauApr 30, 2009
  2. Michael GaberApr 30, 2009
  3. Jeff KingApr 30, 2009
  4. Francis MoreauApr 30, 2009
  5. Björn SteinbrinkApr 30, 2009
  6. Jeff KingApr 30, 2009
  7. Daniel BarkalowMay 1, 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.