{"thread":{"id":"14610","subject":"RFC: git rebase -i and root commits","startedAt":"2008-07-23T01:58:41Z","lastAt":"2008-07-23T09:05:04Z","messageCount":3,"participants":["Eric Raible","Stephan Beyer","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"84433","messageId":"loom.20080723T013019-412@post.gmane.org","threadId":"14610","inReplyTo":null,"subject":"RFC: git rebase -i and root commits","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2008-07-23T01:58:41Z","receivedAt":"2008-07-23T01:58:41Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"My normal workflow is to create a .gitignore in my initial commit.\n\nWhen I later realize that I've forgotten something from that file\nI could of course just commit the changes, but I'd rather use \"git rebase -i\"\nin the normal way to make myself appear smarter than I am.\nEspecially since this realization usually comes early on\n(and certainly before publishing).\n\nBut rebase can't go all the way to a root (\"fatal: Needed a single revision\").\nThe best I've found is:\n\n1) git checkout -b temp <root commit>\n2) echo '*.tmp' >> .gitignore\n3) git commit --amend .gitignore\n4) git rebase --onto temp <root commit> master\n\nIf there really is an asymmetry here and I haven't missed anything\n(a large assumption), then what's the best way to think about it?\n\nIs there a role for a default commit (e.g. the sha1 of \"\") here so that\n'rebase -i' can update all commits and not just the ones with parents?\n\nOr should I just get used to it and move on?\n\nThanks - Eric\n"},{"id":"84434","messageId":"20080723020232.GF5904@leksak.fem-net","threadId":"14610","inReplyTo":"loom.20080723T013019-412@post.gmane.org","subject":"Re: RFC: git rebase -i and root commits","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-23T02:02:32Z","receivedAt":"2008-07-23T02:02:32Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nEric Raible wrote:\n> My normal workflow is to create a .gitignore in my initial commit.\n> \n> When I later realize that I've forgotten something from that file\n> I could of course just commit the changes, but I'd rather use \"git rebase -i\"\n> in the normal way to make myself appear smarter than I am.\n> Especially since this realization usually comes early on\n> (and certainly before publishing).\n> \n> But rebase can't go all the way to a root (\"fatal: Needed a single revision\").\n\nI think this has been fixed recently.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"84449","messageId":"alpine.DEB.1.00.0807231103230.2830@eeepc-johanness","threadId":"14610","inReplyTo":"20080723020232.GF5904@leksak.fem-net","subject":"Re: RFC: git rebase -i and root commits","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-23T09:05:04Z","receivedAt":"2008-07-23T09:05:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 23 Jul 2008, Stephan Beyer wrote:\n\n> Eric Raible wrote:\n> > My normal workflow is to create a .gitignore in my initial commit.\n> > \n> > When I later realize that I've forgotten something from that file\n> > I could of course just commit the changes, but I'd rather use \"git rebase -i\"\n> > in the normal way to make myself appear smarter than I am.\n> > Especially since this realization usually comes early on\n> > (and certainly before publishing).\n> > \n> > But rebase can't go all the way to a root (\"fatal: Needed a single revision\").\n> \n> I think this has been fixed recently.\n\nNo, it has not.\n\nWhat has been fixed is that you can cherry-pick a root commit now, not \nrebase onto nothing.\n\nWhile I am somewhat sympathetic with Eric's use case, I am not sure that \nwe should support it with rebase -i.\n\nCiao,\nDscho\n"}]}