{"thread":{"id":"63812","subject":"Contradictory git help rebase","startedAt":"2025-07-21T19:57:41Z","lastAt":"2025-07-21T20:37:53Z","messageCount":2,"participants":["Rodney Bates","Nico Williams"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"522368","messageId":"aafa3de8-5774-4a18-86dc-37493228b044@gmx.com","threadId":"63812","inReplyTo":null,"subject":"Contradictory git help rebase","fromName":"Rodney Bates","fromEmail":"rodney.bates@gmx.com","sentAt":"2025-07-21T19:57:37Z","receivedAt":"2025-07-21T19:57:41Z","isPatch":false,"sender":{"key":"rodney.bates@gmx.com","avatar":null},"body":"The text and an example in the output of git help rebase seem to contradict about\nwhich branch gets changed by git rebase master topic.  Here is an edited version\nof the output, with irrelevant stuff omitted and relationships made specific.\n\nNAME\n        git-rebase - Reapply commits on top of another base tip\n\nSYNOPSIS\n        git rebase\n                                                 [<upstream> [<branch>]]\n\nIn the example command below, <upstream> is master and <branch> is topic.\n\n\n        If <branch> is specified, git rebase will perform an automatic git switch <branch> before doing anything else.\n        Otherwise it remains on the current branch.\n\nCurrent branch is now <branch>=topic.\n\n        If <upstream> is not specified ... (irrelevant)\n\n\n        All changes made by commits in the current branch (=topic) but that are not in <=upstream> (master) are saved to a temporary area.\n\n        The current branch is reset to <upstream>,\n\nCurrent branch is now <upstream>=master.\n\n        The commits that were previously saved into the temporary area are then reapplied to the current branch (master), one by\n        one, in order.\n\nI.e., master is changed, topic is not.\n\n\n        Assume the following history exists and the current branch is \"topic\":\n\n                      A---B---C topic\n                     /\n                D---E---F---G master\n\n        From this point, the result of either of the following commands:\n\n\n            git rebase master topic\n\n        would be:\n\n                              A'--B'--C' topic\n                             /\n                D---E---F---G master\n\nBut this diagram shows topic changed, master not.\n\n"},{"id":"522371","messageId":"aH6jIGoyXc5pn8Ar@ubby","threadId":"63812","inReplyTo":"aafa3de8-5774-4a18-86dc-37493228b044@gmx.com","subject":"Re: Contradictory git help rebase","fromName":"Nico Williams","fromEmail":"nico@cryptonector.com","sentAt":"2025-07-21T20:29:20Z","receivedAt":"2025-07-21T20:37:53Z","isPatch":false,"sender":{"key":"nico@cryptonector.com","avatar":null},"body":"On Mon, Jul 21, 2025 at 02:57:37PM -0500, Rodney Bates wrote:\n> The text and an example in the output of git help rebase seem to contradict about\n> which branch gets changed by git rebase master topic.  Here is an edited version\n> of the output, with irrelevant stuff omitted and relationships made specific.\n> \n> NAME\n>        git-rebase - Reapply commits on top of another base tip\n> \n> SYNOPSIS\n>        git rebase\n>                                                 [<upstream> [<branch>]]\n> \n> In the example command below, <upstream> is master and <branch> is topic.\n> \n> \n>        If <branch> is specified, git rebase will perform an automatic git switch <branch> before doing anything else.\n>        Otherwise it remains on the current branch.\n> \n> Current branch is now <branch>=topic.\n> \n>        If <upstream> is not specified ... (irrelevant)\n> \n> \n>        All changes made by commits in the current branch (=topic) but that are not in <=upstream> (master) are saved to a temporary area.\n> \n>        The current branch is reset to <upstream>,\n> \n> Current branch is now <upstream>=master.\n\nNo, that's not correct.  \"The current branch is reset to <upstream>\"\nmeans that the current branch's head commit is reset to the same as\n<upstream>'s.  That's what resetting a branch means: it means changing\nthe commit that the branch points to.\n\nYou misinterpreted \"[t]he current branch is reset to <upstream>\" to mean\n\"the current workspace's branch is changed to be <upstream>\", but this\nis wrong.\n\n\"Reset\" is confusing, so it's no surprise that it confused you.\n\n>        The commits that were previously saved into the temporary area are then reapplied to the current branch (master), one by\n>        one, in order.\n> \n> I.e., master is changed, topic is not.\n>\n> [...]\n>\n> But this diagram shows topic changed, master not.\n\nNo, because you misunderstood what reset means.\n\nNico\n-- \n"}]}