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

Re: files are disappearing in git

From
RARyan Anderson <ryan@michonline.com>
Date
Nov 25, 2005, 19:51 UTC
Message-ID
<20051125195121.GG16995@mythryan2.michonline.com>
In-Reply-To
<Pine.LNX.4.64.0511251022360.13959@g5.osdl.org>
On Fri, Nov 25, 2005 at 11:12:00AM -0800, Linus Torvalds wrote:
Show 18 quoted lines
> 
> 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.
Can something like this sequence do it?
	git-init-db
	git add file1 ; git commit -m "1"
	(cd .. ; git clone tree1 tree2 )
	(cd .. ; git clone tree1 tree3 )
	git add file2 ; git commit -m "2"
	git push ../tree2/
	git add file3 ; git commit -m "3"
	cd ../tree3/
	git add file4
	git commit -m "4"
	cd ../tree2/
	git pull ../tree3/

The key point being that the merge is done in a tree that has its index out of sync with its HEAD (git push ../tree2/ .... git pull ../tree3/ )

I think that's the situation where I've personally managed to lose and/or revert some changes.

-- 
Ryan Anderson
  sometimes Pug Majere
Previous: Petr BaudisNext: Junio C Hamano
Message 10 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.