{"thread":{"id":"6695","subject":"replacing a bad commit","startedAt":"2007-02-05T15:39:49Z","lastAt":"2007-02-05T20:58:53Z","messageCount":8,"participants":["Blu Corater","Jakub Narebski","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"33638","messageId":"20070205153949.GT14499@daga.cl","threadId":"6695","inReplyTo":null,"subject":"replacing a bad commit","fromName":"Blu Corater","fromEmail":"blu@daga.cl","sentAt":"2007-02-05T15:39:49Z","receivedAt":"2007-02-05T15:39:49Z","isPatch":false,"sender":{"key":"blu@daga.cl","avatar":null},"body":"Hello,\n\nHere is the situation. Upstream realeses tarballs once in a while. I\nmaintain local modifications. Every time upstream releases a tarball, I\nfast forward the 'upstream' branch, and merge into 'local' branch. My\ntree, currently, looks somewhat like this:\n\n               o---o---o <--topic2\n               |\n               |  o---o---o <--topic1\n               | /\n   o---o---C---A---o---o <--local\n  /   /   /  \n /   /   /\no---o---o---B <--upstream\n\nProblem is, B should have been merged into 'local', at A, but I just\nrealized it wasn't (probably due to my own stupidity).\n\nI need to correct A, i.e. merge with B, but keeping the branches already\nin flux, and propagating the changes due to the merge to them. In short,\nreplace A with a properly merged A'.\n\nI tried branching from C and merging with B, then rebasing topic branches,\nbut then I am not sure how to rebase 'local'to eliminate A.\n\nThanks in advance for any help.\n\n-- \nBlu.\n"},{"id":"33640","messageId":"eq7mf0$lb0$1@sea.gmane.org","threadId":"6695","inReplyTo":"20070205153949.GT14499@daga.cl","subject":"Re: replacing a bad commit","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-05T16:38:18Z","receivedAt":"2007-02-05T16:38:18Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Blu Corater wrote:\n\n> Here is the situation. Upstream realeses tarballs once in a while. I\n> maintain local modifications. Every time upstream releases a tarball, I\n> fast forward the 'upstream' branch, and merge into 'local' branch. My\n> tree, currently, looks somewhat like this:\n> \n>                o---o---o <--topic2\n>                |\n>                |  o---o---o <--topic1\n>                | /\n>    o---o---C---A---o---o <--local\n>   /   /   /  \n>  /   /   /\n> o---o---o---B <--upstream\n> \n> Problem is, B should have been merged into 'local', at A, but I just\n> realized it wasn't (probably due to my own stupidity).\n> \n> I need to correct A, i.e. merge with B, but keeping the branches already\n> in flux, and propagating the changes due to the merge to them. In short,\n> replace A with a properly merged A'.\n> \n> I tried branching from C and merging with B, then rebasing topic branches,\n> but then I am not sure how to rebase 'local'to eliminate A.\n\nTry using\n\n  $ git rebase --onto A' A local\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"33655","messageId":"20070205195332.GW14499@daga.cl","threadId":"6695","inReplyTo":"eq7mf0$lb0$1@sea.gmane.org","subject":"Re: replacing a bad commit","fromName":"Blu Corater","fromEmail":"blu@daga.cl","sentAt":"2007-02-05T19:53:32Z","receivedAt":"2007-02-05T19:53:32Z","isPatch":false,"sender":{"key":"blu@daga.cl","avatar":null},"body":"On Mon, Feb 05, 2007 at 05:38:18PM +0100, Jakub Narebski wrote:\n> Blu Corater wrote:\n> \n> > Here is the situation. Upstream realeses tarballs once in a while. I\n> > maintain local modifications. Every time upstream releases a tarball, I\n> > fast forward the 'upstream' branch, and merge into 'local' branch. My\n> > tree, currently, looks somewhat like this:\n> > \n> >                o---o---o <--topic2\n> >                |\n> >                |  o---o---o <--topic1\n> >                | /\n> >    o---o---C---A---o---o <--local\n> >   /   /   /  \n> >  /   /   /\n> > o---o---o---B <--upstream\n> > \n> > Problem is, B should have been merged into 'local', at A, but I just\n> > realized it wasn't (probably due to my own stupidity).\n> > \n> > I need to correct A, i.e. merge with B, but keeping the branches already\n> > in flux, and propagating the changes due to the merge to them. In short,\n> > replace A with a properly merged A'.\n> > \n> > I tried branching from C and merging with B, then rebasing topic branches,\n> > but then I am not sure how to rebase 'local'to eliminate A.\n> \n> Try using\n> \n>   $ git rebase --onto A' A local\n\nThanks a lot, that did it.\n\nI've got confused by the wording of the git-rebase man page. It says:\n\n       <upstream>\n          Upstream branch to compare against\n\nWhich suggests to me that <upstream> must be a branch tip, and not a\nrandom commit, as seems to be the case (well, not random, but reachable\nfrom <branch> if I understand well). Also, the man page doesn't give any\nexample of rebasing using a random commit as <upstream>, they all use\nbranch tips which reinforced my wrong assumption.\n\n-- \nBlu.\n"},{"id":"33658","messageId":"20070205200236.GB8623@spearce.org","threadId":"6695","inReplyTo":"20070205195332.GW14499@daga.cl","subject":"Re: replacing a bad commit","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-05T20:02:36Z","receivedAt":"2007-02-05T20:02:36Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Blu Corater <blu@daga.cl> wrote:\n> I've got confused by the wording of the git-rebase man page. It says:\n> \n>        <upstream>\n>           Upstream branch to compare against\n\nHmm.  Yes, that manpage can be somewhat confusing.\n \n> Which suggests to me that <upstream> must be a branch tip, and not a\n> random commit, as seems to be the case (well, not random, but reachable\n> from <branch> if I understand well). Also, the man page doesn't give any\n> example of rebasing using a random commit as <upstream>, they all use\n> branch tips which reinforced my wrong assumption.\n\nThe faster you abandon the idea of branch tip as argument, the\nfaster you will pickup the more advanced operations in Git.\n\nAnytime we talk about a branch as input to a command, it can really\nbe any commit.  And anytime we talk about a commit or an object,\nit can be expressed by using any of the operators discussed in\ngit-rev-parse's man page, which would include using a branch name\nor an abbreviated (or full) SHA-1.\n\nThere are a limited number of commands which expect a branch name\n(and only a branch name), as they modify that branch to contain a\nnew value.  Examples of these are relatively rare, but include:\n\n  git-branch: the first argument is the name of the branch to create.\n  git-checkout -b: again, the name of the branch to create.\n  git-fetch: it can be asked to update local tracking branches.\n\n-- \nShawn.\n"},{"id":"33660","messageId":"20070205202154.GA21890@daga.cl","threadId":"6695","inReplyTo":"20070205200236.GB8623@spearce.org","subject":"Re: replacing a bad commit","fromName":"Blu Corater","fromEmail":"blu@daga.cl","sentAt":"2007-02-05T20:21:54Z","receivedAt":"2007-02-05T20:21:54Z","isPatch":false,"sender":{"key":"blu@daga.cl","avatar":null},"body":"On Mon, Feb 05, 2007 at 03:02:36PM -0500, Shawn O. Pearce wrote:\n\n[...]\n> The faster you abandon the idea of branch tip as argument, the\n> faster you will pickup the more advanced operations in Git.\n[...]\n\nIndeed. Changing that piece of mindframe makes git look a lot more\npowerful than it already was in my mind. \n\nThanks.\n\n-- \nBlu.\n"},{"id":"33661","messageId":"eq84ht$oaf$1@sea.gmane.org","threadId":"6695","inReplyTo":"20070205195332.GW14499@daga.cl","subject":"Re: replacing a bad commit","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-05T20:38:47Z","receivedAt":"2007-02-05T20:38:47Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Blu Corater wrote:\n> On Mon, Feb 05, 2007 at 05:38:18PM +0100, Jakub Narebski wrote:\n\n>> Try using\n>> \n>>   $ git rebase --onto A' A local\n> \n> Thanks a lot, that did it.\n> \n> I've got confused by the wording of the git-rebase man page. It says:\n> \n>        <upstream>\n>           Upstream branch to compare against\n> \n> Which suggests to me that <upstream> must be a branch tip, and not a\n> random commit, as seems to be the case (well, not random, but reachable\n> from <branch> if I understand well). Also, the man page doesn't give any\n> example of rebasing using a random commit as <upstream>, they all use\n> branch tips which reinforced my wrong assumption.\n\nWell, I think that two examples of using --onto should make it clear\nenough (especially second one), and both are quite similar to your\nsituation I think.\n\nBut I agree that git-rebase(1) needs clarification. Do you volunteer? ;-)\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"33668","messageId":"20070205205324.GC21890@daga.cl","threadId":"6695","inReplyTo":"eq84ht$oaf$1@sea.gmane.org","subject":"Re: replacing a bad commit","fromName":"Blu Corater","fromEmail":"blu@daga.cl","sentAt":"2007-02-05T20:53:24Z","receivedAt":"2007-02-05T20:53:24Z","isPatch":false,"sender":{"key":"blu@daga.cl","avatar":null},"body":"On Mon, Feb 05, 2007 at 09:38:47PM +0100, Jakub Narebski wrote:\n\n[...]\n> But I agree that git-rebase(1) needs clarification. Do you volunteer? ;-)\n[...]\n\nIn fact I was mentally preparing a patch when Shawn got ahead of me :)\n\nLet me learn the list conventions on sending patches and I will send\nsomething.\n\n-- \nBlu.\n"},{"id":"33669","messageId":"20070205205853.GA8908@spearce.org","threadId":"6695","inReplyTo":"20070205205324.GC21890@daga.cl","subject":"Re: replacing a bad commit","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-05T20:58:53Z","receivedAt":"2007-02-05T20:58:53Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Blu Corater <blu@daga.cl> wrote:\n> Let me learn the list conventions on sending patches and I will send\n> something.\n\nIts covered in Documentation/SubmittingPatches.\n\nAny patches to improve Git are definately welcome.  Please help.  ;-)\n\n-- \nShawn.\n"}]}