{"thread":{"id":"19364","subject":"git svn rebase problem","startedAt":"2009-05-15T21:21:09Z","lastAt":"2009-05-19T00:56:08Z","messageCount":6,"participants":["David H. Lynch J.r","Avery Pennarun","John Tapsell","Matthias Andree","Miles Bader"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"114038","messageId":"4A0DDCC5.4010001@dlasys.net","threadId":"19364","inReplyTo":null,"subject":"git svn rebase problem","fromName":"David H. Lynch J.r","fromEmail":"ml@dlasys.net","sentAt":"2009-05-15T21:21:09Z","receivedAt":"2009-05-15T21:21:09Z","isPatch":false,"sender":{"key":"ml@dlasys.net","avatar":null},"body":"For some time I am using git svn to manage a local copy of a remote svn\nrepository.\n\nThe svn repository has no branches.\n\nA few days ago I did an\ngit svn rebase\n\nThe rebase took a while and after it completed reported\nfatal: bad object HEAD\n\ngit status reports\nroot@hp-dhlii:/usr/src/pico/git# git status\n# Not currently on any branch.\nfatal: bad object HEAD\n\nand git fsck reports\nroot@hp-dhlii:/usr/src/pico/git# git fsck\ndangling blob eb3afb4aa3aaf0003bac601a5db4fd76aafa2a87\ndangling commit 5c496db25007c17c325f294bb8324097c9bc407d\n\nHow can I recover without downloading the entire repository again which\ncould take days?\n"},{"id":"114045","messageId":"32541b130905151653u436f3c5cwcf1d896c96148efa@mail.gmail.com","threadId":"19364","inReplyTo":"4A0DDCC5.4010001@dlasys.net","subject":"Re: git svn rebase problem","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-05-15T23:53:31Z","receivedAt":"2009-05-15T23:53:31Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Fri, May 15, 2009 at 5:21 PM, David H. Lynch J.r <ml@dlasys.net> wrote:\n> A few days ago I did an\n> git svn rebase\n>\n> The rebase took a while and after it completed reported\n> fatal: bad object HEAD\n>\n> git status reports\n> root@hp-dhlii:/usr/src/pico/git# git status\n> # Not currently on any branch.\n> fatal: bad object HEAD\n>\n> and git fsck reports\n> root@hp-dhlii:/usr/src/pico/git# git fsck\n> dangling blob eb3afb4aa3aaf0003bac601a5db4fd76aafa2a87\n> dangling commit 5c496db25007c17c325f294bb8324097c9bc407d\n>\n> How can I recover without downloading the entire repository again which\n> could take days?\n\nI don't know how this would happen; it would be great if you could\nfind reproduction steps and send them in, or if you had the complete\ngit rebase log, some of which probably explains the problem.\n\nYou can probably recover your pre-rebased repository using 'git\nreflog'.  Look through the reflog to find the commit you want, then do\nsomething like\n\n    git checkout whatever-the-commit-id-was-that-you-got-from-git-reflog\n\nand then optionally\n\n    git checkout -b master\n\nGood luck.\n\nAvery\n"},{"id":"114059","messageId":"43d8ce650905152052w351f7766p3f7a4528c714c049@mail.gmail.com","threadId":"19364","inReplyTo":"32541b130905151653u436f3c5cwcf1d896c96148efa@mail.gmail.com","subject":"Re: git svn rebase problem","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-05-16T03:52:08Z","receivedAt":"2009-05-16T03:52:08Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/5/16 Avery Pennarun <apenwarr@gmail.com>:\n> On Fri, May 15, 2009 at 5:21 PM, David H. Lynch J.r <ml@dlasys.net> wrote:\n>> A few days ago I did an\n>> git svn rebase\n>>\n>> The rebase took a while and after it completed reported\n>> fatal: bad object HEAD\n\nWe had this come up about once a week when using http as the\ntransport.  After switching most people over to ssh the problems\ndisappeared.  We never managed to find out why.\n\n>> git status reports\n>> root@hp-dhlii:/usr/src/pico/git# git status\n>> # Not currently on any branch.\n>> fatal: bad object HEAD\n>>\n>> and git fsck reports\n>> root@hp-dhlii:/usr/src/pico/git# git fsck\n>> dangling blob eb3afb4aa3aaf0003bac601a5db4fd76aafa2a87\n>> dangling commit 5c496db25007c17c325f294bb8324097c9bc407d\n>>\n>> How can I recover without downloading the entire repository again which\n>> could take days?\n>\n> I don't know how this would happen; it would be great if you could\n> find reproduction steps and send them in, or if you had the complete\n> git rebase log, some of which probably explains the problem.\n>\n> You can probably recover your pre-rebased repository using 'git\n> reflog'.  Look through the reflog to find the commit you want, then do\n> something like\n>\n>    git checkout whatever-the-commit-id-was-that-you-got-from-git-reflog\n>\n> and then optionally\n>\n>    git checkout -b master\n>\n> Good luck.\n>\n> Avery\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"114168","messageId":"op.ut4aagco1e62zd@merlin.emma.line.org","threadId":"19364","inReplyTo":"4A0DDCC5.4010001@dlasys.net","subject":"Re: git svn rebase problem","fromName":"Matthias Andree","fromEmail":"matthias.andree@gmx.de","sentAt":"2009-05-18T08:38:30Z","receivedAt":"2009-05-18T08:38:30Z","isPatch":false,"sender":{"key":"matthias.andree@gmx.de","avatar":null},"body":"Am 15.05.2009, 23:21 Uhr, schrieb David H. Lynch J.r <ml@dlasys.net>:\n\n> For some time I am using git svn to manage a local copy of a remote svn\n> repository.\n>\n> The svn repository has no branches.\n>\n> A few days ago I did an\n> git svn rebase\n>\n> The rebase took a while and after it completed reported\n> fatal: bad object HEAD\n>\n> git status reports\n> root@hp-dhlii:/usr/src/pico/git# git status\n> # Not currently on any branch.\n> fatal: bad object HEAD\n>\n> and git fsck reports\n> root@hp-dhlii:/usr/src/pico/git# git fsck\n> dangling blob eb3afb4aa3aaf0003bac601a5db4fd76aafa2a87\n> dangling commit 5c496db25007c17c325f294bb8324097c9bc407d\n>\n> How can I recover without downloading the entire repository again which\n> could take days?\n\nHave you been working on a branch other than the one that git-svn created  \nfor you? If so, you may have to \"git checkout\" the original branch before  \nbeing able to \"git svn rebase\".\n\nBranches and git-svn don't mix.\n\n-- \nMatthias Andree\n"},{"id":"114194","messageId":"32541b130905181000v34d5fd6arcb662bff232cb81c@mail.gmail.com","threadId":"19364","inReplyTo":"op.ut4aagco1e62zd@merlin.emma.line.org","subject":"Re: git svn rebase problem","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-05-18T17:00:25Z","receivedAt":"2009-05-18T17:00:25Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Mon, May 18, 2009 at 4:38 AM, Matthias Andree <matthias.andree@gmx.de> wrote:\n> Have you been working on a branch other than the one that git-svn created\n> for you? If so, you may have to \"git checkout\" the original branch before\n> being able to \"git svn rebase\".\n>\n> Branches and git-svn don't mix.\n\nThat's not exactly true: merging and git-svn don't mix.  But rebasing\nworks fine.\n\nIf you have a separate branch and do 'git svn rebase', then as far as\nI know, the original git-svn branch(es) will get updated to the latest\nversion from svn, and then your current branch will be rebased on top\nof it.  This is often what you want, unless you've been using 'git\nmerge' from that branch.  Rebasing (unless you know exactly what\nyou're doing) always messes up git merge.\n\nHave fun,\n\nAvery\n"},{"id":"114219","messageId":"buobpppq5av.fsf@dhlpc061.dev.necel.com","threadId":"19364","inReplyTo":"32541b130905181000v34d5fd6arcb662bff232cb81c@mail.gmail.com","subject":"Re: git svn rebase problem","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2009-05-19T00:56:08Z","receivedAt":"2009-05-19T00:56:08Z","isPatch":false,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Avery Pennarun <apenwarr@gmail.com> writes:\n>> Branches and git-svn don't mix.\n>\n> That's not exactly true: merging and git-svn don't mix.  But rebasing\n> works fine.\n\nI've given up on trying to maintain rigid consistency with svn --\ngit-svn's constant rebasing is just too painful -- and just cherry-pick\neverything between my \"svn\" branch and master, and use master in\nconjunction with better-behaved git-only branches.  I often end up with\nthe same commits in a different order on the two branches, but oh well,\nnot much to do about that I suppose.\n\nThis means I often end up cherry-picking long sequences of commits, and\nneed to deal with conflicts in these cp-sequences.  For this reason, I\noften wish cherry-pick supported all the fancy features of rebase\n(multiple commits, nice handling of conflicts, -i, etc) -- after all\nrebasing is really just a special case of cherry-picking.\n\n[I've tried on a shell-script implementation of such an extended\ncherry-pick, but soooo many little corner cases to deal with... maybe\nit'd be easier to try and generalize git-rebase...?]\n\n-Miles\n\n-- \nConservative, n. A statesman enamored of existing evils, as opposed to a\nLiberal, who wants to replace them with new ones.\n"}]}