{"thread":{"id":"20192","subject":"git rebase stops on empty commits","startedAt":"2009-07-22T07:22:13Z","lastAt":"2009-07-22T23:01:32Z","messageCount":6,"participants":["Mark Blakeney","Peter Krefting","Nanako Shiraishi"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118452","messageId":"33e2b2760907220022rbad30d7x255bcb63c5b8cc2f@mail.gmail.com","threadId":"20192","inReplyTo":null,"subject":"git rebase stops on empty commits","fromName":"Mark Blakeney","fromEmail":"markb@berlios.de","sentAt":"2009-07-22T07:22:13Z","receivedAt":"2009-07-22T07:22:13Z","isPatch":false,"sender":{"key":"markb@berlios.de","avatar":null},"body":"I am new to git but think I have found a bug. I searched the git archives\nand found the same issue reported by Michael Gruber about 1 year ago but it\nwas discounted by Stephan Beyer and the problem seems to be forgotten about.\n\nSee http://kerneltrap.org/mailarchive/git/2008/7/8/2388804\n\nIn short, I think git rebase needs a \"--allow-empty\" option. I have git\nrepo which I converted from an old system and which for various reasons\nrequires me to --allow-empty commits when I build it. The repo has about\n3300 commits but now when I try to fix up some of the early commit\ncomments using git rebase -i I find I have to manually sit at the\nterminal and dumbly type;\n\n    git commit --allow-empty (then quit out of editor)\n    git rebase --continue\n\nad nauseum for all the many empty commits ...\n\nI'm only rebasing to change some commit messages which must be a trivial\ngit operation. Surely git rebase -i should be able to be told to\ncontinue through empty commits itself? At the very least some kind of\nmessage to the user would help - I only found that git commit\n--allow-empty works around this rebase problem once I found the old\npost above.\n\nI am using the latest version 1.6.3.3 of git. This is the version used\nto build the repo from scratch and for the git rebase -i etc.\n\n--\nMark Blakeney\n"},{"id":"118453","messageId":"loom.20090722T073645-17@post.gmane.org","threadId":"20192","inReplyTo":"33e2b2760907220022rbad30d7x255bcb63c5b8cc2f@mail.gmail.com","subject":"Re: git rebase stops on empty commits","fromName":"Mark Blakeney","fromEmail":"markb@berlios.de","sentAt":"2009-07-22T07:44:26Z","receivedAt":"2009-07-22T07:44:26Z","isPatch":false,"sender":{"key":"markb@berlios.de","avatar":null},"body":"Actually, further to this I have more justification why this can be considered a\nbug.\n\nAfter performing the \"git rebase -i\" I find that all the \"git commit --amend\"\nedits are correctly committed with the original commit author and date+time etc\nbut all the \"git commit --allow-empty\" commits are committed with my own name\nand current date+time.\n"},{"id":"118455","messageId":"alpine.DEB.2.00.0907220907550.9220@ds9.cixit.se","threadId":"20192","inReplyTo":"loom.20090722T073645-17@post.gmane.org","subject":"Re: git rebase stops on empty commits","fromName":"Peter Krefting","fromEmail":"peter@softwolves.pp.se","sentAt":"2009-07-22T08:08:55Z","receivedAt":"2009-07-22T08:08:55Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Mark Blakeney:\n\n> but all the \"git commit --allow-empty\" commits are committed with my own \n> name and current date+time.\n\nIf you edit the commit, you claim ownership of it. You should probably try \nusing the -C option to commit, it should allow you to edit the message, \nwhile keeping the authorship and timestamp intact.\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"118458","messageId":"loom.20090722T120617-839@post.gmane.org","threadId":"20192","inReplyTo":"alpine.DEB.2.00.0907220907550.9220@ds9.cixit.se","subject":"Re: git rebase stops on empty commits","fromName":"Mark Blakeney","fromEmail":"markb@berlios.de","sentAt":"2009-07-22T12:29:19Z","receivedAt":"2009-07-22T12:29:19Z","isPatch":false,"sender":{"key":"markb@berlios.de","avatar":null},"body":"Peter Krefting <peter <at> softwolves.pp.se> writes:\n> If you edit the commit, you claim ownership of it. You should probably try \n> using the -C option to commit, it should allow you to edit the message, \n> while keeping the authorship and timestamp intact.\n\nThanks Peter, that works well. E.g.\n\n    % git rebase --continue\n    Finished one cherry-pick.\n    # Not currently on any branch.\n    nothing to commit (working directory clean)\n    Could not apply c33a375... Stop LNCC until OPC connection\n    % git commit --allow-empty -C c33a375\n    [detached HEAD e7d66f4] Stop LNCC until OPC connection\n    % git rebase --continue\n    ....\n\nSo rebase can actually do what I want but my fundamental issue remains. I said\n\"pick\" in the rebase for all of these commits but rebase is forcing me to do\neach one manually! And it requires some rather arcane git magic that could only\nbe procured from a guru on a mailing list. :)\n\nSurely something like an option --allow-empty on the rebase -i to skip over\nthese no-brainer picks is trivial to implement - and makes sense? As a simple\nuser, and knowing the original commits required --allow-empty, it was the first\noption I went looking for on the rebase -i when I encountered this problem.\n"},{"id":"118506","messageId":"20090723070812.6117@nanako3.lavabit.com","threadId":"20192","inReplyTo":"loom.20090722T120617-839@post.gmane.org","subject":"Re: git rebase stops on empty commits","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-07-22T22:08:12Z","receivedAt":"2009-07-22T22:08:12Z","isPatch":false,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Mark Blakeney <markb@berlios.de>\n\n> Surely something like an option --allow-empty on the rebase -i to skip over\n> these no-brainer picks is trivial to implement - and makes sense? As a simple\n> user, and knowing the original commits required --allow-empty, it was the first\n> option I went looking for on the rebase -i when I encountered this problem.\n\nI think an alternative is to use 'git rebase --skip'. I don't understand why you can't get rid of the commits that don't do anything and serve no purpose once and for all.\n\nIn your first message you only said 'for various reasons' and it isn't clear why you need such empty commits. Often people say they want to add a comment about the state of the tree with empty commits, but tags are designed for that purpose. Unlike some other systems a tag can have a message of its own.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"118521","messageId":"loom.20090722T224408-68@post.gmane.org","threadId":"20192","inReplyTo":"20090723070812.6117@nanako3.lavabit.com","subject":"Re: git rebase stops on empty commits","fromName":"Mark Blakeney","fromEmail":"markb@berlios.de","sentAt":"2009-07-22T23:01:32Z","receivedAt":"2009-07-22T23:01:32Z","isPatch":false,"sender":{"key":"markb@berlios.de","avatar":null},"body":"Because these particular original commits were real commits ported from our\nprevious archaic system which for technical reasons have lost the actual file\nchanges (although they are trivial for each of these particular cases). But all\nour commit comments are very verbose and valuable, specifically in these cases,\nso it would be a shame to lose them from the linear change history.\n\nAnyway, the question of why anybody would want empty commits is beside the main\npoint. The fact is that git provides this option so my bug sugestion here is\nthat git rebase does not cater for this existing git commit option very well. My\ncontention is that \"git commit\" supports --allow-empty so \"git rebase\" should as\nwell.\n"}]}