{"thread":{"id":"5325","subject":"Recover from a bad push in StGit","startedAt":"2006-08-18T22:30:46Z","lastAt":"2006-08-21T15:55:28Z","messageCount":5,"participants":["Robin Rosenberg","Catalin Marinas"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"25592","messageId":"200608190030.47257.robin.rosenberg.lists@dewire.com","threadId":"5325","inReplyTo":null,"subject":"Recover from a bad push in StGit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-08-18T22:30:46Z","receivedAt":"2006-08-18T22:30:46Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Hi,\n\nI recently did some reordering of patches and goofed up (not totally, but \nanyway). I pushed a number of patches and forgot one in the middle resulting \nin a merge  conflict. Pop won't work since I have local changes from the \nconflict and I don't want to resolve the conflict either since I didn't mean \nto push the patch at that point.\n\nIs there a simple way of undoing a bad push? \n\nIn this case I had a fresh export do help me out so I could just delete the \npatches and re-import them again, but what if I didn't?\n\n-- robin\n"},{"id":"25594","messageId":"200608190211.29625.robin.rosenberg.lists@dewire.com","threadId":"5325","inReplyTo":"200608190030.47257.robin.rosenberg.lists@dewire.com","subject":"Re: Recover from a bad push in StGit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-08-19T00:11:28Z","receivedAt":"2006-08-19T00:11:28Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"lördag 19 augusti 2006 00:30 skrev Robin Rosenberg:\n> Hi,\n>\n> I recently did some reordering of patches and goofed up (not totally, but\n> anyway). I pushed a number of patches and forgot one in the middle\n> resulting in a merge  conflict. Pop won't work since I have local changes\n> from the conflict and I don't want to resolve the conflict either since I\n> didn't mean to push the patch at that point.\n>\n> Is there a simple way of undoing a bad push?\nIt was so simple\n\n\tstg status --reset;stg pop\n\ndoes the job. Sorry about the noise.\n\n>\n> In this case I had a fresh export do help me out so I could just delete the\n> patches and re-import them again, but what if I didn't?\n>\n\n-- robin\n"},{"id":"25682","messageId":"tnxk652torl.fsf@arm.com","threadId":"5325","inReplyTo":"200608190030.47257.robin.rosenberg.lists@dewire.com","subject":"Re: Recover from a bad push in StGit","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@arm.com","sentAt":"2006-08-21T09:35:26Z","receivedAt":"2006-08-21T09:35:26Z","isPatch":false,"sender":{"key":"catalin.marinas@arm.com","avatar":null},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:\n> I recently did some reordering of patches and goofed up (not totally, but \n> anyway). I pushed a number of patches and forgot one in the middle resulting \n> in a merge  conflict. Pop won't work since I have local changes from the \n> conflict and I don't want to resolve the conflict either since I didn't mean \n> to push the patch at that point.\n>\n> Is there a simple way of undoing a bad push? \n>\n> In this case I had a fresh export do help me out so I could just delete the \n> patches and re-import them again, but what if I didn't?\n\n\"stg push --undo\" (the same option for \"refresh\"; maybe I should add a\nseparate \"undo\" command) resets the local changes and it restores the\noriginal boundaries of the patch (no information is lost). You could\nuse the latest snapshot as it has some bug-fixes from release 0.10.\n\n-- \nCatalin\n"},{"id":"25688","messageId":"200608211703.59873.robin.rosenberg.lists@dewire.com","threadId":"5325","inReplyTo":"tnxk652torl.fsf@arm.com","subject":"Re: Recover from a bad push in StGit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-08-21T15:03:59Z","receivedAt":"2006-08-21T15:03:59Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"måndag 21 augusti 2006 11:35 skrev Catalin Marinas:\n> Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:\n> > I recently did some reordering of patches and goofed up (not totally, but\n> > anyway). I pushed a number of patches and forgot one in the middle\n> > resulting in a merge  conflict. Pop won't work since I have local changes\n> > from the conflict and I don't want to resolve the conflict either since I\n> > didn't mean to push the patch at that point.\n> >\n> > Is there a simple way of undoing a bad push?\n> >\n> > In this case I had a fresh export do help me out so I could just delete\n> > the patches and re-import them again, but what if I didn't?\n>\n> \"stg push --undo\" (the same option for \"refresh\"; maybe I should add a\n> separate \"undo\" command) resets the local changes and it restores the\nNot necessarily, but a hint about --undo when push/pop fail would have\nhelped me.\n\n> original boundaries of the patch (no information is lost). You could\n> use the latest snapshot as it has some bug-fixes from release 0.10.\n\nDoes refresh --undo make me see the state of the patch like it was before last \nrefresh, ie. stgit remembers the history of my patces? I thought it dropped \nthe references as obsolete.\n\n-- robin\n"},{"id":"25693","messageId":"b0943d9e0608210855m71c29a21y3d4941ec721e0737@mail.gmail.com","threadId":"5325","inReplyTo":"200608211703.59873.robin.rosenberg.lists@dewire.com","subject":"Re: Recover from a bad push in StGit","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2006-08-21T15:55:28Z","receivedAt":"2006-08-21T15:55:28Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 21/08/06, Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:\n> måndag 21 augusti 2006 11:35 skrev Catalin Marinas:\n> > \"stg push --undo\" (the same option for \"refresh\"; maybe I should add a\n> > separate \"undo\" command) resets the local changes and it restores the\n> Not necessarily, but a hint about --undo when push/pop fail would have\n> helped me.\n\nIt is in the \"stg help push\" output but I could just display it when\nthe conflict happened.\n\n> > original boundaries of the patch (no information is lost). You could\n> > use the latest snapshot as it has some bug-fixes from release 0.10.\n>\n> Does refresh --undo make me see the state of the patch like it was before last\n> refresh, ie. stgit remembers the history of my patces? I thought it dropped\n> the references as obsolete.\n\nThe references before the last command are stored and they can be\nobtained by \"stg id <patch>//(bottom|top).old\". As long as you haven't\nrun a git prune on your repository, you should be able to undo the\nrefresh.\n\nI'm (slowly) working on patch history support using reflogs and (when\nready) you should be able to retrieve a previous state of the patch as\nlong as you haven't pruned your GIT repository.\n\n-- \nCatalin\n"}]}