{"thread":{"id":"19421","subject":"help reproduce fast-forward in rebase","startedAt":"2009-05-20T08:13:33Z","lastAt":"2009-05-20T09:37:50Z","messageCount":4,"participants":["Nguyen Thai Ngoc Duy","Johannes Sixt","Stephan Beyer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"114323","messageId":"fcaeb9bf0905200113s43eb5693l24a1f8848bafabd2@mail.gmail.com","threadId":"19421","inReplyTo":null,"subject":"help reproduce fast-forward in rebase","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2009-05-20T08:13:33Z","receivedAt":"2009-05-20T08:13:33Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nI'm rewriting rebase in C and do not quite understand this code inside\ngit-rebase.sh\n\n# If the $onto is a proper descendant of the tip of the branch, then\n# we just fast forwarded.\nif test \"$mb\" = \"$branch\"\nthen\n\techo >&2 \"Fast-forwarded $branch_name to $onto_name.\"\n\tmove_to_original_branch\n\texit 0\nfi\n\nAnyone has an example how to make \"git rebase\" execute that code?\n-- \nDuy\n"},{"id":"114328","messageId":"4A13CCD7.5090900@viscovery.net","threadId":"19421","inReplyTo":"fcaeb9bf0905200113s43eb5693l24a1f8848bafabd2@mail.gmail.com","subject":"Re: help reproduce fast-forward in rebase","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-20T09:26:47Z","receivedAt":"2009-05-20T09:26:47Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Nguyen Thai Ngoc Duy schrieb:\n> Hi,\n> \n> I'm rewriting rebase in C and do not quite understand this code inside\n> git-rebase.sh\n\nOne thing that has annoyed me sometimes is that 'git rebase --cont' works\nonly after 'git rebase -i' but not after plain 'git rebase'. The reason is\nthat the two instances of rebase do their own argument parsing, and the\ninteractive version uses rev-parse --parseopt, and normal rebase does not.\nI hope you will rectify this situation.\n\n> # If the $onto is a proper descendant of the tip of the branch, then\n> # we just fast forwarded.\n> if test \"$mb\" = \"$branch\"\n> then\n> \techo >&2 \"Fast-forwarded $branch_name to $onto_name.\"\n> \tmove_to_original_branch\n> \texit 0\n> fi\n> \n> Anyone has an example how to make \"git rebase\" execute that code?\n\n  $ git checkout -b topic master^\n  Switched to a new branch 'topic'\n  $ git rebase master\n  First, rewinding head to replay your work on top of it...\n  Fast-forwarded topic to master.\n\nThat is, topic was already merged into master.\n\n-- Hannes\n"},{"id":"114329","messageId":"20090520093321.GF6169@leksak.fem-net","threadId":"19421","inReplyTo":"fcaeb9bf0905200113s43eb5693l24a1f8848bafabd2@mail.gmail.com","subject":"Re: help reproduce fast-forward in rebase","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2009-05-20T09:33:21Z","receivedAt":"2009-05-20T09:33:21Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi Nguyen,\n\nNguyen Thai Ngoc Duy wrote:\n> Hi,\n> \n> I'm rewriting rebase in C\n\nOh. First two remarks that may or may not affect you:\n\n 1. rebase -i -p is reworked by Dscho:\n\n    http://repo.or.cz/w/git/dscho.git?a=shortlog;h=refs/heads/rebase-i-p\n\n 2. sequencer, a C backend for git am and git rebase -i, actually exists\n\n    http://repo.or.cz/w/git/sbeyer.git?a=shortlog;h=refs/heads/seq-builtin-dev\n\n    although to even more lack of time the missing/non-perfect parts are not\n    getting fewer.\n\n\nBoth remarks regard \"rebase -i\" and not the am-based rebase, which means\nyou are not getting into some kind of conflict with these other developments\n(or IOW: you are not doing already done work a second or third time) when you\nkeep your rebase rewrite close to the original in sh.\n\n> and do not quite understand this code inside git-rebase.sh\n> \n> # If the $onto is a proper descendant of the tip of the branch, then\n> # we just fast forwarded.\n> if test \"$mb\" = \"$branch\"\n> then\n> \techo >&2 \"Fast-forwarded $branch_name to $onto_name.\"\n> \tmove_to_original_branch\n> \texit 0\n> fi\n> \n> Anyone has an example how to make \"git rebase\" execute that code?\n\nYes, \"if the $onto is a proper descendant of the tip of the branch\",\nthen there are no commits that have to be rewritten. Rebasing can be\ndone by simple fast-forwarding, i.e. setting the branch to another,\nyet existing commit.\n\nExample:\n\n   * onto                 * onto, mybranch\n   |                      |\n   *                      *\n   |                      |\n   * mybranch    =>       *\n   |                      |\n   *                      *\n   |                      |\n\n\nRegards,\n  Stephan\n"},{"id":"114330","messageId":"fcaeb9bf0905200237j1cc4eb76hdc679975471e007@mail.gmail.com","threadId":"19421","inReplyTo":"20090520093321.GF6169@leksak.fem-net","subject":"Re: help reproduce fast-forward in rebase","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2009-05-20T09:37:50Z","receivedAt":"2009-05-20T09:37:50Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, May 20, 2009 at 7:33 PM, Stephan Beyer <s-beyer@gmx.net> wrote:\n> Hi Nguyen,\n>\n> Nguyen Thai Ngoc Duy wrote:\n>> Hi,\n>>\n>> I'm rewriting rebase in C\n>\n> Oh. First two remarks that may or may not affect you:\n>\n>  1. rebase -i -p is reworked by Dscho:\n>\n>    http://repo.or.cz/w/git/dscho.git?a=shortlog;h=refs/heads/rebase-i-p\n>\n>  2. sequencer, a C backend for git am and git rebase -i, actually exists\n>\n>    http://repo.or.cz/w/git/sbeyer.git?a=shortlog;h=refs/heads/seq-builtin-dev\n>\n>    although to even more lack of time the missing/non-perfect parts are not\n>    getting fewer.\n\nI should have said it clearer: I am rewriting git-rebase.sh in C, not\ngit-rebase--interactive.sh. The latter is even bigger than former.\nAnyway thanks for the pointers.\n-- \nDuy\n"}]}