{"thread":{"id":"8732","subject":"git-svn error \"Unable to extract revision information from commit ...~1\"","startedAt":"2007-06-26T19:09:17Z","lastAt":"2007-06-27T20:25:43Z","messageCount":5,"participants":["Victor Bogado da Silva Lins","Steven Grimm","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"45842","messageId":"1182884957.16012.31.camel@omicron.ep.petrobras.com.br","threadId":"8732","inReplyTo":null,"subject":"git-svn error \"Unable to extract revision information from commit ...~1\"","fromName":"Victor Bogado da Silva Lins","fromEmail":"victor@bogado.net","sentAt":"2007-06-26T19:09:17Z","receivedAt":"2007-06-26T19:09:17Z","isPatch":false,"sender":{"key":"victor@bogado.net","avatar":"https://gravatar.com/avatar/4ad1d046d4c1a5673a65aac199e2113f4e2d2ffe88d095cb3e17c1f20126cfac?d=mp&s=160"},"body":"First of all, before I state the problems I am running into, I must say\nthat I loved git. It is easy to setup, since there is no need to\ninitialize a server or repository, powerful, because one can branch and\nmerge as needed something that was harder in others. And on top of\neverything it is very easy to follow up the history with gitk. :-)\n\nBut not everything are flowers in my git-life. I have to use svn to\ncommit upstream, in fact there are two different upstream svn servers. I\ntryied to maintain both coordinates using two git-svn repositories. But\nthere are ocasions that the git-svn repository gets into a state that\ndcommit simply does not work anymore. :-( \n\nThe problem seem to be that when I merge the head with another branch\ngit-svn does not know where to follow to meet the \"svn trunk\". So what\nhappens it that I have a head that was merged from a side track\ndevelopment (usually rooted on the other svn server) and then it goes to\nthe wrong side. \n\nfor instance : \n\no master (merge commit) 17696dc402da59f8eba0dcd60f15a66859cb0c2a\n|\\\n| o remotes/trunk svn head c0691ffaa3a41c6b5c13aec5b06b64f6321efd35\n| |\no | mine local modifications f1494e9bb4c237253587c1ffdc150394c6813100\n| | \n...\n\n...\n\nWhen I try to use dcommit the command fails to find the coorect path to\nmake and send the diffs. I saw that svn-git user uses git-rev-list to\nmake this path, but look at the list this command gives me : \n\n17696dc402da59f8eba0dcd60f15a66859cb0c2a\nf1494e9bb4c237253587c1ffdc150394c6813100\nc0691ffaa3a41c6b5c13aec5b06b64f6321efd35\n\nthe problem is that the last element is not a git-svn commit and the\ntool simply whants him to be son of a git-svn commit, this is the commit\nthat goes \"f1494e9bb4c237253587c1ffdc150394c6813100\", an it is not on\nthe last position as expected.\n\nGot searchs for metadata in the wrong place and \"boom\" break... I don't\nknow how to rever into a sane state, nor how can I avoid to get into\nthis situatiom, since I havo not yet found a clear reason on how this\ncame to be. \n"},{"id":"45871","messageId":"4681C27B.8040009@midwinter.com","threadId":"8732","inReplyTo":"1182884957.16012.31.camel@omicron.ep.petrobras.com.br","subject":"Re: git-svn error \"Unable to extract revision information from commit ...~1\"","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-06-27T01:50:51Z","receivedAt":"2007-06-27T01:50:51Z","isPatch":false,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"Victor Bogado da Silva Lins wrote:\n> The problem seem to be that when I merge the head with another branch\n> git-svn does not know where to follow to meet the \"svn trunk\". \n\nThe current release of git-svn doesn't support committing merges. It has \nno clue how to walk nonlinear history, as you point out. The current \npractice is to do \"git merge --squash\" when merging into the git-svn \nbranch that you want to use as the basis for your svn commit. The \n--squash option will make git merge the contents of the other branch(es) \nbut record the resulting tree as a regular commit, not as a merge.\n\nThere is a work-in-progress patch which might help you if you need to \npreserve merge ancestry on the git side. Search the mailing list \narchives for \"[PATCH] git-svn: allow dcommit to retain local merge \ninformation\" if you want to try it (but be aware that it is just an \ninitial implementation and may have bugs; it was posted so people could \ntry it out and report back any problems to the author.)\n\n-Steve\n"},{"id":"45885","messageId":"7vfy4ervdg.fsf@assigned-by-dhcp.pobox.com","threadId":"8732","inReplyTo":"4681C27B.8040009@midwinter.com","subject":"Re: git-svn error \"Unable to extract revision information from commit ...~1\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-27T02:20:27Z","receivedAt":"2007-06-27T02:20:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steven Grimm <koreth@midwinter.com> writes:\n\n> Victor Bogado da Silva Lins wrote:\n>> The problem seem to be that when I merge the head with another branch\n>> git-svn does not know where to follow to meet the \"svn trunk\".\n>\n> The current release of git-svn doesn't support committing merges. It\n> has no clue how to walk nonlinear history, as you point out. The\n> current practice is to do \"git merge --squash\" when merging into the\n> git-svn branch that you want to use as the basis for your svn\n> commit. The --squash option will make git merge the contents of the\n> other branch(es) but record the resulting tree as a regular commit,\n> not as a merge.\n>\n> There is a work-in-progress patch which might help you if you need to\n> preserve merge ancestry on the git side. Search the mailing list\n> archives for \"[PATCH] git-svn: allow dcommit to retain local merge\n> information\" if you want to try it (but be aware that it is just an\n> initial implementation and may have bugs; it was posted so people\n> could try it out and report back any problems to the author.)\n\n... which has been cooking in 'next' for the past two weeks.\n"},{"id":"45930","messageId":"468296DE.7000704@midwinter.com","threadId":"8732","inReplyTo":"1182947236.21320.3.camel@omicron.ep.petrobras.com.br","subject":"Re: git-svn error \"Unable to extract revision information from commit ...~1\"","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-06-27T16:57:02Z","receivedAt":"2007-06-27T16:57:02Z","isPatch":false,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"Victor Bogado da Silva Lins wrote:\n> I will try that, but on the other hand is it possible to commit the \n> diff between my head and the svn head with a new message? This would \n> be good enough for me.\n\nYes, that's pretty easy; you just have to do a squash merge to eliminate \nthe nonlinear history. Assuming the svn head is called \"trunk\" and your \nhead is called \"myhead\":\n\n# start with the svn head\ngit checkout -b trunk tempbranch\n# bring in all the changes from your branch\ngit merge --squash myhead\n# commit with whatever message you want\ngit commit\n# and ship it up to svn land\ngit svn dcommit\n\n-Steve\n"},{"id":"45936","messageId":"4682C7C7.7050603@midwinter.com","threadId":"8732","inReplyTo":"e2a1d0aa0706271031n3191a27fi41ca5ba3f14c3a51@mail.gmail.com","subject":"Re: git-svn error \"Unable to extract revision information from commit ...~1\"","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-06-27T20:25:43Z","receivedAt":"2007-06-27T20:25:43Z","isPatch":false,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"Patrick Doyle wrote:\n> Wouldn't the svn head be called \"git-svn\"?\n> Should the first checkout be written as:\n>\n> git checkout -b tempbranch git-svn\n>\n> (In other words, were the \"trunk\" and \"tempbranch\" arguments swapped\n> in your example?)\n\nYes, sorry, I swapped the arguments. Should indeed be \"git checkout -b \n(your new branch name) (svn head branch name)\" rather than the other way \naround. My apologies for not proofreading my message.\n\nHowever, the name of the svn head branch depends on the version of \ngit-svn you're using, and how you cloned the svn repository. If you used \nthe -T/--trunk option, then the svn head branch will indeed be called \n\"trunk\" (and you might also have other branches corresponding to \nwhatever branches you're tracking in the svn repository.) If you're not \nusing that option, then your svn tracking branch will be called \n\"git-svn\" or \"origin\" depending on your git-svn version.\n\n> Finally, what is the purpose of creating a new branch as part of that \n> command?\n\nYou never ever want to work directly on the git-svn tracking branch. It \nis considered a remote branch and while it is technically possible to \ncheck it out and commit to it, you will almost certainly confuse git-svn \nif you do.\n\nAlso, creating a new branch means you still have your original nonlinear \nhistory easily accessible if you need it (just check out your old \nbranch.) You can certainly still get at the old history without creating \na new branch, but it's more awkward.\n\n-Steve\n"}]}