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

Re: files are disappearing in git

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 25, 2005, 19:12 UTC
Message-ID
<Pine.LNX.4.64.0511251022360.13959@g5.osdl.org>
In-Reply-To
<20051125103048.GB30691@schottelius.org>
Ok, 
  Nico gave me private access to the tree, so I quickly cloned it and 
started bisecting it to figure out where the problem was. I haven't looked 
at the source code, and all the commit messages seem to be in German 
(which I can kind of understand if I work at it, but not very well), but 
it definitely turns out none of that matters.

The problem is a bad merge. And in fact, that merge lost _more_ than just the three files under Code/Spikes/Statistik/, it also lost a file called Code/lw1/Client/Pics/icon/lw1-icon.png.

I don't quite see _how_ it lost them. The merge in question is a totally trivial in-index merge, and when I re-do it, I don't lose those files. In this case, all the lost files were from the "other branch" of the merge, and they were new to that branch. IOW, in git-merge-one-file parlance, it is that trivial "added in one" case.

Pasky - do you know of any historical cogito problems like this?
Nico: the files were added in commit
 - 9e9b91166bfca448a8f1ddeb4580d73ac8ea0986:
	Neuer Spike: Statistik ...
and they stayed around in that branch until commit (which is still good):
 - dcd70e89dc7b2280260628fd699aa906c319c68f:
	Bug 359 - Defektmeldungen ...
but they disappeared when the that branch was merged with commit
 - 056c65efea28066b7b241240f0d8421d3204b624
	Bug 195 - Tagesarbeitsplan: ...
and the result is the bad merge commit:
 - 228b94dd0a7aa1516eb867674cdf8c7c7b2bfd4c:
	Merge with /home/server/git/walderlift.git

After that merge, those new files are gone - they were never added by the merge.

Quite frankly, this is clearly a bug, and it looks very much like a really serious bug in cg-merge. It's not in the core git: even old versions of git should never have been able to generate that broken merge.

But when I try to do that same merge with current cogito, I can't make it break _either_. In all cases, regardless of how I do the merge, when I do (bad-merge is the merge in your tree, "cg-test" in this case is the merge I did using cogito):

	git-diff-tree -r bad-merge cg-test
I get
	:000000 100644 0000000000000000000000000000000000000000 5c8c47d855ee0f78a7fb81c4a49224b1607a88b7 A      Code/Spikes/Statistik/Project.dpr
	:000000 100644 0000000000000000000000000000000000000000 7bd2de9b7142999bc6bbadde06e73267d1b5ee0e A      Code/Spikes/Statistik/Statistik.pas
	:000000 100644 0000000000000000000000000000000000000000 a0fb45e2b906bdac7929cfd8174053015ab629b4 A      Code/Spikes/Statistik/Statistik.xfm
	:000000 100644 0000000000000000000000000000000000000000 24f8254c06ea5efc89944a3a9f52d2c79c841c0b A      Code/lw1/Client/Pics/icon/lw1-icon.png

ie the "bad merge" thing (commit 228b94dd0a7aa1516eb867674cdf8c7c7b2bfd4c in your tree) will not have those four files, and the good merge (whether I use the git "recursive" or git "resolve" merge, or use "cg-merge" to do it) will always have those four files.

So I do not see how that bad commit happened, especially since it's even a fairly recent commit (the date of the merge is 2005-11-17).

I wonder if there's a really old and broken version of cogito somewhere around. If so, it's on "srsyg03".

I also went through every single merge in your tree, and apart from two merges that had merge conflicts and were fixed up by hand (and that I thus didn't check), all other merges looked ok. So as far as I can tell it's only that 228b94dd0a7aa1516eb867674cdf8c7c7b2bfd4c merge that is bad.

(And the two commits that needed manual merging _look_ fine. No lost files at least, except for one of the merges losing "bitte_bitte_loesch_mich", which judging by it's name _should_ be lost ;)

Finally: Nico, I've deleted the trees on my machine, and you can remove my 
ssh key. I don't think I can tell you anything more.
			Linus
Previous: Nico -telmich- SchotteliusNext: Petr Baudis
Message 8 of 15 in “files are disappearing in git”
  1. Nico -telmich- SchotteliusNov 23, 2005
  2. Linus TorvaldsNov 23, 2005
  3. Nico -telmich- SchotteliusNov 24, 2005
  4. Junio C HamanoNov 24, 2005
  5. Nico -telmich- SchotteliusNov 24, 2005
  6. Ryan AndersonNov 25, 2005
  7. Nico -telmich- SchotteliusNov 25, 2005
  8. Linus TorvaldsNov 25, 2005
  9. Petr BaudisNov 25, 2005
  10. Ryan AndersonNov 25, 2005
  11. Junio C HamanoNov 25, 2005
  12. Linus TorvaldsNov 25, 2005
  13. Petr BaudisNov 25, 2005
  14. Nico -telmich- SchotteliusNov 25, 2005
  15. Petr BaudisNov 25, 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.