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

Re: [PATCH] fix bug in read-cache.c which loses files when merging a tree

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 18, 2005, 21:19 UTC
Message-ID
<Pine.LNX.4.58.0504181330450.15725@ppc970.osdl.org>
In-Reply-To
<1113854941.4998.61.camel@mulgrave>
On Mon, 18 Apr 2005, James Bottomley wrote:
Show 5 quoted lines
> 
> I had a problem with the SCSI tree in that there's a file removal in one
> branch.  Your git-merge-one-file-script wouldn't have handled this
> correctly: It seems to think that the file must be removed in both
> branches, which is wrong.

Yes, I agree. My current "merge-one-file-script" doesn't actually look at what the original file was in this situation, and clearly it should. I think I'll leave it for the user to decide what happens when somebody has modified the deleted file, but clearly we should delete it if the other branch has not touched it.

I suspect that I should just pass in the SHA1 of the files to the "merge-one-file-script" from "merge-cache", rather than unpacking it. After all, the merging script can do the unpacking itself with a simple "cat-file blob $sha1".

And the fact is, many of the trivial merges should be handled by just looking at the content, and doing a "cmp" on the files seems to be a stupid way to do that when we had the sha1 earlier.

Done, and pushed out. Does the new merge infrastructure work for you?
		Linus
Previous: Linus TorvaldsNext: Petr Baudis
Message 3 of 5 in “fix bug in read-cache.c which loses files when merging a tree”
  1. fix bug in read-cache.c which loses files when merging a treeJames Bottomley, Apr 18, 2005
  2. Linus TorvaldsApr 18, 2005
  3. Linus TorvaldsApr 18, 2005
  4. Petr BaudisApr 18, 2005
  5. Linus TorvaldsApr 18, 2005

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.