{"thread":{"id":"8334","subject":"svn-cp equivalent for history on a single file from a git-svn user.","startedAt":"2007-05-27T10:14:30Z","lastAt":"2007-05-28T00:41:43Z","messageCount":2,"participants":["Robin H. Johnson","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"43401","messageId":"20070527101430.GA27013@curie-int.orbis-terrarum.net","threadId":"8334","inReplyTo":null,"subject":"svn-cp equivalent for history on a single file from a git-svn user.","fromName":"Robin H. Johnson","fromEmail":"robbat2@gentoo.org","sentAt":"2007-05-27T10:14:30Z","receivedAt":"2007-05-27T10:14:30Z","isPatch":false,"sender":{"key":"robbat2@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/373898?v=4"},"body":"Not a problem I ran into directly, but fellow Gentoo developer did\n(CC'd), and I couldn't find a reasonable answer as the person that they\nwere asking hard Git questions of (I _think_ I saw it somewhere on the\nweb before, but I can't find it atm).\n\nI'm personally a CVS and then Git guy, with SVN usage as a distant\nrelative. I wouldn't personally host a project in SVN [and I find\ngit-svn to be a miracle-worker in helping me out].\n\nSome rough problem background:\n- They have a SVN repo, with a few areas under trunk. Relevant to us are\n  'submitted' and 'reviewed'. Under each, the unique content is in\n  directories that are treated as single units.\n- It is normal to have both portions checked out at once.\n- There are users that can put stuff into the 'submitted' portion.\n- There are a subset of users that can commit stuff to 'reviewed'.\n- The reviewer subset of users is orthogonal to the people that can\n  commit to 'reviewed'.\n- $Header$ expansion is disabled in the SVN repo.\n- Git v1.5.1.4\n\nProblem:\nThe Git docs say to use plain 'cp' where svn-cp would be used, as Git\ndetects copies after-the-fact. However, doing so in Git does not appear\nto sanely preserve the history in Git, or when the files are committed\nback to the SVN tree (git-svn dcommit).\n\nHere's an example of their process done purely with SVN.\n('submitted' = sunrise).\nhttp://overlays.gentoo.org/proj/sunrise/changeset/3687\nSpecifically of interest are the portions that have '(copied from\n$OLDPATH)'\n'svn log' produces this output:\nhttp://rafb.net/p/bETJkV31.html\nThe bottom two entries are relevant to the file in it's location inside\nthe 'submitted' tree, and were copied to the history in the 'reviewed'\ntree.\n\nHere's the same thing, done with plain cp per the Git documentation.\nThe files that previously showed 'copied from ...' just show up as new,\nand their history has remained separate.\nhttp://overlays.gentoo.org/proj/sunrise/changeset/3687\n\nIf one looks at the SVN log between the two styles on a file that is\nnewly added, the SVN case includes the history of the file in the old\nlocation, whereas Git does not. Git only has the commit that introduced\nit at it's present location.\n\n'svn-cp' revision list:\nhttp://overlays.gentoo.org/proj/sunrise/log/reviewed/app-admin/blockhosts/blockhosts-2.0.3.ebuild?rev=3687\n\n'git using plain cp' revision list:\nhttp://overlays.gentoo.org/proj/sunrise/log/reviewed/dev-libs/dswifi/dswifi-0.3.1.ebuild?rev=3749\nGit SHOULD have included this history:\nhttp://overlays.gentoo.org/proj/sunrise/log/sunrise/dev-libs/dswifi/dswifi-0.3.1.ebuild?rev=3749\n\nWhile researching this for the other guy, I notice a related defect in\nSVN's svn-cp implementation, but pertaining to existing files.\n- The actions of 'svn-cp' that create a new file copy the existing\n  history.\n- The actions of 'svn-cp' that do NOT create a new file only applies the\n  changes as a single commit, without copying any history.\n\nThinking about the problem from the perspective of what it's supposed to\ndo, I think the correct action in BOTH cases would be to take the\nportions of both commits that lead to the present state of the file in\n'submitted', and tell Git that they are relevant to the history of the\nfile in 'reviewed'. As to how best to go about this, I'm not certain.\n\n-- \nRobin Hugh Johnson\nGentoo Linux Developer & Council Member\nE-Mail     : robbat2@gentoo.org\nGnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85\n"},{"id":"43478","messageId":"f3d86i$p5s$1@sea.gmane.org","threadId":"8334","inReplyTo":"20070527101430.GA27013@curie-int.orbis-terrarum.net","subject":"Re: svn-cp equivalent for history on a single file from a git-svn user.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-05-28T00:41:43Z","receivedAt":"2007-05-28T00:41:43Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Robin H. Johnson wrote:\n\n> The Git docs say to use plain 'cp' where svn-cp would be used, as Git\n> detects copies after-the-fact.\n\nBut I think you need to _request_ detecting copies with '-C' option.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}