{"thread":{"id":"8175","subject":"Losing branches (whee, data loss)","startedAt":"2007-05-16T05:18:04Z","lastAt":"2007-05-16T07:36:39Z","messageCount":10,"participants":["Jeff Garzik","Lars Hjemli","Junio C Hamano","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"42284","messageId":"464A940C.3080906@garzik.org","threadId":"8175","inReplyTo":null,"subject":"Losing branches (whee, data loss)","fromName":"Jeff Garzik","fromEmail":"jeff@garzik.org","sentAt":"2007-05-16T05:18:04Z","receivedAt":"2007-05-16T05:18:04Z","isPatch":false,"sender":{"key":"jeff@garzik.org","avatar":null},"body":"Grumble!\n\nWhen all this started, the branch 'upstream-fixes' exists, and branch \n'tmp' does not exist.  This is my local clone of \ngit://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git\n\n\n[jgarzik@pretzel libata-dev]$ git branch -m upstream-fixes tmp\nerror: Could not open config file!\nfatal: Branch rename failed\n\n[jgarzik@pretzel libata-dev]$ git-branch -m upstream-fixes tmp\nfatal: A branch named 'tmp' already exists.\n\n[jgarzik@pretzel libata-dev]$ git branch -D tmp\nDeleted branch tmp.\n\n[jgarzik@pretzel libata-dev]$ git-branch -m upstream-fixes tmp\nerror: refname refs/heads/upstream-fixes not found\nfatal: Branch rename failed\n"},{"id":"42286","messageId":"8c5c35580705152248w254e4201w65da1e1ad229f6ee@mail.gmail.com","threadId":"8175","inReplyTo":"464A940C.3080906@garzik.org","subject":"Re: Losing branches (whee, data loss)","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-05-16T05:48:07Z","receivedAt":"2007-05-16T05:48:07Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On 5/16/07, Jeff Garzik <jeff@garzik.org> wrote:\n> [jgarzik@pretzel libata-dev]$ git branch -m upstream-fixes tmp\n> error: Could not open config file!\n> fatal: Branch rename failed\n\nThis should have been fixed in v1.5.1.1, what version do you run?\n\n\n> [jgarzik@pretzel libata-dev]$ git-branch -m upstream-fixes tmp\n> fatal: A branch named 'tmp' already exists.\n>\n> [jgarzik@pretzel libata-dev]$ git branch -D tmp\n> Deleted branch tmp.\n\nCould you try to run \"git log -g\" and see if it finds your lost branch?\n\n\n-- \nlarsh\n"},{"id":"42288","messageId":"464A9C9B.70904@garzik.org","threadId":"8175","inReplyTo":"8c5c35580705152248w254e4201w65da1e1ad229f6ee@mail.gmail.com","subject":"Re: Losing branches (whee, data loss)","fromName":"Jeff Garzik","fromEmail":"jeff@garzik.org","sentAt":"2007-05-16T05:54:35Z","receivedAt":"2007-05-16T05:54:35Z","isPatch":false,"sender":{"key":"jeff@garzik.org","avatar":null},"body":"Lars Hjemli wrote:\n> On 5/16/07, Jeff Garzik <jeff@garzik.org> wrote:\n>> [jgarzik@pretzel libata-dev]$ git branch -m upstream-fixes tmp\n>> error: Could not open config file!\n>> fatal: Branch rename failed\n> \n> This should have been fixed in v1.5.1.1, what version do you run?\n\n[jgarzik@core ~]$ rpm -q git-core\ngit-core-1.5.0.6-1.fc6\n\n\n>> [jgarzik@pretzel libata-dev]$ git-branch -m upstream-fixes tmp\n>> fatal: A branch named 'tmp' already exists.\n>>\n>> [jgarzik@pretzel libata-dev]$ git branch -D tmp\n>> Deleted branch tmp.\n> \n> Could you try to run \"git log -g\" and see if it finds your lost branch?\n\nDoesn't seem to..\n\nThanks,\n\n\tJeff\n"},{"id":"42289","messageId":"7vtzudfgam.fsf@assigned-by-dhcp.cox.net","threadId":"8175","inReplyTo":"464A940C.3080906@garzik.org","subject":"Re: Losing branches (whee, data loss)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-16T06:12:17Z","receivedAt":"2007-05-16T06:12:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff Garzik <jeff@garzik.org> writes:\n\n> Grumble!\n>\n> When all this started, the branch 'upstream-fixes' exists, and branch\n> 'tmp' does not exist.  This is my local clone of\n> git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git\n>\n> [jgarzik@pretzel libata-dev]$ git branch -m upstream-fixes tmp\n> error: Could not open config file!\n> fatal: Branch rename failed\n\nSorry to hear that.\n\nWe used to have a problem with \"branch -m\" when you did not have\na .git/config file (or it was unwritable).  I think 1.5.0.X\nseries and 1.5.1 release had this bug; 1.5.1.1 and later should\nhave the appropriate fix.\n\nWas this really a \"whee, data loss\", I wonder...?\n"},{"id":"42294","messageId":"20070516061449.GA25273@artax.karlin.mff.cuni.cz","threadId":"8175","inReplyTo":"464A9C9B.70904@garzik.org","subject":"Re: Losing branches (whee, data loss)","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-05-16T06:14:49Z","receivedAt":"2007-05-16T06:14:49Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Wed, May 16, 2007 at 01:54:35AM -0400, Jeff Garzik wrote:\n> Lars Hjemli wrote:\n> >On 5/16/07, Jeff Garzik <jeff@garzik.org> wrote:\n> >>[jgarzik@pretzel libata-dev]$ git branch -m upstream-fixes tmp\n> >>error: Could not open config file!\n> >>fatal: Branch rename failed\n> >\n> >This should have been fixed in v1.5.1.1, what version do you run?\n> \n> [jgarzik@core ~]$ rpm -q git-core\n> git-core-1.5.0.6-1.fc6\n> \n> \n> >>[jgarzik@pretzel libata-dev]$ git-branch -m upstream-fixes tmp\n> >>fatal: A branch named 'tmp' already exists.\n> >>\n> >>[jgarzik@pretzel libata-dev]$ git branch -D tmp\n> >>Deleted branch tmp.\n> >\n> >Could you try to run \"git log -g\" and see if it finds your lost branch?\n> \n> Doesn't seem to..\n\nAnd does the .git/logs/refs/heads/upstream-fixes still exist?\n\nIf it does, than revspec upstream-fixes@{1} would still work, so you can\ncheck it out, re-create the branch and update the ref (git update-ref).\n\nIf it does not, as last resort you'd have to git fsck --unreachable\n(this gives you all things that are not reachable from any ref), filter\nout only commit objects and than remember which one should have been on\nthat branch after reading it's log, date and changes.\n\n--------------------------------------------------------------------------------\n                  \t\t\t\t- Jan Hudec `Bulb' <bulb@ucw.cz>\n"},{"id":"42293","messageId":"464AA749.90101@garzik.org","threadId":"8175","inReplyTo":"7vtzudfgam.fsf@assigned-by-dhcp.cox.net","subject":"Re: Losing branches (whee, data loss)","fromName":"Jeff Garzik","fromEmail":"jeff@garzik.org","sentAt":"2007-05-16T06:40:09Z","receivedAt":"2007-05-16T06:40:09Z","isPatch":false,"sender":{"key":"jeff@garzik.org","avatar":null},"body":"Junio C Hamano wrote:\n> Jeff Garzik <jeff@garzik.org> writes:\n> \n>> Grumble!\n>>\n>> When all this started, the branch 'upstream-fixes' exists, and branch\n>> 'tmp' does not exist.  This is my local clone of\n>> git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git\n>>\n>> [jgarzik@pretzel libata-dev]$ git branch -m upstream-fixes tmp\n>> error: Could not open config file!\n>> fatal: Branch rename failed\n> \n> Sorry to hear that.\n> \n> We used to have a problem with \"branch -m\" when you did not have\n> a .git/config file (or it was unwritable).  I think 1.5.0.X\n> series and 1.5.1 release had this bug; 1.5.1.1 and later should\n> have the appropriate fix.\n\nUsing the latest version from Fedora Extras: git-core-1.5.0.6-1.fc6\n\n\n> Was this really a \"whee, data loss\", I wonder...?\n\nThe branches definitely went away.  The sha1-indexed commits are \nprobably still there...\n\n\tJeff\n"},{"id":"42295","messageId":"464AA773.3090808@garzik.org","threadId":"8175","inReplyTo":"20070516061449.GA25273@artax.karlin.mff.cuni.cz","subject":"Re: Losing branches (whee, data loss)","fromName":"Jeff Garzik","fromEmail":"jeff@garzik.org","sentAt":"2007-05-16T06:40:51Z","receivedAt":"2007-05-16T06:40:51Z","isPatch":false,"sender":{"key":"jeff@garzik.org","avatar":null},"body":"Jan Hudec wrote:\n> And does the .git/logs/refs/heads/upstream-fixes still exist?\n\nNope.\n\n\n> If it does not, as last resort you'd have to git fsck --unreachable\n> (this gives you all things that are not reachable from any ref), filter\n> out only commit objects and than remember which one should have been on\n> that branch after reading it's log, date and changes.\n\nYeah, that will probably recover it.  I wound up digging the emails out \nof the trash bin, and applying them again.\n\n\tJeff\n"},{"id":"42296","messageId":"7viratfev8.fsf@assigned-by-dhcp.cox.net","threadId":"8175","inReplyTo":"464AA773.3090808@garzik.org","subject":"Re: Losing branches (whee, data loss)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-16T06:43:07Z","receivedAt":"2007-05-16T06:43:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff Garzik <jeff@garzik.org> writes:\n\n> Jan Hudec wrote:\n>> And does the .git/logs/refs/heads/upstream-fixes still exist?\n>\n> Nope.\n>\n>\n>> If it does not, as last resort you'd have to git fsck --unreachable\n>> (this gives you all things that are not reachable from any ref), filter\n>> out only commit objects and than remember which one should have been on\n>> that branch after reading it's log, date and changes.\n>\n> Yeah, that will probably recover it.  I wound up digging the emails\n> out of the trash bin, and applying them again.\n\nAh, sorry to hear that.  Trying to rename and lost both old and\nnew -- that is bad.\n"},{"id":"42298","messageId":"8c5c35580705160010s506b6f53y4209c1b541c3112a@mail.gmail.com","threadId":"8175","inReplyTo":"464AA773.3090808@garzik.org","subject":"Re: Losing branches (whee, data loss)","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-05-16T07:10:28Z","receivedAt":"2007-05-16T07:10:28Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On 5/16/07, Jeff Garzik <jeff@garzik.org> wrote:\n> Jan Hudec wrote:\n> > And does the .git/logs/refs/heads/upstream-fixes still exist?\n>\n> Nope.\n>\n>\n> > If it does not, as last resort you'd have to git fsck --unreachable\n> > (this gives you all things that are not reachable from any ref), filter\n> > out only commit objects and than remember which one should have been on\n> > that branch after reading it's log, date and changes.\n>\n> Yeah, that will probably recover it.  I wound up digging the emails out\n> of the trash bin, and applying them again.\n>\n\nThat's bad.\n\nJust out of curiosity: do you get any output from 'git log RENAMED-REF'?\n\n--\nlarsh\n"},{"id":"42301","messageId":"7vejlhfce0.fsf@assigned-by-dhcp.cox.net","threadId":"8175","inReplyTo":"8c5c35580705160010s506b6f53y4209c1b541c3112a@mail.gmail.com","subject":"Re: Losing branches (whee, data loss)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-16T07:36:39Z","receivedAt":"2007-05-16T07:36:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Lars Hjemli\" <hjemli@gmail.com> writes:\n\n> On 5/16/07, Jeff Garzik <jeff@garzik.org> wrote:\n>> Jan Hudec wrote:\n>> > And does the .git/logs/refs/heads/upstream-fixes still exist?\n>>\n>> Nope.\n>>\n>>\n>> > If it does not, as last resort you'd have to git fsck --unreachable\n>> > (this gives you all things that are not reachable from any ref), filter\n>> > out only commit objects and than remember which one should have been on\n>> > that branch after reading it's log, date and changes.\n>>\n>> Yeah, that will probably recover it.  I wound up digging the emails out\n>> of the trash bin, and applying them again.\n>>\n>\n> That's bad.\n>\n> Just out of curiosity: do you get any output from 'git log RENAMED-REF'?\n\nAnother probably easier way to recover them would be 'git\nlost-found'.\n"}]}