{"thread":{"id":"17038","subject":"git rebase orthodontics","startedAt":"2009-01-07T14:47:43Z","lastAt":"2009-01-07T16:31:04Z","messageCount":3,"participants":["jidanni@jidanni.org","Boyd Stephen Smith Jr.","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"99584","messageId":"87sknvxje8.fsf@jidanni.org","threadId":"17038","inReplyTo":null,"subject":"git rebase orthodontics","fromName":"","fromEmail":"jidanni@jidanni.org","sentAt":"2009-01-07T14:47:43Z","receivedAt":"2009-01-07T14:47:43Z","isPatch":false,"sender":{"key":"jidanni@jidanni.org","avatar":"https://gravatar.com/avatar/36568d4af4c8d3e71627ef3b8c8d00e39065b12f29676cccd38ced75e68fa2a6?d=mp&s=160"},"body":"In today's adventure we follow junior user me as he sets off in his\nfirst bumper car ride on the wrong side of git-rebase, wherein he\ndiscovers there are no guard rails. git version 1.6.0.6.\n\n$ git branch\n* jidanni\n  master\n$ git commit -m bla --allow-empty\n$ git rebase --interactive master\n(In the editor I change the single pick offered into a squash)\ngrep: ....git/rebase-merge/done: No such file or directory\nCannot 'squash' without a previous commit\n(OK, but the grep error being shown to the user is a bug.)\n\n$ git show --abbrev-commit --pretty=raw jidanni master\ncommit 07aef4a...\ntree 28f9caca33a8294d36b3d42f21ff472c6126da16\nparent 3ad166e006afc3ce57a35b6ac650569e557b024a...\ncommit 3ad166e...\ntree 28f9caca33a8294d36b3d42f21ff472c6126da16\nparent 726f8d08e2f7642d56a568eb82a685de0da0baf7\n$ EDITOR=cat git rebase --interactive master\npick 07aef4a This is a commit with No files, wow. bla.\n# Rebase 3ad166e..07aef4a onto 3ad166e ...\nSuccessfully rebased and updated refs/heads/jidanni.\n(But it didn't. git show shows no change. ls -l shows\nrefs/heads/jidanni was not touched.\nOK, it seems like all I am doing is changing\n              A jidanni\n             /\nD---E---F---G master\ninto the same thing, a noop. But shouldn't it warn and quit, instead\nof rewarding me with the success message? Let's try it the other way\naround:\n$ git checkout master\n$ git rebase --interactive jidanni #Wherein one sees:\nnoop\n# Rebase 07aef4a..3ad166e onto 07aef4a\nSuccessfully rebased and updated refs/heads/master.\nOK, now I have achieved\nD---E---F---G---A master, jidanni\nObservations:\nWhen I tried a noop, it didn't say noop in the editor.\nWhen I tried a yesop, it did say noop in the editor.\nIn both cases it gave the same success message.\n"},{"id":"99590","messageId":"200901071010.43926.bss@iguanasuicide.net","threadId":"17038","inReplyTo":"87sknvxje8.fsf@jidanni.org","subject":"Re: git rebase orthodontics","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-01-07T16:10:40Z","receivedAt":"2009-01-07T16:10:40Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"If you want to go from:\n>               A jidanni\n>              /\n> D---E---F---G master\n\nTo:\n> D---E---F---G---A master, jidanni\n\nYou don't want rebase.  You want 'git checkout master && git merge jidanni'.  \nI think you can throw --no-commit on the merge is you want to avoid a non-ff \nupdate to the master ref.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"99594","messageId":"200901071731.20343.trast@student.ethz.ch","threadId":"17038","inReplyTo":"87sknvxje8.fsf@jidanni.org","subject":"Re: git rebase orthodontics","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-01-07T16:31:04Z","receivedAt":"2009-01-07T16:31:04Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"jidanni@jidanni.org wrote:\n> wherein he discovers there are no guard rails\n\nGood thing you learned this before getting to git-reset.\n\n> $ EDITOR=cat git rebase --interactive master\n> pick 07aef4a This is a commit with No files, wow. bla.\n> # Rebase 3ad166e..07aef4a onto 3ad166e ...\n> Successfully rebased and updated refs/heads/jidanni.\n> (But it didn't. git show shows no change. ls -l shows\n> refs/heads/jidanni was not touched.\n> OK, it seems like all I am doing is changing\n>               A jidanni\n>              /\n> D---E---F---G master\n> into the same thing, a noop. But shouldn't it warn and quit, instead\n> of rewarding me with the success message?\n\nYou asked for an interactive rebase of the range master..jidanni,\nwhich consists of A, so it gave you an editor offering 'pick A' and\nthe chance to change that.\n\nNon-interactive rebase indeed checks if you attempt to rebase, but are\nalready up to date.  Interactive doesn't; the assumption is that\ninteractive rebases aren't used \"blindly\" to update.  (Rebasing\nchanges committer and commit time, so there is a difference between\nnot rebasing at all, and merely ending up with the same history.)\n\n> Let's try it the other way\n> around:\n> $ git checkout master\n> $ git rebase --interactive jidanni #Wherein one sees:\n> noop\n> # Rebase 07aef4a..3ad166e onto 07aef4a\n> Successfully rebased and updated refs/heads/master.\n> OK, now I have achieved\n> D---E---F---G---A master, jidanni\n> Observations:\n> When I tried a noop, it didn't say noop in the editor.\n> When I tried a yesop, it did say noop in the editor.\n\nThe 'noop' means that there are no commits in the range you asked to\nrebase, which is jidanni..master.  It's telling you that it is going\nto update the branch pointer, but not carry over any of the commits.\nThis can happen even if jidanni..master is nonempty, but all commits\nin it are already contained in jidanni.\n\n> In both cases it gave the same success message.\n\nIt successfully did what you told it to do.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n\n"}]}